chromium/third_party/blink/web_tests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/error-worker.js

var source;

self.addEventListener('message', function(e) {
  source = e.source;
  throw 'testError';
});

self.addEventListener('error', function(e) {
  source.postMessage({
    error: e.error, filename: e.filename, message: e.message, lineno: e.lineno,
    colno: e.colno});
});