Closed Bug 396969 Opened 17 years ago Closed 17 years ago

bitwise and shift ops evaluate operands in reverse order, contrary to ECMA-262

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9beta1

People

(Reporter: brendan, Assigned: brendan)

Details

Attachments

(1 file)

js> o = {valueOf:function (){print('o.valueOf');return this.value}, value:42}
[object Object]
js> p = {valueOf:function (){print('p.valueOf');return this.value}, value:2}  
[object Object]
js> print(o >> p)
p.valueOf
o.valueOf
10

etc. for <<, >>>, &, ^, and |. Patch next.

/be
Status: NEW → ASSIGNED
Priority: -- → P3
Attached patch fixSplinter Review
Attachment #281726 - Flags: review?(igor)
Comment on attachment 281726 [details] [diff] [review]
fix

FETCH_INT looks so innocent, but since it can run arbitrary JS, the ordering is important.
Attachment #281726 - Flags: review?(igor) → review+
Attachment #281726 - Flags: approval1.9+
Fixed on trunk:

js/src/jsinterp.c 3.376

/be
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
/cvsroot/mozilla/js/tests/ecma_3/Expressions/11.10-01.js,v  <--  11.10-01.js
initial revision: 1.1

/cvsroot/mozilla/js/tests/ecma_3/Expressions/11.10-02.js,v  <--  11.10-02.js
initial revision: 1.1

/cvsroot/mozilla/js/tests/ecma_3/Expressions/11.7.1-01.js,v  <--  11.7.1-01.js
initial revision: 1.1

/cvsroot/mozilla/js/tests/ecma_3/Expressions/11.7.2-01.js,v  <--  11.7.2-01.js
initial revision: 1.1

/cvsroot/mozilla/js/tests/ecma_3/Expressions/11.7.3-01.js,v  <--  11.7.3-01.js
initial revision: 1.1

Flags: in-testsuite+
fix ecma section
/cvsroot/mozilla/js/tests/ecma_3/Expressions/11.7.3-01.js,v  <--  11.7.3-01.js
new revision: 1.2; previous revision: 1.1
verified fixed 1.9.0 linux|mac|win
Status: RESOLVED → VERIFIED
I somehow managed to miss checking this test in, but have been running it locally none the less. 

Checking in 11.10-03.js;
/cvsroot/mozilla/js/tests/ecma_3/Expressions/11.10-03.js,v  <--  11.10-03.js
initial revision: 1.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: