Closed Bug 55114 Opened 24 years ago Closed 24 years ago

for... in loops not behaving as expected on Java strings

Categories

(Core Graveyard :: Java: Live Connect, defect, P2)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: pschwartau, Assigned: rogerl)

Details

(Keywords: crash, Whiteboard: [rtm++])

Getting failures on these LiveConnect test cases: js/tests/lc2/Arrays/array-003.js js/tests/lc3/forin/array-001.js The problem seems to rest on how the characters of Java string objects are being enumerated -
Here's a patch, need review/approval etc... diff -u -r1.14 jsj_JavaArray.c --- jsj_JavaArray.c 2000/08/26 02:30:19 1.14 +++ jsj_JavaArray.c 2000/10/03 23:18:43 @@ -252,6 +252,7 @@ old_reporter = JS_SetErrorReporter(cx, NULL); result = access_java_array_element(cx, jEnv, obj, id, NULL, JS_FALSE); + if (result) *objp = obj; JS_SetErrorReporter(cx, old_reporter); jsj_ExitJava(jsj_env); return result;
Status: NEW → ASSIGNED
Nominating rtm -
Keywords: rtm
Setting P2 priority -
Priority: P3 → P2
This is crucial for correct functioning of LiveConnect Java array access. The fix is very low risk.
Whiteboard: [rtm+]
looking for r=,a= comments etc
Marking "need info". Please get your review and super review and renominate.
Whiteboard: [rtm+] → [rtm+ need info]
a=brendan@netscape.com. Was this a regression in the code? /be
yes, I think when the changes in the for..in stuff was going in, or maybe earlier - we had a blank period on liveconnect testing.
r=mccabe. I stepped through it and objp not being set causes us to mishandle the enumeration. Not to mention that it's obviously missing. I think fur-style would have the the then-clause on a new line :)
Fix checked in to trunk, appropriately en-furred.
Can we get an rtm++?
Whiteboard: [rtm+ need info] → [rtm+]
Crash bug, no? If so, add crash keyword. /be
It's not reported as a crash, just test failures. But that must be just lucky since I guess there's likely to be garbage in *objp otherwise.
Keywords: crash
Small... stops crash.... rtm double plus. Please land on N 6 branch asap. Thanks, Jim
Whiteboard: [rtm+] → [rtm++]
Fix checked in to branch
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified fixed using debug and optimized LiveConnect shells built on WinNT: 2000-11-01 (trunk) 2000-11-05 (MN6 branch)
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.