Closed Bug 289876 Opened 19 years ago Closed 13 years ago

support access Array element via () instead of [] (IEism)

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: iamawalrus, Assigned: iamawalrus)

References

Details

Attachments

(1 file)

some pages use a vbscript-like function call to access the array element instead
of using []. For example,

    var a = document.getElementsByTagName("*");
    var b = a(1);  // the right way should be a[1]

In mozilla/firefox, a "... is not a function" javascript error is generated for
this issue.
Attached patch patchSplinter Review
Assignee: general → robin.lu
Status: NEW → ASSIGNED
Robin Lu, won't it violate current W3C DOM Specifications?
I think DOM specification should be modified/enhanced before implement.
(or Ecma Standard of ECMAScript if enhancement for any array variables/objects
of JavaScript)
CC:ing to Boris.
This has come up before.  I'd recommend reading existing bugs where this was
proposed....
Whiteboard: DUPEME
(In reply to comment #4)
> existing bugs where this was proposed....
Bug 24644?
And Bug 290592 is another enhancement?
> Bug 24644  Implement E4X in SpiderMonkey
> Bug 290592 Array extras: forEach, indexOf, filter, map, some, every 
Correction of link to bug number. Sorry for spam.
> Bug 246441 : Implement E4X in SpiderMonkey
No, the bugs were not related to E4X.
The w3c shut down the DOM working group.  ECMA is never going to standardize
this odious () for [] VB-ism.  So if we implement this, it will be because
enough bad content exists that people want to work in Firefox and other Mozilla
Gecko-based products, *and* that content's authors don't care or are not even
around to fix it.  I doubt that is the case.

/be
QA Contact: ian → general
Wontfix?
(In reply to Brendan Eich [:brendan] from comment #8)
> The w3c shut down the DOM working group.

Browser competition led to the DOM core group being revived. But "caller" is deprecated. Cc'ing Cameron to confirm this resolution.

> ECMA is never going to standardize this odious () for [] VB-ism.

That's still true.

> So if we implement this, it will be because
> enough bad content exists that people want to work in Firefox and other
> Mozilla Gecko-based products, *and* that content's authors don't care
> or are not even around to fix it.  I doubt that is the case.

No evidence of this, so WONTFIX.

/be
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Yes, callers are deprecated.  The keyword was changed to "legacycaller" to emphasise this, and the spec says explicitly

  Specifications SHOULD NOT use legacy callers unless required to specify the
  behavior of legacy APIs.
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: