OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/compiler.h" // TODO(titzer): remove this include dependency | 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1127 // declarations from different scopes. It covers for example | 1127 // declarations from different scopes. It covers for example |
1128 // | 1128 // |
1129 // function f() { { { var x; } let x; } } | 1129 // function f() { { { var x; } let x; } } |
1130 // function g() { { var x; let x; } } | 1130 // function g() { { var x; let x; } } |
1131 // | 1131 // |
1132 // The var declarations are hoisted to the function scope, but originate from | 1132 // The var declarations are hoisted to the function scope, but originate from |
1133 // a scope where the name has also been let bound or the var declaration is | 1133 // a scope where the name has also been let bound or the var declaration is |
1134 // hoisted over such a scope. | 1134 // hoisted over such a scope. |
1135 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); | 1135 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); |
1136 | 1136 |
1137 void InsertSloppyBlockFunctionVarBindings(Scope* scope, bool* ok); | |
adamk
2015/09/11 15:42:56
I think this deserves a quick comment, perhaps jus
Dan Ehrenberg
2015/09/17 17:44:10
Done
| |
1138 | |
1137 // Parser support | 1139 // Parser support |
1138 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); | 1140 VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); |
1139 Variable* Declare(Declaration* declaration, | 1141 Variable* Declare(Declaration* declaration, |
1140 DeclarationDescriptor::Kind declaration_kind, bool resolve, | 1142 DeclarationDescriptor::Kind declaration_kind, bool resolve, |
1141 bool* ok, Scope* declaration_scope = nullptr); | 1143 bool* ok, Scope* declaration_scope = nullptr); |
1142 | 1144 |
1143 bool TargetStackContainsLabel(const AstRawString* label); | 1145 bool TargetStackContainsLabel(const AstRawString* label); |
1144 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); | 1146 BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); |
1145 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); | 1147 IterationStatement* LookupContinueTarget(const AstRawString* label, bool* ok); |
1146 | 1148 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1366 parser_->BuildParameterInitializationBlock(parameters, ok); | 1368 parser_->BuildParameterInitializationBlock(parameters, ok); |
1367 if (!*ok) return; | 1369 if (!*ok) return; |
1368 if (init_block != nullptr) { | 1370 if (init_block != nullptr) { |
1369 body->Add(init_block, parser_->zone()); | 1371 body->Add(init_block, parser_->zone()); |
1370 } | 1372 } |
1371 } | 1373 } |
1372 } | 1374 } |
1373 } } // namespace v8::internal | 1375 } } // namespace v8::internal |
1374 | 1376 |
1375 #endif // V8_PARSER_H_ | 1377 #endif // V8_PARSER_H_ |
OLD | NEW |