Closed
Bug 1075294
Opened 10 years ago
Closed 10 years ago
Object.seal() should return its argument with no conversion when the argument is a primitive value
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: 446240525, Assigned: 446240525)
References
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
Attachments
(1 file, 1 obsolete file)
5.94 KB,
patch
|
446240525
:
review+
|
Details | Diff | Splinter Review |
js> Object.seal("foo")
TypeError: "foo" is not an object
// should return "foo"
Attachment #8497926 -
Flags: review?(till)
Comment 3•10 years ago
|
||
Comment on attachment 8497926 [details] [diff] [review]
bug-1075294.patch
Review of attachment 8497926 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with tiny nits addressed. Amazing that we didn't have any tests for throwing on primitives here. :(
For patches as simple as this one, you can just start a try server run right when asking for review. (As always for things like this: Linux (64 or 32, doesn't matter) only, debug only, all tests except Talos.) Then, once the reviewer gives an r+, you can either set checkin-needed directly, or upload a new version with nits addressed, carry over the r+, and note which comment the try run can be found in. If you think that, even though the reviewer gave an r+, the needed changes warrant another try run, just do that and mention it when uploading the final patch.
Spec note: I'm not particularly convinced that `success = !!(Object.seal(false))` is particularly good behavior. But then again, it also doesn't matter much: calling seal on primitives really just isn't something one should do. Also, the spec is the spec. (In this case, because I don't think it's important enough to get into discussions about. In other cases, we do give feedback to tc39 and try to fix errors.
::: js/src/builtin/Object.cpp
@@ +1092,2 @@
>
> + // step 1
Uber-nit: Upper-case "S" and "." at EOL, please. Here and below.
Attachment #8497926 -
Flags: review?(till) → review+
Attachment #8497926 -
Attachment is obsolete: true
Attachment #8498101 -
Flags: review+
Comment 6•10 years ago
|
||
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in
before you can comment on or make changes to this bug.
Description
•