Index: src/runtime/runtime-scopes.cc |
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc |
index acdce8d1cf294af4b986d5b741cb5a4ef7f0b8d4..b55336fb8051584819c80ae067c9694311ff3ec5 100644 |
--- a/src/runtime/runtime-scopes.cc |
+++ b/src/runtime/runtime-scopes.cc |
@@ -217,6 +217,7 @@ Object* DeclareEvalHelper(Isolate* isolate, Handle<String> name, |
// a declaration block scope. Since this is called from eval, the context |
// passed is the context of the caller, which may be some nested context and |
// not the declaration context. |
+ // XXX module context??? |
Handle<Context> context_arg(isolate->context(), isolate); |
Handle<Context> context(context_arg->declaration_context(), isolate); |
@@ -699,6 +700,19 @@ RUNTIME_FUNCTION(Runtime_PushWithContext) { |
return *context; |
} |
+RUNTIME_FUNCTION(Runtime_PushModuleContext) { |
+ HandleScope scope(isolate); |
+ DCHECK_EQ(3, args.length()); |
+ CONVERT_ARG_HANDLE_CHECKED(JSModule, module, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 1); |
+ CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 2); |
+ DCHECK(function->context() == isolate->context()); |
+ |
+ Handle<Context> context = |
+ isolate->factory()->NewModuleContext(module, function, scope_info); |
+ isolate->set_context(*context); |
+ return *context; |
+} |
RUNTIME_FUNCTION(Runtime_PushCatchContext) { |
HandleScope scope(isolate); |