Closed Bug 254375 Opened 20 years ago Closed 20 years ago

Object.toSource fails for negative number properties

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: timeless, Unassigned)

Details

(Keywords: fixed-aviary1.0, fixed1.7.5)

Attachments

(2 files)

js> eval(uneval({'-1':true}))
typein:187: SyntaxError: invalid property id:
typein:187: ({-1:true})
typein:187: ..^
js> build()
built on Aug  2 2004 at 20:00:51
Yes, that's not a valid literal.  Why not quote integers all the time?  It looks
like doubles are already set up that way.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch fixSplinter Review
Always quoting bloats the runtime with atomized strings, instead of int
immediate operands in the bytecode stream that save space.  This patch quotes
only negative integer property ids.

/be
Fixed, fiat review.  Timeless, please nominate for branches if you care.

/be
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Attachment #155250 - Flags: approval1.7.3?
Comment on attachment 155250 [details] [diff] [review]
fix

a=mkaply for 1.7.3 and aviary if you want it.
Attachment #155250 - Flags: approval1.7.3?
Attachment #155250 - Flags: approval1.7.3+
Attachment #155250 - Flags: approval-aviary+
Comment on attachment 155250 [details] [diff] [review]
fix

mozilla/js/src/jsobj.c	3.155.2.3
Keywords: fixed1.7.3
Fixed on aviary branch too.

/be
Keywords: fixed-aviary1.0
Again, thanks to timeless.
js1_5/Regress/regress-254375.js checked in.
Flags: testcase+
verified fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: