summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/workers/error_event.ts
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2022-04-27 00:06:10 +0100
committerGitHub <noreply@github.com>2022-04-27 01:06:10 +0200
commit9853c96cc4686a6cd1ffa1e9081c012b8df72ff7 (patch)
treec631ebfc363c06c468367be7ecd5b98110dde3a0 /cli/tests/testdata/workers/error_event.ts
parent58eab0e2b37fd8c3c83445196d4bde419740373d (diff)
refactor: Remove PrettyJsError and js_error_create_fn (#14378)
This commit: - removes "fmt_errors::PrettyJsError" in favor of "format_js_error" fn - removes "deno_core::JsError::create" and "deno_core::RuntimeOptions::js_error_create_fn" - adds new option to "deno_runtime::ops::worker_host::init"
Diffstat (limited to 'cli/tests/testdata/workers/error_event.ts')
-rw-r--r--cli/tests/testdata/workers/error_event.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/testdata/workers/error_event.ts b/cli/tests/testdata/workers/error_event.ts
new file mode 100644
index 000000000..f3046178a
--- /dev/null
+++ b/cli/tests/testdata/workers/error_event.ts
@@ -0,0 +1,11 @@
+const worker = new Worker(new URL("error.ts", import.meta.url).href, {
+ type: "module",
+});
+worker.addEventListener("error", (e) => {
+ console.log({
+ "message": e.message,
+ "filename": e.filename?.slice?.(-100),
+ "lineno": e.lineno,
+ "colno": e.colno,
+ });
+});