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

Unified Diff: src/runtime/runtime-object.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-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 6d4bad5c6f889e5f0f833c648a1db335eb10cd0b..c85ab050e9f0db2a218b1d062cac45743ead6123 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -927,5 +927,23 @@ RUNTIME_FUNCTION(Runtime_CreateDataProperty) {
return *value;
}
+RUNTIME_FUNCTION(Runtime_LoadModuleExport) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
+ Handle<JSModule> module(isolate->context()->module());
+ return *JSModule::LoadExport(module, name);
+}
+
+RUNTIME_FUNCTION(Runtime_StoreModuleExport) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 2);
+ CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
+ Handle<JSModule> module(isolate->context()->module());
+ JSModule::StoreExport(module, name, value);
+ return isolate->heap()->undefined_value();
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698