Chromium Code Reviews| 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 3642e50d29e06bf845e1c80fa82a44cdbdc378f8..d220fb03d94fa7ca5416f30f3c0b19e815c83751 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp |
| @@ -53,4 +53,22 @@ 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); |
| + String name = toCoreString(v8Name); |
| + ret.push_back(name); |
|
haraken
2017/04/04 04:32:09
ret.push_back(toCoreString(v8Name));
|
| + } |
| + return ret; |
| +} |
| + |
| } // namespace blink |