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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp

Issue 2788573002: [ES6 modules] Introduce ScriptModule::moduleRequests to access record.[[RequestedModules]] (Closed)
Patch Set: rebased Created 3 years, 8 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: third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
index e31f8543edef4422fc650afabce14bb90ae91034..af36c3de58677f35ce528c4b78a050673fd9b618 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
@@ -62,6 +62,23 @@ void ScriptModule::evaluate(ScriptState* scriptState) {
}
}
+Vector<String> ScriptModule::moduleRequests(ScriptState* scriptState) {
+ if (isNull())
+ return Vector<String>();
+
+ v8::Local<v8::Module> module = m_module->newLocal(scriptState->isolate());
+
+ Vector<String> ret;
+
+ int length = module->GetModuleRequestsLength();
+ ret.reserveInitialCapacity(length);
+ for (int i = 0; i < length; ++i) {
+ v8::Local<v8::String> v8Name = module->GetModuleRequest(i);
+ ret.push_back(toCoreString(v8Name));
+ }
+ return ret;
+}
+
v8::MaybeLocal<v8::Module> ScriptModule::resolveModuleCallback(
v8::Local<v8::Context> context,
v8::Local<v8::String> specifier,

Powered by Google App Engine
This is Rietveld 408576698