Bug 220712 - Object.assign should throw for property creation on non-extensible `target`
Summary: Object.assign should throw for property creation on non-extensible `target`
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Trivial
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-18 09:31 PST by Alexey Shvayka
Modified: 2021-02-05 06:27 PST (History)
9 users (show)

See Also:


Attachments
Patch (3.29 KB, patch)
2021-01-18 09:34 PST, Alexey Shvayka
ross.kirsling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shvayka 2021-01-18 09:31:28 PST
Object.assign should always throw if `target` is non-extensible
Comment 1 Alexey Shvayka 2021-01-18 09:34:53 PST
Created attachment 417838 [details]
Patch
Comment 2 Ross Kirsling 2021-01-18 13:50:37 PST
Comment on attachment 417838 [details]
Patch

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

r=me with comments

> Source/JavaScriptCore/ChangeLog:3
> +        Object.assign should always throw if `target` is non-extensible

Seems like "always" is a bit too strong if we don't throw when updating a property, right?

> Source/JavaScriptCore/ChangeLog:12
> +        Aligns JSC with the spec [1], V8, and SpiderMonkey.

Should we add a test262 test too?
Comment 3 Radar WebKit Bug Importer 2021-01-21 18:10:29 PST
<rdar://problem/73478307>
Comment 4 Alexey Shvayka 2021-02-05 06:26:48 PST
Committed r272411: <https://trac.webkit.org/changeset/272411>
Comment 5 Alexey Shvayka 2021-02-05 06:27:32 PST
(In reply to Ross Kirsling from comment #2)

Thank you for review, Ross!

> Seems like "always" is a bit too strong if we don't throw when updating a
> property, right?

Absolutely, I've renamed the bug.

> Should we add a test262 test too?

Extensive tests are coming in https://github.com/tc39/test262/pull/2945.