Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: src/runtime/runtime-scopes.cc

Issue 2302783002: [modules] Basic support of exports (Closed)
Patch Set: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698