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

Location shouldn't use %ObjProto_toString% as the value of its "toString" property #2284

Closed
anba opened this issue Jan 23, 2017 · 2 comments
Closed
Assignees

Comments

@anba
Copy link

anba commented Jan 23, 2017

Step 2 in https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface performs:

  1. Perform ! location.[[DefineOwnProperty]]("toString", { [[Value]]: %ObjProto_toString%, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }).

@annevk told me that this contradicts the [Unforgeable] stringifier which is defined later.

Originally filed at https://bugzilla.mozilla.org/show_bug.cgi?id=1333045.

@annevk annevk added the good first issue Ideal for someone new to a WHATWG standard or software project label Jan 23, 2017
@annevk
Copy link
Member

annevk commented Jan 23, 2017

Fixing this basically involves removing that step as far as I can tell. The reason that step was added was because IDL defined it for unforgeable interfaces, which were a thing at some point. However, only Location was an unforgeable interface and overrode the toString() behavior defined for them. So I should never have copied the default behavior for toString() since it's not applicable.

@annevk
Copy link
Member

annevk commented Jan 23, 2017

I realized that apart from that step the one other mention of %ObjProto_toString% also needs to be removed.

annevk added a commit that referenced this issue Jan 25, 2017
I mistakenly copied all boilerplate from IDL’s unforgeable interfaces concept (which was only ever used for Location) and thereby turned the fallback behavior into the actual behavior (or an exception arguably, as [[Configurable]] is false).

Fixes #2284.
@domenic domenic removed the good first issue Ideal for someone new to a WHATWG standard or software project label Feb 10, 2017
annevk added a commit that referenced this issue Feb 14, 2017
I mistakenly copied all boilerplate from IDL’s unforgeable interfaces concept (which was only ever used for Location) and thereby turned the toString() fallback behavior into the actual behavior (or an exception arguably, as [[Configurable]] is false).

We also determined that only Firefox supports an unforgeable toJSON() and nobody really has a use for it, so that is dropped.

Tests: web-platform-tests/wpt#4623.

Fixes #2284.
alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
I mistakenly copied all boilerplate from IDL’s unforgeable interfaces concept (which was only ever used for Location) and thereby turned the toString() fallback behavior into the actual behavior (or an exception arguably, as [[Configurable]] is false).

We also determined that only Firefox supports an unforgeable toJSON() and nobody really has a use for it, so that is dropped.

Tests: web-platform-tests/wpt#4623.

Fixes whatwg#2284.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants