Closed Bug 446382 Opened 17 years ago Closed 16 years ago

String.prototype.split broken

Categories

(Tamarin Graveyard :: Tracing Virtual Machine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: brbaker, Unassigned)

References

Details

(Keywords: flashplayer)

Attachments

(2 files, 1 obsolete file)

An issue with skipping the delimiter has been fixed in tamarin-central and needs to be merged into tamarin-tracing https://bugzilla.mozilla.org/show_bug.cgi?id=407156 trace("raaan".split("aa")); traces: ["r","","n"] expected: ["r","an"]
Flags: in-testsuite?
Flags: flashplayer-triage+
Attached patch proposed patch (obsolete) — Splinter Review
This patch is logically very similar to the patch for https://bugzilla.mozilla.org/show_bug.cgi?id=407156 The main difference is that I've used a labeled continue statement to avoid the continue_loop1 flag. If that's a stylistic sin, let me know. I think it makes things cleaner. At first I was tempted to get rid of the single-character delimiter special case, but the following test revealed the benefit of that optimization: var i, n = 2000, arr = []; for (i = 0; i < n; i++) arr.push('foo'); var str = arr.join(','); for (i = 0; i < n; i++) str.split(',') Without special case: 4.91s With special case: 3.88s
Accidentally submitted the patch without the single-character optimization. I guess now you can see both versions, for what that's worth :)
Attachment #330660 - Attachment is obsolete: true
Attachment #330661 - Flags: review?(lhansen)
Attachment #330661 - Flags: review?(brbaker)
Comment on attachment 330661 [details] [diff] [review] proposed patch, with single-character delimiter optimization I will only comment on the fact that I tried the patch in the sandbox (build #568) and it passed all of the tests including the testcase in this bug. I will leave it up to Lars to actually review the code changes.
Attachment #330661 - Flags: review?(brbaker) → review+
Attachment #330661 - Flags: review?(lhansen) → review+
Attachment #330554 - Flags: review?(dschaffe)
Attachment #330554 - Flags: review?(dschaffe) → review+
QE: does this work correctly in Tamarin Central? Please confirm that a test case covers this in the test suite.
Flags: flashplayer-triage+ → flashplayer-triage?
This is working in tamarin-central/redux and the testcase (patch #1) is in the source tree @ http://hg.mozilla.org/tamarin-redux/file/tip/test/acceptance/ecma3/String/split_407156.as
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: