Bug 161554 - Object.preventExtensions(window) should throw a TypeError
Summary: Object.preventExtensions(window) should throw a TypeError
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://tc39.github.io/ecma262/#sec-o...
Keywords: WebExposed
Depends on:
Reported: 2016-09-02 16:16 PDT by Chris Dumez
Modified: 2020-11-23 23:45 PST (History)
7 users (show)

See Also:

Patch (5.77 KB, patch)
2016-09-02 19:02 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Comment 2 Darin Adler 2016-09-03 07:25:43 PDT
Comment on attachment 287845 [details]

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]

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.