Closed
Bug 1041128
Opened 11 years ago
Closed 10 years ago
Duplicate property name in object literal is allowed in ES6 strict mode
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: 446240525, Assigned: gupta.rajagopal)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
Attachments
(1 file, 3 obsolete files)
46.16 KB,
patch
|
gupta.rajagopal
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2094.0 Safari/537.36
Steps to reproduce:
js> (function(){"use strict";({1:1,1:1})}())
Actual results:
SyntaxError: property name 1 appears more than once in object literal
Expected results:
This code shouldn't throw any more
This patch does not actually remove the failing test cases. I'll add a follow-up patch once Waldo's patch goes in.
Assignee: nobody → gupta.rajagopal
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #8470234 -
Flags: review?(jorendorff)
Waldo, the diff is a bit wonky in update-test262.sh (shows your changes as mine) - I will make sure that once your patch lands, mine applies on top of it.
Attachment #8472521 -
Flags: review?(jwalden+bmo)
Comment 3•10 years ago
|
||
Comment on attachment 8470234 [details] [diff] [review]
Patch to allow duplicate properties in object literals v1
Review of attachment 8470234 [details] [diff] [review]:
-----------------------------------------------------------------
This also gets rid of the "extra warnings"-mode warning about duplicate properties. I'm a little ambivalent because it means you'll be able to (for example) declare a large class, accidentally declare a method twice, and get no warning whatsoever.
But on consideration I think we should let it go.
Attachment #8470234 -
Flags: review?(jorendorff) → review+
Addressed review comments in bug 924672.
Attachment #8470234 -
Attachment is obsolete: true
Attachment #8473974 -
Flags: review+
Comment 5•10 years ago
|
||
Comment on attachment 8472521 [details] [diff] [review]
Patch to allow duplicate properties in object literals part 2 v1
Review of attachment 8472521 [details] [diff] [review]:
-----------------------------------------------------------------
Flat-out test removals makes for a nice, simple patch.
::: js/src/tests/update-test262.sh
@@ +133,5 @@
>
> +# Apply a very narrow set of post-fixes to tests that haven't yet been updated
> +# for spec changes, or where we're experimenting with semantics that disagree
> +# with those in test262. See below: this isn't every test we don't pass!
> +patch -d "${js_src_tests_dir}" -p4 < ./poison-pill-changes.diff
Remove this line, I'll merge it into these changes if you land first. (Or you can do likewise if I land first.)
Attachment #8472521 -
Flags: review?(jwalden+bmo) → review+
Merged Waldo's changes in. Unified the two parts to create a single diff.
Attachment #8472521 -
Attachment is obsolete: true
Attachment #8473974 -
Attachment is obsolete: true
Attachment #8477897 -
Flags: review+
Updated•10 years ago
|
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Keywords: checkin-needed
Comment 8•10 years ago
|
||
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Comment 10•10 years ago
|
||
Mentioned on these pages:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Duplicate_property_names
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mode#Syntax_errors
* https://developer.mozilla.org/en-US/Firefox/Releases/34#JavaScript
Any reviews to the wiki pages are very much appreciated.
Keywords: dev-doc-needed → dev-doc-complete
Comment 11•10 years ago
|
||
Updated following document, which was pointed out by bug 1170752:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
Comment 12•9 years ago
|
||
[Tracking Requested - why for this release]:
blocking-b2g: --- → 2.1S?
tracking-b2g:
--- → backlog
You need to log in
before you can comment on or make changes to this bug.
Description
•