Closed Bug 380173 Opened 19 years ago Closed 16 years ago

Rhino E4X: Problem with automatic property expansion

Categories

(Rhino Graveyard :: E4X, defect)

head
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 524931

People

(Reporter: inonit, Assigned: inonit)

References

Details

Attachments

(2 files, 1 obsolete file)

var html = <html/>; html.head.title = "My Page Title"; html.body.@bgcolor = "#e4e4e4"; html.body.form.@name = "myform"; html.body.form.@action = "someurl.jss"; html.body.form.@method = "post"; html.body.form.@onclick = "return somejs();"; html.body.form.input[0] = ""; html.body.form.input[0].@name = "test"; ... yields: java.lang.NullPointerException at org.mozilla.javascript.xmlimpl.XMLList.put(XMLList.java:227) at org.mozilla.javascript.xmlimpl.XMLObjectImpl.ecmaPut(XMLObjectImpl.java:288) at org.mozilla.javascript.ScriptRuntime.setObjectIndex(ScriptRuntime.java:1498) at org.mozilla.javascript.ScriptRuntime.setObjectIndex(ScriptRuntime.java:1486) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2951) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2326) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2818) at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:173) at inonit.script.rhino.Engine$Program$SourceUnit.execute(Engine.java:693) at inonit.script.rhino.Engine$Program.execute(Engine.java:574) at inonit.script.rhino.Engine$Program.interpret(Engine.java:602) at inonit.script.rhino.Engine$ProgramAction.run(Engine.java:729) at org.mozilla.javascript.Context.call(Context.java:559) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:497) at inonit.script.rhino.Engine.execute(Engine.java:366) at inonit.script.jsh.ScriptHost.execute(ScriptHost.java:138) at inonit.script.jsh.Main.run(Main.java:204) at inonit.script.jsh.Main.main(Main.java:236) Reported via E-mail. I will investigate.
This seems to fix the problem. I haven't really tried to understand what goes on farther down that method, and I suspect that it might be ok to return immediately after creating the expanded element. Probably David should have another look. Bug 394215 and bug 415950 are duplicates of this.
Realistically I'm unavailable until after Election Day in America (Nov. 4) as I have moved to Florida and taken a sabbatical from IT to work in a campaign capacity. Use this information in whatever way you see fit. :)
Attached patch Revised patchSplinter Review
Use ScriptRuntime.toString(value) instead of value.toString()
Attachment #344071 - Attachment is obsolete: true
Attached file Test script
Test script for E4X property expansion. Now produces same result as spidermonkey except for the display of empty elements.
Fixed - see bug #524931
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Marking as duplicate of bug #524931
Resolution: FIXED → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: