Closed Bug 267216 Opened 20 years ago Closed 20 years ago

Unary increment doesn't pass 'assigning' flag under JSCLASS_NEW_RESOLVE

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha5

People

(Reporter: mike+mozilla, Assigned: brendan)

Details

(Keywords: js1.5)

Attachments

(1 file)

js engine from the tip:

js> it.noisy=true
true
js> it.foo = 1
resolving its property foo, flags {qualified,assigning,}
adding its property foo, initial value 1
setting its property foo, new value 1
1
js> it.bar++
resolving its property bar, flags {qualified,,}
getting its property bar, current value undefined
resolving its property bar, flags {qualified,,}
adding its property bar, initial value NaN
setting its property bar, new value NaN
NaN

... I expected to see 'assigning' in the resolve printf for 'it.bar++'.  I used
this op to close named scopes to property creation (outside of 'var') for
Tellme... but unary ++ creates a hole!
From an email from Brendan:

> It's a bug -- can you file it at bugzilla.mozilla.org, Browser / 
> JavaScript Engine, cc'ing me and shaver?  Say something about "should  
> set and clear JSFRAME_ASSIGNING around assigning parts of ++ and -- 
> bytecode cases in the interpreter."  Thanks,

cc'ing shaver.  (Hi, Mike!)
Patch now.

/be
Status: NEW → ASSIGNED
Keywords: js1.5
OS: Windows XP → All
Priority: -- → P2
Hardware: PC → All
Target Milestone: --- → mozilla1.8alpha5
Attached patch fixSplinter Review
With this patch:

js> it.noisy=true
true
js> it.foo=1
resolving its property foo, flags {qualified,assigning,}
adding its property foo, initial value 1
setting its property foo, new value 1
1
js> it.bar++
resolving its property bar, flags {qualified,,}
getting its property bar, current value undefined
resolving its property bar, flags {qualified,assigning,}
adding its property bar, initial value NaN
setting its property bar, new value NaN
NaN
js>
finalizing it

/be
Comment on attachment 164456 [details] [diff] [review]
fix

Simple, perhaps branch-worthy -- thoughts?

/be
Attachment #164456 - Flags: review?(shaver)
Attachment #164456 - Flags: review?(shaver)
Fixed on trunk.  If anyone wants this on aviary and 1.7.x branches, speak fast.

/be
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
note to self: i'm not interested in this :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: