summaryrefslogtreecommitdiff
path: root/core/runtime/error_builder_test.js
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-07-01 18:00:14 -0600
committerGitHub <noreply@github.com>2023-07-02 00:00:14 +0000
commite746b6d80654ba4e4e26370fe6e4f784ce841d92 (patch)
tree153ffad92a96126b9ab8e906dcdabf7648755931 /core/runtime/error_builder_test.js
parentb9c0e7cd550ab14fa7da7e33ed87cbeeeb9785a0 (diff)
refactor(core): Extract deno_core (#19658)
`deno_core` is moving out! You'll find it at https://github.com/denoland/deno_core/ once this PR lands.
Diffstat (limited to 'core/runtime/error_builder_test.js')
-rw-r--r--core/runtime/error_builder_test.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/core/runtime/error_builder_test.js b/core/runtime/error_builder_test.js
deleted file mode 100644
index f442819cb..000000000
--- a/core/runtime/error_builder_test.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-const { core } = Deno;
-const { ops } = core;
-
-class DOMException {
- constructor(message, code) {
- this.msg = message;
- this.code = code;
- }
-}
-
-core.registerErrorBuilder(
- "DOMExceptionOperationError",
- function DOMExceptionOperationError(msg) {
- return new DOMException(msg, "OperationError");
- },
-);
-
-try {
- ops.op_err();
- throw new Error("op_err didn't throw!");
-} catch (err) {
- if (!(err instanceof DOMException)) {
- throw new Error("err not DOMException");
- }
- if (err.msg !== "abc") {
- throw new Error("err.message is incorrect");
- }
- if (err.code !== "OperationError") {
- throw new Error("err.code is incorrect");
- }
-}