archives

« Bugzilla Issues Index

#3780 — 21.1.3.17 String.prototype.split: Move ToString to top ?


21.1.3.17 String.prototype.split ( separator, limit )

Steps 4-5.

Move after step 1 and remove step 2?

> 1. Let O be RequireObjectCoercible(this value).
> 2. Let S be ToString(O).
> 3. ReturnIfAbrupt(S).

And update step 3.c.i to use `S` instead of `O`.


Cf.
1.1.3.11 String.prototype.match ( regexp )
21.1.3.14 String.prototype.replace (searchValue, replaceValue )
21.1.3.15 String.prototype.search ( regexp )


fixed in rev33 editor's draft

what I actually ended up doing is changed match/replace/search to use the pattern from split.

It seems better to let the delegated method do the conversion (which it needs to do anyway, just in case somebody else calls them)


fixed in rev33