Last Comment Bug 668936 - Arguments to String.prototype.replace not stringified in correct order
: Arguments to String.prototype.replace not stringified in correct order
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla8
Assigned To: Paul Biggar
:
:
Mentors:
data:text/html,<script>try { "".repla...
Depends on:
Blocks: test262
  Show dependency treegraph
 
Reported: 2011-07-01 18:54 PDT by Jeff Walden [:Waldo] (remove +bmo to email)
Modified: 2011-08-06 09:53 PDT (History)
4 users (show)
Ms2ger: in‑testsuite?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
move ToString(search) above Tostring(replace) (1.74 KB, patch)
2011-08-04 11:48 PDT, Paul Biggar
jwalden+bmo: review+
Details | Diff | Splinter Review

Description Jeff Walden [:Waldo] (remove +bmo to email) 2011-07-01 18:54:10 PDT
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
Comment 1 Paul Biggar 2011-08-04 11:48:52 PDT
Created attachment 550773 [details] [diff] [review]
move ToString(search) above Tostring(replace)

This just moves the ToString call on search above the ToString call on replace. Fixes both test cases, no new failures.
Comment 2 Jeff Walden [:Waldo] (remove +bmo to email) 2011-08-05 17:18:17 PDT
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.
Comment 3 Marco Bonardo [::mak] 2011-08-06 03:02:40 PDT
http://hg.mozilla.org/mozilla-central/rev/1e7cabf5103d
Comment 4 :Ms2ger (⌚ UTC+1/+2) 2011-08-06 06:36:53 PDT
Is the idea to import all of test262 somehow, are should someone add the test in $URL?
Comment 5 Paul Biggar 2011-08-06 09:53:40 PDT
(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.

Note You need to log in before you can comment on or make changes to this bug.