fix: align DOMException API to the spec and add web platform testing of it. (#9106)

* fix: align DOMException API to the spec

* test: fix test case 070_location

* test(DOMException): disable "does not inherit from Error: class-side"
test of WPT

* test: remove test cases in deno codebase

* docs: add note about skipped test
This commit is contained in:
Yoshiya Hinosawa 2021-01-14 22:08:49 +09:00 committed by GitHub
parent 78c27e0923
commit c75f92c4e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 125 additions and 47 deletions

View file

@ -1,18 +0,0 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals, unitTest } from "./test_util.ts";
unitTest(function testDomError() {
const de = new DOMException("foo", "bar");
assert(de);
assertEquals(de.message, "foo");
assertEquals(de.name, "bar");
assertEquals(de.code, 0);
});
unitTest(function testKnownDomException() {
const de = new DOMException("foo", "SyntaxError");
assert(de);
assertEquals(de.message, "foo");
assertEquals(de.name, "SyntaxError");
assertEquals(de.code, 12);
});