Closed Bug 668936 Opened 13 years ago Closed 13 years ago

Arguments to String.prototype.replace not stringified in correct order

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: Waldo, Assigned: paul.biggar)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

S15.5.4.11_A1_T11 Call replace (searchValue, replaceValue) function with objects arguments of string object. Objects have overrided toString function, that throw exception fail S15.5.4.11_A1_T12 Call replace (searchValue, replaceValue) function with objects arguments of String object. fail
Assignee: general → pbiggar
This just moves the ToString call on search above the ToString call on replace. Fixes both test cases, no new failures.
Attachment #550773 - Flags: review?(jwalden+bmo)
Comment on attachment 550773 [details] [diff] [review] move ToString(search) above Tostring(replace) Review of attachment 550773 [details] [diff] [review]: ----------------------------------------------------------------- It's not clear to me that the spec algorithm actually requires this. Ideally the spec algorithm would be a stepwise algorithm like all the others, at least to some extent, and would make any requirement about this explicit. Maybe if I find myself bored someday I'll write one up. On the other hand, it's no skin off our nose to do this even if it's not strictly required, so whatever -- let's pick up the points.
Attachment #550773 - Flags: review?(jwalden+bmo) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Is the idea to import all of test262 somehow, are should someone add the test in $URL?
Flags: in-testsuite?
(In reply to Ms2ger from comment #4) > Is the idea to import all of test262 somehow, are should someone add the > test in $URL? The former. See bug 669766.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: