commit | 2d35d2f1cccd622e956e1828a9f323afe04700dd | [log] [tgz] |
---|---|---|
author | Daniel Bratell <bratell@opera.com> | Mon Mar 04 11:01:57 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Mar 04 11:01:57 2019 |
tree | a8ec34829febb9e954322c4167bb722343527516 | |
parent | 00e85f1bd0a1b4b7b48d47acf2f9ad11ff5ed124 [diff] |
Remove variable shadowing in blink/html In an effort to reduce or even ban variable shadowing, this renames a variable to avoid such shadowing. I'm interested in prohibiting shadowing because I think it might prevent potential jumbo problems. The exact warnings this avoids are: In file included from ./../../third_party/blink/renderer/core/html/forms/base_temporal_input_type.cc:31: In file included from ../../third_party/blink/renderer/core/html/forms/base_temporal_input_type.h:34: In file included from ../../third_party/blink/renderer/core/html/forms/date_time_edit_element.h:31: third_party/blink/renderer/core/html/forms/date_time_field_element.h:43:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow] kDispatchNoEvent, ^ third_party/blink/renderer/core/html/forms/text_control_element.h:46:3: note: previous declaration is here kDispatchNoEvent, ^ third_party/blink/renderer/core/html/forms/date_time_numeric_field_element.cc:98:9: error: declaration shadows a local variable [-Werror,-Wshadow] int value = TypeAheadValue(); ^ third_party/blink/renderer/core/html/forms/date_time_numeric_field_element.cc:95:51: note: previous declaration is here void DateTimeNumericFieldElement::SetFocused(bool value, ^ third_party/blink/renderer/core/html/forms/html_option_element.cc:348:15: error: declaration shadows a local variable [-Werror,-Wshadow] if (auto* select = ToHTMLSelectElementOrNull(insertion_point.parentNode())) ^ third_party/blink/renderer/core/html/forms/html_option_element.cc:344:13: note: previous declaration is here if (auto* select = ToHTMLSelectElementOrNull(insertion_point)) { ^ third_party/blink/renderer/core/html/html_hr_element.cc:138:15: error: declaration shadows a local variable [-Werror,-Wshadow] if (auto* select = ToHTMLSelectElementOrNull(parent)) ^ third_party/blink/renderer/core/html/html_hr_element.cc:133:13: note: previous declaration is here if (auto* select = ToHTMLSelectElementOrNull(insertion_point)) { ^ third_party/blink/renderer/core/html/html_slot_element.cc:125:17: error: declaration shadows a local variable [-Werror,-Wshadow] if (auto* slot = ToHTMLSlotElementIfSupportsAssignmentOrNull(child)) ^ third_party/blink/renderer/core/html/html_slot_element.cc:115:28: note: previous declaration is here const HTMLSlotElement& slot) { ^ third_party/blink/renderer/core/html/html_slot_element.cc:133:17: error: declaration shadows a local variable [-Werror,-Wshadow] if (auto* slot = ToHTMLSlotElementIfSupportsAssignmentOrNull(*node)) ^ third_party/blink/renderer/core/html/html_slot_element.cc:115:28: note: previous declaration is here const HTMLSlotElement& slot) { ^ third_party/blink/renderer/core/html/track/vtt/vtt_cue.cc:770:14: error: declaration shadows a local variable [-Werror,-Wshadow] double current_timestamp; ^ third_party/blink/renderer/core/html/track/vtt/vtt_cue.cc:764:10: note: previous declaration is here double current_timestamp = startTime(); ^ third_party/blink/renderer/core/html/parser/html_tree_builder.cc:1464:14: error: declaration shadows a local variable [-Werror,-Wshadow] for (int i = 0; i < kInnerIterationLimit; ++i) { ^ third_party/blink/renderer/core/html/parser/html_tree_builder.cc:1415:12: note: previous declaration is here for (int i = 0; i < kOuterIterationLimit; ++i) { ^ third_party/blink/renderer/core/html/parser/text_resource_decoder.cc:332:9: error: declaration shadows a local variable [-Werror,-Wshadow] int len = 0; ^ third_party/blink/renderer/core/html/parser/text_resource_decoder.cc:297:57: note: previous declaration is here wtf_size_t len, Change-Id: I5ab4a7b99bb5f55cf2f0a97a2691c7aa3c6fd88d Reviewed-on: https://chromium-review.googlesource.com/c/1478898 Commit-Queue: Daniel Bratell <bratell@opera.com> Reviewed-by: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#637252}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .