• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const { WPTRunner } = require('../common/wpt');
4
5const runner = new WPTRunner('url');
6
7runner.setScriptModifier((obj) => {
8  if (obj.filename.includes('toascii.window.js')) {
9    // `a` and `area` in `toascii.window.js` is for testing `Element` that
10    // created via `document.createElement`. So we need to ignore them and just
11    // test `URL`.
12    obj.code = obj.code.replace(/\["url", "a", "area"\]/, '[ "url" ]');
13  }
14});
15runner.pretendGlobalThisAs('Window');
16runner.setInitScript(`
17  globalThis.location ||= {};
18`);
19runner.runJsTests();
20