Closed Bug 75688 Opened 23 years ago Closed 23 years ago

JS should allow reference_returning()++ etc.

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.5

People

(Reporter: brendan, Assigned: brendan)

Details

(Keywords: js1.5)

Attachments

(3 files)

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

/be
Status: NEW → ASSIGNED
Keywords: js1.5, mozilla0.9.1
Priority: -- → P3
Target Milestone: --- → mozilla0.9.1
Where did 0.9.1's time go?

/be
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Shaver, I need more guilt!

/be
Keywords: mozilla0.9.2mozilla1.0
Target Milestone: mozilla0.9.3 → mozilla0.9.5
Attached patch proposed fixSplinter Review
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
+        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.)
r=jband (though I'm not as familiar with this code as I could be)
Fix is in.

/be
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Marking Verified - 
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: