Closed
Bug 415950
Opened 18 years ago
Closed 17 years ago
the example e4x_example.js fails midway
Categories
(Rhino Graveyard :: E4X, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 380173
People
(Reporter: rhildred, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Build Identifier: rhino1_6R7
starting at line 79:
order.customer.address.state = "CA";
order.item[0] = "";
order.item[0].description = "Small Rodents";
order.item[0].quantity = 10;
order.item[0].price = 6.95;
should be:
order.customer.address.state = "CA";
order.item += <item/>;
order.item[0] = "";
order.item[0].description = "Small Rodents";
order.item[0].quantity = 10;
order.item[0].price = 6.95;
Reproducible: Always
Steps to Reproduce:
1) cd examples/E4X
2) java -jar ../../js.jar e4x_example.js
Actual Results:
----------------------------------------
Exception in thread "main" java.lang.NullPointerException
at org.mozilla.javascript.xmlimpl.XMLList.put(XMLList.java:227)
at org.mozilla.javascript.xmlimpl.XMLObjectImpl.ecmaPut(XMLObjectImpl.ja
va:288)
at org.mozilla.javascript.ScriptRuntime.setObjectElem(ScriptRuntime.java
:1442)
at org.mozilla.javascript.ScriptRuntime.setObjectElem(ScriptRuntime.java
:1434)
at org.mozilla.javascript.gen.c1._c0(Unknown Source)
at org.mozilla.javascript.gen.c1.call(Unknown Source)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:3
93)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:283
4)
at org.mozilla.javascript.gen.c1.call(Unknown Source)
at org.mozilla.javascript.gen.c1.exec(Unknown Source)
at org.mozilla.javascript.tools.shell.Main.evaluateScript(Main.java:524)
at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:4
46)
at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:412)
at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:403)
at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:179)
at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:100)
at org.mozilla.javascript.Context.call(Context.java:577)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:503)
at org.mozilla.javascript.tools.shell.Main.exec(Main.java:162)
at org.mozilla.javascript.tools.shell.Main.main(Main.java:140)
Expected Results:
----------------------------------------
The order custructed using expandos and super-expandos is:
<order>
<customer>
<name>Fred Jones</name>
<address>
<street>123 Long Lang</street>
<city>Underwood</city>
<state>CA</state>
</address>
</customer>
<item>
<description>Small Rodents</description>
<quantity>10</quantity>
<price>6.95</price>
</item>
</order>
----------------------------------------
The order after appending a new item is:
<order>
<customer>
<name>Fred Jones</name>
<address>
<street>123 Long Lang</street>
<city>Underwood</city>
<state>CA</state>
</address>
</customer>
<item>
<description>Small Rodents</description>
<quantity>10</quantity>
<price>6.95</price>
</item>
<item>
<description>Catapult</description>
<price>139.95</price>
</item>
</order>
----------------------------------------
The dynamically computed element value is:
<name id="5">Fred</name>
----------------------------------------
The encoding style of the soap message is specified by:
http://schemas.xmlsoap.org/soap/encoding/
The body of the soap message is:
<soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<m:GetLastTradePrice xmlns:m="http://mycompany.com/stocks">
<symbol>MYCO</symbol>
</m:GetLastTradePrice>
</soap:Body>
----------------------------------------
XML object constructed using the default xml namespace:
<x xmlns="http://default.namespace.com">
<a>one</a>
<b>two</b>
<c xmlns="http://some.other.namespace.com">three</c>
</x>
----------------------------------------
The order id is:123456
The children of the order are:
<customer>
<firstname>John</firstname>
<lastname>Doe</lastname>
</customer>
<item id="3456">
<description>Big Screen Television</description>
<price>1299.99</price>
<quantity>1</quantity>
</item>
<item id="56789">
<description>DVD Player</description>
<price>399.99</price>
<quantity>1</quantity>
</item>
The order descriptions are:
<description>Big Screen Television</description>
<description>DVD Player</description>
The second item is:
<item id="56789">
<description>DVD Player</description>
<price>399.99</price>
<quantity>1</quantity>
</item>
The children of the items are:
<description>Big Screen Television</description>
<price>1299.99</price>
<quantity>1</quantity>
<description>DVD Player</description>
<price>399.99</price>
<quantity>1</quantity>
The second child of the order is:
<item id="3456">
<description>Big Screen Television</description>
<price>1299.99</price>
<quantity>1</quantity>
</item>
The total price of the order is: 1699.98
----------------------------------------
All the employee names are:
<name>Joe</name>
<name>Sue</name>
The employee named Joe is:
<employee id="1">
<name>Joe</name>
<age>20</age>
</employee>
Employees with ids 1 & 2:
<employee id="1">
<name>Joe</name>
<age>20</age>
</employee>
<employee id="2">
<name>Sue</name>
<age>30</age>
</employee>
Name of the the employee with ID=1: Joe
----------------------------------------
rhino and E4X are the coolest things that I have seen!
Updated•17 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•