Bug 206131 - Object.preventExtensions should throw if not successful
Summary: Object.preventExtensions should throw if not successful
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Minor
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-11 10:16 PST by Alexey Shvayka
Modified: 2020-01-15 11:58 PST (History)
10 users (show)

See Also:


Attachments
Patch (3.87 KB, patch)
2020-01-11 12:30 PST, Alexey Shvayka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shvayka 2020-01-11 10:16:36 PST
Test case:
  Object.preventExtensions(new Proxy({}, {
    preventExtensions: () => false
  }))

Expected:
  Throws TypeError

Actual:
  Returns Proxy

ECMA262: https://tc39.es/ecma262/#sec-object.preventextensions (step 3)
Test262: https://test262.report/browse/built-ins/Object/preventExtensions/throws-when-false.js
Comment 1 Alexey Shvayka 2020-01-11 12:30:34 PST
Created attachment 387443 [details]
Patch
Comment 2 Ross Kirsling 2020-01-15 10:23:27 PST
Comment on attachment 387443 [details]
Patch

r=me
Comment 3 WebKit Commit Bot 2020-01-15 11:57:44 PST
Comment on attachment 387443 [details]
Patch

Clearing flags on attachment: 387443

Committed r254626: <https://trac.webkit.org/changeset/254626>
Comment 4 WebKit Commit Bot 2020-01-15 11:57:45 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2020-01-15 11:58:17 PST
<rdar://problem/58613904>