From 5fa056e53be6d17ab746629ea0eaa89fe817141b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 18 Jan 2020 00:43:53 +0100 Subject: workers: minimal error handling and async module loading (#3665) --- cli/tests/subdir/test_worker.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cli/tests/subdir') diff --git a/cli/tests/subdir/test_worker.js b/cli/tests/subdir/test_worker.js index 53d38ba96..cec5bdf9b 100644 --- a/cli/tests/subdir/test_worker.js +++ b/cli/tests/subdir/test_worker.js @@ -1,7 +1,19 @@ +let thrown = false; + onmessage = function(e) { console.log(e.data); + if (thrown === false) { + thrown = true; + throw new SyntaxError("[test error]"); + } + postMessage(e.data); workerClose(); }; + +onerror = function() { + console.log("called onerror in worker"); + return false; +}; -- cgit v1.2.3