summaryrefslogtreecommitdiff
path: root/tools/wpt/runner.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/wpt/runner.ts')
-rw-r--r--tools/wpt/runner.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/wpt/runner.ts b/tools/wpt/runner.ts
index 3a412a56c..0cf625f01 100644
--- a/tools/wpt/runner.ts
+++ b/tools/wpt/runner.ts
@@ -168,9 +168,13 @@ async function generateBundle(location: URL): Promise<string> {
}
}
- return scriptContents.map(([url, contents]) =>
- `Deno.core.evalContext(${JSON.stringify(contents)}, ${
- JSON.stringify(url)
- });`
- ).join("\n");
+ return scriptContents.map(([url, contents]) => `
+(function() {
+ const [_,err] = Deno.core.evalContext(${JSON.stringify(contents)}, ${
+ JSON.stringify(url)
+ });
+ if (err !== null) {
+ throw err?.thrown;
+ }
+})();`).join("\n");
}