Object.toSource fails for negative number properties

VERIFIED FIXED

Status

()

Core
JavaScript Engine
VERIFIED FIXED
14 years ago
12 years ago

People

(Reporter: timeless, Unassigned)

Tracking

({fixed-aviary1.0, fixed1.7.5})

Trunk
x86
Windows XP
fixed-aviary1.0, fixed1.7.5
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

14 years ago
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

Comment 1

14 years ago
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
Created attachment 155250 [details] [diff] [review]
fix

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
Last Resolved: 14 years ago
Resolution: --- → FIXED
(Reporter)

Updated

14 years ago
Attachment #155250 - Flags: approval1.7.3?

Comment 4

14 years ago
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+
(Reporter)

Comment 5

14 years ago
Comment on attachment 155250 [details] [diff] [review]
fix

mozilla/js/src/jsobj.c	3.155.2.3
(Reporter)

Updated

14 years ago
Keywords: fixed1.7.3
Fixed on aviary branch too.

/be
Keywords: fixed-aviary1.0
Created attachment 174926 [details]
js1_5/Regress/regress-254375.js

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.