Summary: | Cannot Object.seal() or Object.freeze() global "this" | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Michael Saboff <msaboff> | ||||
Component: | JavaScriptCore | Assignee: | Michael Saboff <msaboff> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | buildbot, keith_miller, mark.lam, saam | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | Other | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Michael Saboff
2017-04-06 08:43:39 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? (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. 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. Created attachment 306423 [details]
Patch
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. Comment on attachment 306423 [details]
Patch
r=me
Fix landed in change set r215072: <http://trac.webkit.org/changeset/215072> |