Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: src/ast/ast.h

Issue 2210533002: [modules] Mark namespace variables as kCreatedInitialized. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@modules-VariableLocation
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index baeb20ba27f9a6587d9dd876ee86c22988d8ae2b..a32ffcd842026165ef3ee6312202d7c913051004 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -517,16 +517,17 @@ class Declaration : public AstNode {
class VariableDeclaration final : public Declaration {
public:
- InitializationFlag initialization() const {
- return mode() == VAR ? kCreatedInitialized : kNeedsInitialization;
- }
+ InitializationFlag initialization() const { return initialization_; }
private:
friend class AstNodeFactory;
VariableDeclaration(VariableProxy* proxy, VariableMode mode, Scope* scope,
- int pos)
- : Declaration(proxy, mode, scope, pos, kVariableDeclaration) {}
+ InitializationFlag initialization, int pos)
+ : Declaration(proxy, mode, scope, pos, kVariableDeclaration),
+ initialization_(initialization) {}
+
+ InitializationFlag initialization_;
};
@@ -3007,7 +3008,16 @@ class AstNodeFactory final BASE_EMBEDDED {
VariableDeclaration* NewVariableDeclaration(VariableProxy* proxy,
VariableMode mode, Scope* scope,
int pos) {
- return new (zone_) VariableDeclaration(proxy, mode, scope, pos);
+ return NewVariableDeclaration(
+ proxy, mode, scope,
+ mode == VAR ? kCreatedInitialized : kNeedsInitialization, pos);
+ }
+
+ VariableDeclaration* NewVariableDeclaration(VariableProxy* proxy,
+ VariableMode mode, Scope* scope,
+ InitializationFlag init,
+ int pos) {
+ return new (zone_) VariableDeclaration(proxy, mode, scope, init, pos);
}
FunctionDeclaration* NewFunctionDeclaration(VariableProxy* proxy,
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698