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/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2252 value->AsCall() == NULL && | 2252 value->AsCall() == NULL && |
2253 value->AsCallNew() == NULL) { | 2253 value->AsCallNew() == NULL) { |
2254 fni_->Infer(); | 2254 fni_->Infer(); |
2255 } else { | 2255 } else { |
2256 fni_->RemoveLastFunction(); | 2256 fni_->RemoveLastFunction(); |
2257 } | 2257 } |
2258 if (decl_props != NULL) *decl_props = kHasInitializers; | 2258 if (decl_props != NULL) *decl_props = kHasInitializers; |
2259 } | 2259 } |
2260 | 2260 |
2261 // Record the end position of the initializer. | 2261 // Record the end position of the initializer. |
2262 if (proxy->var() != NULL) { | 2262 if (proxy->is_resolved()) { |
2263 proxy->var()->set_initializer_position(position()); | 2263 proxy->var()->set_initializer_position(position()); |
2264 } | 2264 } |
2265 | 2265 |
2266 // Make sure that 'const x' and 'let x' initialize 'x' to undefined. | 2266 // Make sure that 'const x' and 'let x' initialize 'x' to undefined. |
2267 if (value == NULL && needs_init) { | 2267 if (value == NULL && needs_init) { |
2268 value = GetLiteralUndefined(position()); | 2268 value = GetLiteralUndefined(position()); |
2269 } | 2269 } |
2270 | 2270 |
2271 // Global variable declarations must be compiled in a specific | 2271 // Global variable declarations must be compiled in a specific |
2272 // way. When the script containing the global variable declaration | 2272 // way. When the script containing the global variable declaration |
(...skipping 2695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4968 | 4968 |
4969 // We cannot internalize on a background thread; a foreground task will take | 4969 // We cannot internalize on a background thread; a foreground task will take |
4970 // care of calling Parser::Internalize just before compilation. | 4970 // care of calling Parser::Internalize just before compilation. |
4971 | 4971 |
4972 if (compile_options() == ScriptCompiler::kProduceParserCache) { | 4972 if (compile_options() == ScriptCompiler::kProduceParserCache) { |
4973 if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); | 4973 if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); |
4974 log_ = NULL; | 4974 log_ = NULL; |
4975 } | 4975 } |
4976 } | 4976 } |
4977 } } // namespace v8::internal | 4977 } } // namespace v8::internal |
OLD | NEW |