Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove disused entries from error names table (2.8.1.) #946

Merged
merged 1 commit into from
Jan 15, 2021

Conversation

kt3k
Copy link
Contributor

@kt3k kt3k commented Jan 15, 2021

No major browser implements these 3 error-name-to-error-code mappings in DOMException constructor. So this PR suggests removing these 3 entries from the table.

We found this while updating web platform test at web-platform-tests/wpt#27181.

cc @domenic

@annevk
Copy link
Member

annevk commented Jan 15, 2021

I'm not sure this is correct, e.g., DOMException.DOMSTRING_SIZE_ERR returns 2 for me in Firefox.

@kt3k
Copy link
Contributor Author

kt3k commented Jan 15, 2021

DOMException.DOMSTRING_SIZE_ERR returns 2 for me in Firefox.

That's right, but this PR doesn't suggest removing that constant. What the table (2.8.1.) defines is the mapping from the error name to error code. e.g. new DOMException('foo', 'DOMStringSizeError').code should be 2 (=== DOMException.DOMSTRING_SIZE_ERR) according to the table, but new DOMException('foo', 'DOMStringSizeError').code is actually 0 in all 4 major browsers.

I checked these mappings (of deprecated ones) by the following expression:

[
  new DOMException('foo', 'IndexSizeError').code,
  new DOMException('foo', 'DOMStringSizeError').code,
  new DOMException('foo', 'ValidationError').code,
  new DOMException('foo', 'InvalidAccessError').code,
  new DOMException('foo', 'NoDataAllowedError').code,
  new DOMException('foo', 'TypeMismatchError').code
]

The major 4 browsers all return [ 1, 0, 0, 15, 0, 17 ], which means they don't implement mappings of DOMStringSizeError => 2, ValidationError => 6, NoDataAllowedError => 16.

@domenic domenic merged commit 29afaf0 into whatwg:master Jan 15, 2021
domenic pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 15, 2021
In particular, this tests the deprecated ones, some removed ones, and some newer error names which intentionally don't have legacy error codes. See also whatwg/webidl#946.

Closes #27151.
@kt3k kt3k deleted the update-error-names-table branch January 16, 2021 02:46
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jan 19, 2021
…ames table, a=testonly

Automatic update from web-platform-tests
DOMException: test code mapping for all error names

In particular, this tests the deprecated ones, some removed ones, and some newer error names which intentionally don't have legacy error codes. See also whatwg/webidl#946.

Closes #27151.
--

wpt-commits: 93c6faceda56025f1c96c0155990bf1d231dac9c
wpt-pr: 27181
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 25, 2021
…ames table, a=testonly

Automatic update from web-platform-tests
DOMException: test code mapping for all error names

In particular, this tests the deprecated ones, some removed ones, and some newer error names which intentionally don't have legacy error codes. See also whatwg/webidl#946.

Closes #27151.
--

wpt-commits: 93c6faceda56025f1c96c0155990bf1d231dac9c
wpt-pr: 27181

UltraBlame original commit: 84dd97dc22528263ce280a59cb531b3ab2fed488
domenic added a commit to jsdom/domexception that referenced this pull request Oct 3, 2021
domenic added a commit to jsdom/domexception that referenced this pull request Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants