String.prototype.split with undefined separator and limit 0

Rick Waldron waldron.rick at gmail.com
Fri Jul 27 10:00:33 PDT 2012


On Fri, Jul 27, 2012 at 9:01 AM, Steven Levithan <steves_list at hotmail.com>wrote:

>   snip
>


>
>  This paragraph remains verbatim in the latest ES 6 draft (Rev 9).
>
>  This is ambiguous about whether the limit argument applies when
> separator is undefined. The algorithm steps that follow, by my reading,
> specify that limit should not affect the result if separator is undefined.
> In other words, 'undefined'.split(undefined, 0) should return
> ['undefined'], not []. Was this special case for the limit argument
> intentional? Every browser I’ve tested, with the exception of Chrome, gets
> something wrong about the handling of undefined as the separator. Test
> results follow:
>
>  snip
>

Would you mind filing a spec bug for this?
https://bugs.ecmascript.org/enter_bug.cgi

Thanks!

Rick



>
> -- Steven Levithan
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120727/c3a5898a/attachment-0001.html>


More information about the es-discuss mailing list