Changeset 211818 in webkit
- Timestamp:
- Feb 7, 2017 10:24:49 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r211807 r211818 1 2017-02-07 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Unreviewed, manual roll out of r211777 4 https://bugs.webkit.org/show_bug.cgi?id=167457 5 6 Later, I'll reland it with the deterministic tests. 7 8 * inspector/controller/resources/cappuccino.js: Removed. 9 * inspector/controller/resources/cocoa.js: Removed. 10 * inspector/controller/resources/drink.js: Removed. 11 * inspector/controller/runtime-controller-expected.txt: 12 * inspector/controller/runtime-controller.html: 13 1 14 2017-02-07 Antoine Quint <graouts@apple.com> 2 15 -
trunk/LayoutTests/inspector/controller/runtime-controller-expected.txt
r211777 r211818 7 7 CONSOLE MESSAGE: line 9: Rejection 8 8 CONSOLE MESSAGE: line 7: %o 9 CONSOLE MESSAGE: line 7: %o10 CONSOLE MESSAGE: line 9: TypeError: Module specifier does not start with "/", "./", or "../".11 CONSOLE MESSAGE: line 9: TypeError: Importing a module script failed.12 CONSOLE MESSAGE: line 6: Cocoa is Sweet.13 CONSOLE MESSAGE: line 7: %o14 CONSOLE MESSAGE: line 6: Cocoa is Sweet. Cappuccino is Awesome.15 9 CONSOLE MESSAGE: line 7: %o 16 10 Tests for RuntimeManager operations. … … 65 59 PASS: Exception. Should not get transformed and produce a SyntaxError. 66 60 67 -- Running test case: RuntimeManager.prototype.evaluateInInspectedWindow.ImportFromConsole68 Source: await import('')69 PASS: Transformed. Should log the value or an exception.70 Source: await import('./not-found.js')71 PASS: Transformed. Should log the value or an exception.72 Source: await import('./resources/cocoa.js').then((cocoa) => console.log(`${cocoa.name} is ${cocoa.taste}.`))73 PASS: Transformed. Should log the value or an exception.74 Source: await import('./resources/drink.js').then((ns) => console.log(`${ns.Cocoa.name} is ${ns.Cocoa.taste}. ${ns.Cappuccino.name} is ${ns.Cappuccino.taste}.`))75 PASS: Transformed. Should log the value or an exception.76 -
trunk/LayoutTests/inspector/controller/runtime-controller.html
r211777 r211818 125 125 }); 126 126 127 suite.addTestCase({128 name: "RuntimeManager.prototype.evaluateInInspectedWindow.ImportFromConsole",129 description: "Test evaluating an import expression from console.",130 test(resolve, reject) {131 function testSource(expression) {132 WebInspector.runtimeManager.evaluateInInspectedWindow(expression, {objectGroup: "test"}, (result, wasThrown) => {133 InspectorTest.log("Source: " + expression);134 InspectorTest.expectThat(result.isUndefined(), "Transformed. Should log the value or an exception.");135 });136 }137 138 testSource("await import('')");139 testSource("await import('./not-found.js')");140 testSource("await import('./resources/cocoa.js').then((cocoa) => console.log(`${cocoa.name} is ${cocoa.taste}.`))");141 testSource("await import('./resources/drink.js').then((ns) => console.log(`${ns.Cocoa.name} is ${ns.Cocoa.taste}. ${ns.Cappuccino.name} is ${ns.Cappuccino.taste}.`))");142 143 InspectorBackend.runAfterPendingDispatches(resolve);144 }145 });146 147 127 suite.runTestCasesAndFinish(); 148 128 } -
trunk/Source/JavaScriptCore/ChangeLog
r211777 r211818 1 2017-02-07 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Unreviewed, manual roll out of r211777 4 https://bugs.webkit.org/show_bug.cgi?id=167457 5 6 * jsc.cpp: 7 (GlobalObject::moduleLoaderImportModule): 8 * runtime/JSGlobalObjectFunctions.cpp: 9 (JSC::globalFuncImportModule): 10 1 11 2017-02-07 Yusuke Suzuki <utatane.tea@gmail.com> 2 12 -
trunk/Source/JavaScriptCore/jsc.cpp
r211777 r211818 1552 1552 }; 1553 1553 1554 if (sourceOrigin.isNull())1555 return rejectPromise(createError(exec, ASCIILiteral("Could not resolve the module specifier.")));1556 1557 1554 auto referrer = sourceOrigin.string(); 1558 1555 auto moduleName = moduleNameValue->value(exec); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r211777 r211818 945 945 946 946 auto sourceOrigin = exec->callerSourceOrigin(); 947 if (sourceOrigin.isNull()) { 948 promise->reject(exec, createError(exec, ASCIILiteral("Could not resolve the module specifier."))); 949 return JSValue::encode(promise->promise()); 950 } 951 947 952 RELEASE_ASSERT(exec->argumentCount() == 1); 948 953 auto* specifier = exec->uncheckedArgument(0).toString(exec); -
trunk/Source/WebCore/ChangeLog
r211815 r211818 1 2017-02-07 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Unreviewed, manual roll out of r211777 4 https://bugs.webkit.org/show_bug.cgi?id=167457 5 6 * bindings/js/ScriptModuleLoader.cpp: 7 (WebCore::ScriptModuleLoader::importModule): 8 1 9 2017-02-07 Carlos Garcia Campos <cgarcia@igalia.com> 2 10 -
trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp
r211777 r211818 219 219 auto& globalObject = *JSC::jsCast<JSDOMGlobalObject*>(jsGlobalObject); 220 220 221 // If SourceOrigin and/or CachedScriptFetcher is null, we import the module with the default fetcher. 222 // SourceOrigin can be null if the source code is not coupled with the script file. 223 // The examples, 224 // 1. The code evaluated by the inspector. 225 // 2. The other unusual code execution like the evaluation through the NPAPI. 226 // 3. The code from injected bundle's script. 227 // 4. The code from extension script. 228 URL baseURL; 229 RefPtr<JSC::ScriptFetcher> scriptFetcher; 230 if (sourceOrigin.isNull()) { 231 baseURL = m_document.baseURL(); 232 scriptFetcher = CachedScriptFetcher::create(m_document.charset()); 233 } else { 234 baseURL = URL(URL(), sourceOrigin.string()); 235 if (!baseURL.isValid()) 236 return rejectPromise(state, globalObject, TypeError, ASCIILiteral("Importer module key is not a Symbol or a String.")); 237 238 if (sourceOrigin.fetcher()) 239 scriptFetcher = sourceOrigin.fetcher(); 240 else 241 scriptFetcher = CachedScriptFetcher::create(m_document.charset()); 242 } 243 ASSERT(baseURL.isValid()); 244 ASSERT(scriptFetcher); 221 // FIXME: setTimeout and setInterval with "string()" should propagate SourceOrigin. 222 // https://webkit.org/b/167097 223 ASSERT_WITH_MESSAGE(!sourceOrigin.isNull(), "If SourceOrigin is null, this function is not invoked."); 224 if (!sourceOrigin.fetcher()) 225 return rejectPromise(state, globalObject, TypeError, ASCIILiteral("Could not use import operator in this context.")); 226 227 URL baseURL(URL(), sourceOrigin.string()); 228 if (!baseURL.isValid()) 229 return rejectPromise(state, globalObject, TypeError, ASCIILiteral("Importer module key is not Symbol or String.")); 245 230 246 231 auto specifier = moduleName->value(exec); … … 249 234 return rejectPromise(state, globalObject, TypeError, result.error()); 250 235 251 return JSC::importModule(exec, JSC::Identifier::fromString(&vm, result->string()), JSC::JSScriptFetcher::create(vm, WTFMove(scriptFetcher) ));236 return JSC::importModule(exec, JSC::Identifier::fromString(&vm, result->string()), JSC::JSScriptFetcher::create(vm, sourceOrigin.fetcher() )); 252 237 } 253 238
Note: See TracChangeset
for help on using the changeset viewer.