JS should allow reference_returning()++ etc.

VERIFIED FIXED in mozilla0.9.5

Status

()

Core
JavaScript Engine
P3
normal
VERIFIED FIXED
18 years ago
17 years ago

People

(Reporter: brendan, Assigned: brendan)

Tracking

({js1.5})

Trunk
mozilla0.9.5
js1.5
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

18 years ago
Spun off from bug 75560.  Shaver guilts me every time!

/be
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Keywords: js1.5, mozilla0.9.1
Priority: -- → P3
Target Milestone: --- → mozilla0.9.1
(Assignee)

Comment 1

17 years ago
Where did 0.9.1's time go?

/be
Keywords: mozilla0.9.1 → mozilla0.9.2
Target Milestone: mozilla0.9.1 → mozilla0.9.2

Updated

17 years ago
Target Milestone: mozilla0.9.2 → mozilla0.9.3
(Assignee)

Comment 2

17 years ago
Shaver, I need more guilt!

/be
Keywords: mozilla0.9.2 → mozilla1.0
Target Milestone: mozilla0.9.3 → mozilla0.9.5
(Assignee)

Comment 3

17 years ago
Created attachment 46564 [details] [diff] [review]
proposed fix
(Assignee)

Comment 4

17 years ago
Ready for r= and sr=.  The kludge in jsexn.c cures two problems: first, the old
code was suppressing js_GetClassPrototype failure, which is just bad; second, if
the global object has a lazy standard class resolve, as js.c and the DOM window
class do, then this "internal" js_GetClassPrototype might cause a new-resolve
call with JSRESOLVE_ASSIGNING wrongly imputed from the current JSOP_SETCALL or
similar bytecode (e.g., for it.foo('hi')++ where it.foo is undefined).

Obviously, the engine should have a better way to divine new-resolve flags, but
the hack and XXXbe comment will do for now.

The actually compiler changes for reference_returning()++, e.g. it.item('funny')
= 42; it.item('funny')++, were pretty tiny.  I'm happy.

/be
(Assignee)

Comment 5

17 years ago
Created attachment 46566 [details] [diff] [review]
better comment for the XXXbe kludge in jsexn.c
+        jsbytecode *pc;
+        JSBool ok;
+
+        fp = cx->fp;
+        pc = NULL;

I think we prefer initialization to declaration-then-inevitable-assignment,
generally.  Change to

+        jsbytecode *pc = NULL;

and sr=shaver.  (I ass-u-me you've run the test suite.)
(Assignee)

Comment 7

17 years ago
Created attachment 46626 [details] [diff] [review]
shaver's feedback incorporated, still need r=

Comment 8

17 years ago
r=jband (though I'm not as familiar with this code as I could be)
(Assignee)

Comment 9

17 years ago
Fix is in.

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 10

17 years ago
Marking Verified - 
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.