WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
170549
Cannot Object.seal() or Object.freeze() global "this"
https://bugs.webkit.org/show_bug.cgi?id=170549
Summary
Cannot Object.seal() or Object.freeze() global "this"
Michael Saboff
Reported
2017-04-06 08:43:39 PDT
The ECMAScript standard describes a isExtensible method for Proxy objects that forwards on to the wrapped object. See <
https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-isextensible
>. We don’t have that method in JavaScriptCore. <
rdar://problem/31478302
>
Attachments
Patch
(6.27 KB, patch)
2017-04-06 13:43 PDT
,
Michael Saboff
mark.lam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Saam Barati
Comment 1
2017-04-06 08:48:53 PDT
(In reply to Michael Saboff from
comment #0
)
> The ECMAScript standard describes a isExtensible method for Proxy objects > that forwards on to the wrapped object. See > <
https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and
- > internal-slots-isextensible>. We don’t have that method in JavaScriptCore. > > <
rdar://problem/31478302
>
The spec you linked to is for ProxyObject, not JSProxy. Perhaps the JSProxy info is in the HTML spec?
Michael Saboff
Comment 2
2017-04-06 09:12:16 PDT
(In reply to Saam Barati from
comment #1
)
> (In reply to Michael Saboff from
comment #0
) > > The ECMAScript standard describes a isExtensible method for Proxy objects > > that forwards on to the wrapped object. See > > <
https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and
- > > internal-slots-isextensible>. We don’t have that method in JavaScriptCore. > > > > <
rdar://problem/31478302
> > > The spec you linked to is for ProxyObject, not JSProxy. Perhaps the JSProxy > info is in the HTML spec?
I should have been more specific. This is needed for the global "this" as it is a JSProxy to the global object. JSProxy doesn't implement isExtensible, but ProxyObject does.
Michael Saboff
Comment 3
2017-04-06 13:31:02 PDT
Changing the bug title to the symptom of the problem instead the cause. Doing this since it appears the fix requires changes to other code besides JSProxy.
Michael Saboff
Comment 4
2017-04-06 13:43:01 PDT
Created
attachment 306423
[details]
Patch
Michael Saboff
Comment 5
2017-04-06 13:56:49 PDT
Comment on
attachment 306423
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=306423&action=review
> Source/JavaScriptCore/interpreter/Interpreter.cpp:1162 > + return checkedReturn(throwTypeError(callFrame, throwScope, ASCIILiteral(ReadonlyPropertyWriteError)));
A better error message is NonExtensibleObjectPropertyDefineError. I made that change locally.
Mark Lam
Comment 6
2017-04-06 13:57:17 PDT
Comment on
attachment 306423
[details]
Patch r=me
Michael Saboff
Comment 7
2017-04-06 17:17:48 PDT
Fix landed in change set
r215072
: <
http://trac.webkit.org/changeset/215072
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug