Bug 161554

Summary: Object.preventExtensions(window) should throw a TypeError
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ashvayka, cdumez, commit-queue, ggaren, mark.lam, rniwa, saam
Priority: P2 Keywords: WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://tc39.github.io/ecma262/#sec-object.preventextensions
See Also: https://bugs.webkit.org/show_bug.cgi?id=161486
https://bugs.webkit.org/show_bug.cgi?id=219270
Attachments:
Description Flags
Patch none

Description Chris Dumez 2016-09-02 16:16:47 PDT
Object.preventExtensions() should throw a TypeError if [[PreventExtensions]] returns false:
- https://tc39.github.io/ecma262/#sec-object.preventextensions

We currently do not throw.
Comment 1 Chris Dumez 2016-09-02 19:02:08 PDT
Created attachment 287845 [details]
Patch
Comment 2 Darin Adler 2016-09-03 07:25:43 PDT
Comment on attachment 287845 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=287845&action=review

The code here doesn’t make sense to me.

> Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:349
> +    throwTypeError(exec, scope, ASCIILiteral("Cannot prevent extensions on this object"));

Should the message be more specific than "this object"?
Comment 3 WebKit Commit Bot 2016-09-03 07:46:54 PDT
Comment on attachment 287845 [details]
Patch

Clearing flags on attachment: 287845

Committed r205404: <http://trac.webkit.org/changeset/205404>
Comment 4 WebKit Commit Bot 2016-09-03 07:46:57 PDT
All reviewed patches have been landed.  Closing bug.