Closed
Bug 114583
Opened 23 years ago
Closed 22 years ago
script compile/decompile bug
Categories
(Rhino Graveyard :: Compiler, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
1.5R4
People
(Reporter: bugzilla, Assigned: norrisboyd)
References
Details
Attachments
(1 file)
761 bytes,
text/plain
|
Details |
the following code : > Context cx = Context.enter(); > Scriptable scope = cx.initStandardObjects( null ); > > cx.setGeneratingDebug( true ); > cx.setGeneratingSource( true ); > > String src = " var x = 5; var y = 10; "; > StringReader sr = new StringReader( src ); > Script script = null; > > try { > script = cx.compileReader( scope, sr, "Test", 1, null ); > } catch ( Exception e ) { > } > System.out.println( cx.decompileScript( script, scope, 4 ) ); > System.exit( 1 ); gives : function () { [native code] } whereas the following : > Context cx = Context.enter(); > Scriptable scope = cx.initStandardObjects( null ); > > cx.setGeneratingDebug( true ); > cx.setGeneratingSource( true ); > > String src = " var x = 5; var y = 10; "; > StringReader sr = new StringReader( src ); > Script script = null; > > try { > script = cx.compileReader( scope, sr, "Test", 1, null ); > script.exec(cx, scope); > } catch ( Exception e ) { > } > System.out.println( cx.decompileScript( script, scope, 4 ) ); > System.exit( 1 ); behaves as expected (by printing the decompiled script). ( there is a added exec() call to "script" )
Comment 1•22 years ago
|
||
This is fixed as a byproduct of recent changes in decompilation support, for test see the following java source.
Comment 2•22 years ago
|
||
Comment 3•22 years ago
|
||
Marking FIXED. I successfully compiled and ran Igor's test "Y.java". I got this output: [//c/WinNT/profiles/pschwartau/Desktop] $ java -classpath "D:\JS_trunk\mozilla\js\rhino\build\rhino1_5R4pre\js.jar;." Y function () { [native code, arity=0] }
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 6•22 years ago
|
||
Just to double-check with Igor: was my output above correct? function () { [native code, arity=0] }
Comment 7•22 years ago
|
||
OOPS!!! I had my directories mixed up, and was using an old Rhino tree. The bug is indeed fixed. Now that I've updated the correct tree, we can compare rhino1_5R3pre vs. rhino1_5R4pre: [//c/WinNT/profiles/pschwartau/Desktop] $ java -classpath "D:\JS_TRUNK\mozilla\js\rhino\build\rhino1_5R3pre\js.jar; ." Y function () { [native code] } [//c/WinNT/profiles/pschwartau/Desktop] $ java -classpath "D:\JS_TRUNK\mozilla\js\rhino\build\rhino1_5R4pre\js.jar; ." Y var x = 5; var y = 10; And this shows the effect of the bug fix -
You need to log in
before you can comment on or make changes to this bug.
Description
•