commit | 55d967ab07b7f35f5631b56039c114e76428e202 | [log] [tgz] |
---|---|---|
author | Daniel Bratell <bratell@opera.com> | Fri Feb 22 14:55:44 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Feb 22 14:55:44 2019 |
tree | fd00963b89a9bb82633c141d32f3eec4f9abd1d0 | |
parent | 90c86f0ce73498a900dbb601f1de95dc519de18a [diff] |
Avoid variable/type shadowing in blink/dom 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: third_party/blink/renderer/core/dom/element.cc:3940:35: error: declaration shadows a local variable [-Werror,-Wshadow] else if (const Attribute* attribute = ^ third_party/blink/renderer/core/dom/element.cc:3938:30: note: previous declaration is here if (const Attribute* attribute = attributes.Find(xml_names::kLangAttr)) ^ third_party/blink/renderer/core/dom/node.cc:2113:17: error: declaration shadows a local variable [-Werror,-Wshadow] const Node* node = chain[index - 1]; ^ third_party/blink/renderer/core/dom/node.cc:2107:15: note: previous declaration is here const Node* node = this; ^ third_party/blink/renderer/core/dom/range.cc:529:36: error: declaration shadows a type alias in namespace 'blink' [-Werror,-Wshadow] typedef HeapVector<Member<Node>> NodeVector; ^ third_party/blink/renderer/core/dom/container_node.h:84:7: note: previous declaration is here using NodeVector = HeapVector<Member<Node>, kInitialNodeVectorSize>; ^ third_party/blink/renderer/core/dom/range.cc:750:36: error: declaration shadows a type alias in namespace 'blink' [-Werror,-Wshadow] typedef HeapVector<Member<Node>> NodeVector; ^ third_party/blink/renderer/core/dom/container_node.h:84:7: note: previous declaration is here using NodeVector = HeapVector<Member<Node>, kInitialNodeVectorSize>; ^ Bug: 925310 Change-Id: I8bc037dd1cf54baf5f6fe1ed93b1ead391313e8a Reviewed-on: https://chromium-review.googlesource.com/c/1478876 Reviewed-by: Fredrik Söderquist <fs@opera.com> Commit-Queue: Daniel Bratell <bratell@opera.com> Auto-Submit: Daniel Bratell <bratell@opera.com> Cr-Commit-Position: refs/heads/master@{#634659}
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 .