GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: use an array for WPT gloablThis initialization scripts · nodejs/node@f0e8ff9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/common
    • wpt.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/common/wpt.js‎

Copy file name to clipboardExpand all lines: test/common/wpt.js
+10-9Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ class WPTRunner {
408408
this.resource = new ResourceLoader(path);
409409

410410
this.flags = [];
411-
this.dummyGlobalThisScript = null;
411+
this.globalThisInitScripts = [];
412412
this.initScript = null;
413413

414414
this.status = new StatusLoader(path);
@@ -463,17 +463,17 @@ class WPTRunner {
463463
initScript = `${initScript}\n\n//===\nglobalThis.location.search = "${locationSearchString}";`;
464464
}
465465

466-
if (initScript === null && this.dummyGlobalThisScript === null) {
467-
return null;
466+
if (this.globalThisInitScripts.length === null) {
467+
return initScript;
468468
}
469469

470+
const globalThisInitScript = this.globalThisInitScripts.join('\n\n//===\n');
471+
470472
if (initScript === null) {
471-
return this.dummyGlobalThisScript;
472-
} else if (this.dummyGlobalThisScript === null) {
473-
return initScript;
473+
return globalThisInitScript;
474474
}
475475

476-
return `${this.dummyGlobalThisScript}\n\n//===\n${initScript}`;
476+
return `${globalThisInitScript}\n\n//===\n${initScript}`;
477477
}
478478

479479
/**
@@ -484,8 +484,9 @@ class WPTRunner {
484484
pretendGlobalThisAs(name) {
485485
switch (name) {
486486
case 'Window': {
487-
this.dummyGlobalThisScript =
488-
'global.Window = Object.getPrototypeOf(globalThis).constructor;';
487+
this.globalThisInitScripts.push(
488+
`global.Window = Object.getPrototypeOf(globalThis).constructor;
489+
self.GLOBAL.isWorker = () => false;`);
489490
break;
490491
}
491492

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.