String.replace() misinterprets $nn replacements

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
11 years ago
2 months ago

People

(Reporter: brbaker, Unassigned)

Tracking

unspecified
Future
x86
All
Dependency tree / graph
Bug Flags:
in-testsuite ?
flashplayer-qrb +
flashplayer-triage +
flashplayer-needsversioning +

Details

(Reporter)

Description

11 years ago
Description:
With String.replace() method used with "$nn" in ActionScript 
3.0, "$0"+n seems to be recognized as "$"+n+n.

Steps:
1. Write the frame action below:

// ActionScript 3.0
// frame action
var _str:String = "2008-01-25";
var n:int = 1;  // or 2, or 3
trace(_str.replace(/(\d+)-(\d+)-(\d+)/g, "$"+n));
trace(_str.replace(/(\d+)-(\d+)-(\d+)/g, "$0"+n));

2. [Test Movie] and see the result in [Output] panel.

actual results:
2008
20081

expected results:
2008
2008
			
			
Transferred Comments:

Trevor McCauley - Tue Jun 10 12:47:13 CDT 2008
tested against spidermonkey and got the expected 2008
(Reporter)

Comment 1

11 years ago
This issue is not present in tamarin-tracing.
(Reporter)

Comment 2

10 years ago
Issue is present in tamarin-central (#703)

tamarin:
"$"+n   => 2008
"$0"+n  => 20081
"$"+n+n => 20081

SpiderMonkey:
"$"+n   => 2008
"$0"+n  => 2008
"$"+n+n => 20081
Flags: in-testsuite?
Flags: flashplayer-triage+
Flags: flashplayer-qrb?

Updated

10 years ago
Blocks: 479769

Updated

10 years ago
Flags: flashplayer-qrb? → flashplayer-qrb+
Target Milestone: --- → Future

Updated

9 years ago
Flags: flashplayer-needsversioning?

Updated

9 years ago
Flags: flashplayer-needsversioning? → flashplayer-needsversioning+

Updated

9 years ago
Depends on: 535770
Tamarin is a dead project now. Mass WONTFIX.
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → WONTFIX
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
You need to log in before you can comment on or make changes to this bug.