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

Side by Side Diff: src/ast/variables.h

Issue 1564343002: Fix for temporaries in parameter initializers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | src/parsing/parameter-initializer-rewriter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_VARIABLES_H_ 5 #ifndef V8_AST_VARIABLES_H_
6 #define V8_AST_VARIABLES_H_ 6 #define V8_AST_VARIABLES_H_
7 7
8 #include "src/ast/ast-value-factory.h" 8 #include "src/ast/ast-value-factory.h"
9 #include "src/zone.h" 9 #include "src/zone.h"
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 // Printing support 31 // Printing support
32 static const char* Mode2String(VariableMode mode); 32 static const char* Mode2String(VariableMode mode);
33 33
34 // The source code for an eval() call may refer to a variable that is 34 // The source code for an eval() call may refer to a variable that is
35 // in an outer scope about which we don't know anything (it may not 35 // in an outer scope about which we don't know anything (it may not
36 // be the script scope). scope() is NULL in that case. Currently the 36 // be the script scope). scope() is NULL in that case. Currently the
37 // scope is only used to follow the context chain length. 37 // scope is only used to follow the context chain length.
38 Scope* scope() const { return scope_; } 38 Scope* scope() const { return scope_; }
39 39
40 // This is for adjusting the scope of temporaries used when desugaring
41 // parameter initializers.
42 void set_scope(Scope* scope) { scope_ = scope; }
43
40 Handle<String> name() const { return name_->string(); } 44 Handle<String> name() const { return name_->string(); }
41 const AstRawString* raw_name() const { return name_; } 45 const AstRawString* raw_name() const { return name_; }
42 VariableMode mode() const { return mode_; } 46 VariableMode mode() const { return mode_; }
43 bool has_forced_context_allocation() const { 47 bool has_forced_context_allocation() const {
44 return force_context_allocation_; 48 return force_context_allocation_;
45 } 49 }
46 void ForceContextAllocation() { 50 void ForceContextAllocation() {
47 force_context_allocation_ = true; 51 force_context_allocation_ = true;
48 } 52 }
49 bool is_used() { return is_used_; } 53 bool is_used() { return is_used_; }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 private: 209 private:
206 // For classes we keep track of consecutive groups of delcarations. They are 210 // For classes we keep track of consecutive groups of delcarations. They are
207 // needed for strong mode scoping checks. TODO(marja, rossberg): Implement 211 // needed for strong mode scoping checks. TODO(marja, rossberg): Implement
208 // checks for functions too. 212 // checks for functions too.
209 int declaration_group_start_; 213 int declaration_group_start_;
210 }; 214 };
211 } // namespace internal 215 } // namespace internal
212 } // namespace v8 216 } // namespace v8
213 217
214 #endif // V8_AST_VARIABLES_H_ 218 #endif // V8_AST_VARIABLES_H_
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | src/parsing/parameter-initializer-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698