Closed
Bug 478801
Opened 16 years ago
Closed 6 years ago
There should be a String.prototype.every, etc (SpiderMonkey enhancement)
Categories
(Tamarin Graveyard :: Virtual Machine, enhancement)
Tracking
(Not tracked)
RESOLVED
WONTFIX
Future
People
(Reporter: jodyer, Unassigned)
References
Details
In mozilla javascript Array.prototype.every.call works on strings converting the string to an array of characters. In AS3 the call returns true without calling the function. Changing the code from a string to an array of characters works correctly.
This code reproduces the problem:
every1.as:
function isLetter(character) {
print(character);
return (character >= "a" && character <= "z");
}
// var str=['a','b','c','1','2','3']; works
var str="abc123"; // in avmplus returns true
print(Array.prototype.every.call(str,isLetter));
Reproduction:
1. running with mozilla's js.exe works:
js every1.as returns a,b,c,1,false as expected
2. asc every1.as
3. avmplus every1.abc
returns: true
Actual Results:
avmplus every1.abc:
true
Expected Results:
avmplus every1.abc:
a
b
c
1
false
Workaround: convert the string to an array of characters
Transferred Comments:
BugDB Migration - Mon Jun 04 12:32:53 CDT 2007
[dschaffer 9/5/06] Entered Bug.
[cnuuja 9/5/06] This is because Spidermonkey implements an optional feature (i.e. not in the ECMA spec) where by strings can be accessed ala arrays:
var s = "abcd"
print(s[1]) // "b" for spidermonkey, error for us.
This is an enhancement request for fp10 to support index properties for Strings ala Spidermonkey. The fact that they use this feature in the examples in the Documentation should perhaps raise this feature's priority for us.
JIRA Migration Admin - Mon Jun 04 12:32:53 CDT 2007
Milestone ID = 1378
Milestone = FP 10 - Code Complete
Build ID = 21378
Build = AVMPLUS_1_0_0_d659
Fix Build ID = null
Fix Build = null
JIRA Migration Admin - Mon Jun 04 12:32:53 CDT 2007
Move from BugDB issue number 183657
Trevor Baker - Tue Jan 27 14:54:40 CST 2009
back to internal review for reprioritization
This bug transferred from: http://bugs.adobe.com/jira/browse/ASC-2276
Updated•16 years ago
|
Blocks: AS3_Builtins
Updated•15 years ago
|
Priority: -- → P2
Target Milestone: --- → flash10.1
Updated•15 years ago
|
Flags: in-testsuite?
Updated•15 years ago
|
Severity: normal → enhancement
Priority: P2 → --
Summary: Array.prototype.every.call is not calling the specified function correctly → There should be a String.prototype.every, etc (SpiderMonkey enhancement)
Target Milestone: flash10.1 → Future
Flags: in-testsuite?
Flags: flashplayer-qrb+
Flags: flashplayer-injection-
Flags: flashplayer-bug-
Updated•6 years ago
|
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•