| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 | 769 |
| 770 // Allocate module context. | 770 // Allocate module context. |
| 771 HandleScope scope(isolate); | 771 HandleScope scope(isolate); |
| 772 Factory* factory = isolate->factory(); | 772 Factory* factory = isolate->factory(); |
| 773 Handle<Context> context = factory->NewModuleContext(scope_info); | 773 Handle<Context> context = factory->NewModuleContext(scope_info); |
| 774 Handle<JSModule> module = factory->NewJSModule(context, scope_info); | 774 Handle<JSModule> module = factory->NewJSModule(context, scope_info); |
| 775 context->set_module(*module); | 775 context->set_module(*module); |
| 776 Context* previous = isolate->context(); | 776 Context* previous = isolate->context(); |
| 777 context->set_previous(previous); | 777 context->set_previous(previous); |
| 778 context->set_closure(previous->closure()); | 778 context->set_closure(previous->closure()); |
| 779 context->set_global_object(previous->global_object()); | 779 context->set_native_context(previous->native_context()); |
| 780 isolate->set_context(*context); | 780 isolate->set_context(*context); |
| 781 | 781 |
| 782 // Find hosting scope and initialize internal variable holding module there. | 782 // Find hosting scope and initialize internal variable holding module there. |
| 783 previous->script_context()->set(index, *context); | 783 previous->script_context()->set(index, *context); |
| 784 | 784 |
| 785 return *context; | 785 return *context; |
| 786 } | 786 } |
| 787 | 787 |
| 788 | 788 |
| 789 RUNTIME_FUNCTION(Runtime_DeclareModules) { | 789 RUNTIME_FUNCTION(Runtime_DeclareModules) { |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 | 1128 |
| 1129 // Lookup in the initial Object.prototype object. | 1129 // Lookup in the initial Object.prototype object. |
| 1130 Handle<Object> result; | 1130 Handle<Object> result; |
| 1131 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1131 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 1132 isolate, result, | 1132 isolate, result, |
| 1133 Object::GetProperty(isolate->initial_object_prototype(), key)); | 1133 Object::GetProperty(isolate->initial_object_prototype(), key)); |
| 1134 return *result; | 1134 return *result; |
| 1135 } | 1135 } |
| 1136 } // namespace internal | 1136 } // namespace internal |
| 1137 } // namespace v8 | 1137 } // namespace v8 |
| OLD | NEW |