Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64

This commit is contained in:
WPT Sync Bot 2018-05-29 21:17:45 -04:00
parent 11a89bcc47
commit 8f98acd0e7
297 changed files with 3396 additions and 1555 deletions

View file

@ -1,2 +1,2 @@
import('./static-import-worker.js')
.then(module => postMessage('LOADED'));
import('./export-on-static-import-script.js')
.then(module => postMessage(module.importedModules));

View file

@ -1,4 +1,5 @@
// Dynamically import the script URL sent by postMessage().
self.addEventListener('message', e => {
import(e.data).catch(error_event => postMessage('ERROR'));
// This worker dynamically imports the script URL sent by postMessage(), and
// sends back an error name if the dynamic import fails.
self.addEventListener('message', msg_event => {
import(msg_event.data).catch(e => postMessage(e.name));
});

View file

@ -1,2 +1,2 @@
import('./post-message-on-load-worker.js')
.then(module => postMessage('LOADED'));
import('./export-on-load-script.js')
.then(module => postMessage(module.importedModules));

View file

@ -0,0 +1,3 @@
const code = "import('./export-on-load-script.js')" +
" .then(module => postMessage(module.importedModules));"
eval(code);

View file

@ -0,0 +1,7 @@
// Export the list of imported modules. It's available after the |ready| promise
// is resolved.
export let importedModules = ['export-on-dynamic-import-script.js'];
export let ready = import('./export-on-load-script.js')
.then(module => {
Array.prototype.push.apply(importedModules, module.importedModules);
});

View file

@ -0,0 +1 @@
export const importedModules = ['export-on-load-script.js'];

View file

@ -0,0 +1,3 @@
import * as module from './export-on-load-script.js';
const filename = 'export-on-static-import-script.js';
export const importedModules = [filename].concat(module.importedModules);

View file

@ -2,5 +2,14 @@ try {
importScripts('empty-worker.js');
postMessage('LOADED');
} catch (e) {
// Post a message instead of propagating an ErrorEvent to the page because
// propagated event loses an error name.
//
// Step 1. "Let notHandled be the result of firing an event named error at the
// Worker object associated with the worker, using ErrorEvent, with the
// cancelable attribute initialized to true, the message, filename, lineno,
// and colno attributes initialized appropriately, and the error attribute
// initialized to null."
// https://html.spec.whatwg.org/multipage/workers.html#runtime-script-errors-2
postMessage(e.name);
}

View file

@ -1,2 +1,5 @@
import('./dynamic-import-worker.js')
.then(module => postMessage('LOADED'));
import('./export-on-dynamic-import-script.js')
.then(async module => {
await module.ready;
postMessage(module.importedModules);
});

View file

@ -1,2 +1,2 @@
import './static-import-worker.js';
postMessage('LOADED')
import * as module from './export-on-static-import-script.js';
postMessage(module.importedModules);

View file

@ -1,2 +1,2 @@
import './dynamic-import-worker.js';
postMessage('LOADED');
import * as module from './export-on-dynamic-import-script.js';
module.ready.then(() => postMessage(module.importedModules));

View file

@ -1,2 +1,2 @@
import './post-message-on-load-worker.js';
postMessage('LOADED');
import * as module from './export-on-load-script.js';
postMessage(module.importedModules);