Changeset 205278 in webkit for trunk/Source/JavaScriptCore/runtime/JSModuleLoader.cpp
- Timestamp:
- Aug 31, 2016, 8:48:34 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSModuleLoader.cpp
r205276 r205278 87 87 } 88 88 89 JSInternalPromise* JSModuleLoader::loadAndEvaluateModule(ExecState* exec, JSValue moduleName, JSValue referrer )89 JSInternalPromise* JSModuleLoader::loadAndEvaluateModule(ExecState* exec, JSValue moduleName, JSValue referrer, JSValue initiator) 90 90 { 91 91 JSObject* function = jsCast<JSObject*>(get(exec, exec->propertyNames().builtinNames().loadAndEvaluateModulePublicName())); … … 97 97 arguments.append(moduleName); 98 98 arguments.append(referrer); 99 arguments.append(initiator); 99 100 100 101 return jsCast<JSInternalPromise*>(call(exec, function, callType, callData, this, arguments)); 101 102 } 102 103 103 JSInternalPromise* JSModuleLoader::loadModule(ExecState* exec, JSValue moduleName, JSValue referrer )104 JSInternalPromise* JSModuleLoader::loadModule(ExecState* exec, JSValue moduleName, JSValue referrer, JSValue initiator) 104 105 { 105 106 JSObject* function = jsCast<JSObject*>(get(exec, exec->propertyNames().builtinNames().loadModulePublicName())); … … 111 112 arguments.append(moduleName); 112 113 arguments.append(referrer); 114 arguments.append(initiator); 113 115 114 116 return jsCast<JSInternalPromise*>(call(exec, function, callType, callData, this, arguments)); 115 117 } 116 118 117 JSValue JSModuleLoader::linkAndEvaluateModule(ExecState* exec, JSValue moduleKey )119 JSValue JSModuleLoader::linkAndEvaluateModule(ExecState* exec, JSValue moduleKey, JSValue initiator) 118 120 { 119 121 JSObject* function = jsCast<JSObject*>(get(exec, exec->propertyNames().builtinNames().linkAndEvaluateModulePublicName())); … … 124 126 MarkedArgumentBuffer arguments; 125 127 arguments.append(moduleKey); 128 arguments.append(initiator); 126 129 127 130 return call(exec, function, callType, callData, this, arguments); 128 131 } 129 132 130 JSInternalPromise* JSModuleLoader::resolve(ExecState* exec, JSValue name, JSValue referrer )133 JSInternalPromise* JSModuleLoader::resolve(ExecState* exec, JSValue name, JSValue referrer, JSValue initiator) 131 134 { 132 135 if (Options::dumpModuleLoadingState()) … … 135 138 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 136 139 if (globalObject->globalObjectMethodTable()->moduleLoaderResolve) 137 return globalObject->globalObjectMethodTable()->moduleLoaderResolve(globalObject, exec, this, name, referrer );140 return globalObject->globalObjectMethodTable()->moduleLoaderResolve(globalObject, exec, this, name, referrer, initiator); 138 141 JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject); 139 142 deferred->resolve(exec, name); … … 141 144 } 142 145 143 JSInternalPromise* JSModuleLoader::fetch(ExecState* exec, JSValue key )146 JSInternalPromise* JSModuleLoader::fetch(ExecState* exec, JSValue key, JSValue initiator) 144 147 { 145 148 if (Options::dumpModuleLoadingState()) … … 148 151 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 149 152 if (globalObject->globalObjectMethodTable()->moduleLoaderFetch) 150 return globalObject->globalObjectMethodTable()->moduleLoaderFetch(globalObject, exec, this, key );153 return globalObject->globalObjectMethodTable()->moduleLoaderFetch(globalObject, exec, this, key, initiator); 151 154 JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject); 152 155 String moduleKey = key.toString(exec)->value(exec); … … 161 164 } 162 165 163 JSInternalPromise* JSModuleLoader::translate(ExecState* exec, JSValue key, JSValue payload )166 JSInternalPromise* JSModuleLoader::translate(ExecState* exec, JSValue key, JSValue payload, JSValue initiator) 164 167 { 165 168 if (Options::dumpModuleLoadingState()) … … 168 171 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 169 172 if (globalObject->globalObjectMethodTable()->moduleLoaderTranslate) 170 return globalObject->globalObjectMethodTable()->moduleLoaderTranslate(globalObject, exec, this, key, payload );173 return globalObject->globalObjectMethodTable()->moduleLoaderTranslate(globalObject, exec, this, key, payload, initiator); 171 174 JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject); 172 175 deferred->resolve(exec, payload); … … 174 177 } 175 178 176 JSInternalPromise* JSModuleLoader::instantiate(ExecState* exec, JSValue key, JSValue source )179 JSInternalPromise* JSModuleLoader::instantiate(ExecState* exec, JSValue key, JSValue source, JSValue initiator) 177 180 { 178 181 if (Options::dumpModuleLoadingState()) … … 181 184 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 182 185 if (globalObject->globalObjectMethodTable()->moduleLoaderInstantiate) 183 return globalObject->globalObjectMethodTable()->moduleLoaderInstantiate(globalObject, exec, this, key, source );186 return globalObject->globalObjectMethodTable()->moduleLoaderInstantiate(globalObject, exec, this, key, source, initiator); 184 187 JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject); 185 188 deferred->resolve(exec, jsUndefined()); … … 187 190 } 188 191 189 JSValue JSModuleLoader::evaluate(ExecState* exec, JSValue key, JSValue moduleRecordValue )192 JSValue JSModuleLoader::evaluate(ExecState* exec, JSValue key, JSValue moduleRecordValue, JSValue initiator) 190 193 { 191 194 if (Options::dumpModuleLoadingState()) … … 194 197 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 195 198 if (globalObject->globalObjectMethodTable()->moduleLoaderEvaluate) 196 return globalObject->globalObjectMethodTable()->moduleLoaderEvaluate(globalObject, exec, this, key, moduleRecordValue );199 return globalObject->globalObjectMethodTable()->moduleLoaderEvaluate(globalObject, exec, this, key, moduleRecordValue, initiator); 197 200 198 201 JSModuleRecord* moduleRecord = jsDynamicCast<JSModuleRecord*>(moduleRecordValue);
Note:
See TracChangeset
for help on using the changeset viewer.