Closed
Bug 14555
Opened 25 years ago
Closed 25 years ago
new Array tag requires new syntax in recent builds
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
People
(Reporter: gayatrib, Assigned: shaver)
Details
Previously the syntax: var myArray = new Array("one"); used to work ok. In today's builds, this stopped working. A javascript error message saying myArray has no properties is given. Looks like the latest syntax that works is: var myArray = ["one"]; I suppose the previous syntax too should be allowed ot be valid usage. Here is a test case: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/xul.css" type="text/css"?> <!DOCTYPE window [ <!ENTITY window.title.label "Test Array"> <!ENTITY test.label "Test Me"> ]> <window title="&window.title.label;" style="width: 100%; height: 100%" align="vertical" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="500" height="400"> <html:script> var myArray = new Array("one"); var content; var wizardHash = new Array; var firstTime = true; function testArray() { dump("the array element is: "+myArray[0]+"\n"); } </html:script> <box align="horizontal"> <titledbutton id="test" value="&test.label;" onclick="testArray()" align="left" style="margin-top: 1em;"/> </box> </window>
Comment 1•25 years ago
|
||
Looks like shaver's change to jsarray.c rev 3.13 was intending to do just that. Did we want to tell the users to fix their broken selves? or what?
Comment 2•25 years ago
|
||
Do we actually have some clue that this won't break a high percentage of all existing JS out in the world? Is it the case that the old form is now non-standard, or is it just unspecified? It seems like it would be a good thing to keep it working unless the affected scripts are few or the standard prohibits it.
Updated•25 years ago
|
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Comment 3•25 years ago
|
||
This bug is a dup of one on mccabe's list that shaver fixed; mccabe's bug was left open for his review when he comes back from ECMA. /be *** This bug has been marked as a duplicate of 14545 ***
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
Comment 4•25 years ago
|
||
[bugday] verifying as duplicate. read both bugs and their both about new Array(<not-Number>) as shaver pointed out.
You need to log in
before you can comment on or make changes to this bug.
Description
•