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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/ast-literal-reindexer.h" | 9 #include "src/ast-literal-reindexer.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 kNeedsInitialization, kNotAssigned); | 2088 kNeedsInitialization, kNotAssigned); |
2089 } else if (declaration_scope->is_eval_scope() && | 2089 } else if (declaration_scope->is_eval_scope() && |
2090 is_sloppy(declaration_scope->language_mode())) { | 2090 is_sloppy(declaration_scope->language_mode())) { |
2091 // For variable declarations in a sloppy eval scope the proxy is bound | 2091 // For variable declarations in a sloppy eval scope the proxy is bound |
2092 // to a lookup variable to force a dynamic declaration using the | 2092 // to a lookup variable to force a dynamic declaration using the |
2093 // DeclareLookupSlot runtime function. | 2093 // DeclareLookupSlot runtime function. |
2094 Variable::Kind kind = Variable::NORMAL; | 2094 Variable::Kind kind = Variable::NORMAL; |
2095 // TODO(sigurds) figure out if kNotAssigned is OK here | 2095 // TODO(sigurds) figure out if kNotAssigned is OK here |
2096 var = new (zone()) Variable(declaration_scope, name, mode, kind, | 2096 var = new (zone()) Variable(declaration_scope, name, mode, kind, |
2097 declaration->initialization(), kNotAssigned); | 2097 declaration->initialization(), kNotAssigned); |
2098 var->AllocateTo(Variable::LOOKUP, -1); | 2098 var->AllocateTo(VariableLocation::LOOKUP, -1); |
2099 resolve = true; | 2099 resolve = true; |
2100 } | 2100 } |
2101 | 2101 |
2102 // If requested and we have a local variable, bind the proxy to the variable | 2102 // If requested and we have a local variable, bind the proxy to the variable |
2103 // at parse-time. This is used for functions (and consts) declared inside | 2103 // at parse-time. This is used for functions (and consts) declared inside |
2104 // statements: the corresponding function (or const) variable must be in the | 2104 // statements: the corresponding function (or const) variable must be in the |
2105 // function scope and not a statement-local scope, e.g. as provided with a | 2105 // function scope and not a statement-local scope, e.g. as provided with a |
2106 // 'with' statement: | 2106 // 'with' statement: |
2107 // | 2107 // |
2108 // with (obj) { | 2108 // with (obj) { |
(...skipping 3828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5937 Expression* Parser::SpreadCallNew(Expression* function, | 5937 Expression* Parser::SpreadCallNew(Expression* function, |
5938 ZoneList<v8::internal::Expression*>* args, | 5938 ZoneList<v8::internal::Expression*>* args, |
5939 int pos) { | 5939 int pos) { |
5940 args->InsertAt(0, function, zone()); | 5940 args->InsertAt(0, function, zone()); |
5941 | 5941 |
5942 return factory()->NewCallRuntime( | 5942 return factory()->NewCallRuntime( |
5943 ast_value_factory()->reflect_construct_string(), NULL, args, pos); | 5943 ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
5944 } | 5944 } |
5945 } // namespace internal | 5945 } // namespace internal |
5946 } // namespace v8 | 5946 } // namespace v8 |
OLD | NEW |