has a breaking change from ES5

Yusuke SUZUKI utatane.tea at
Sat Apr 18 19:46:14 UTC 2015

Hi forks,

Seeing ES6, there's a breaking change from ES5.

When executing `"gnulluna".search(null)`,

In ES5, RegExp(null) => /null/ is generated, so the result becomes 1.

In ES6, we fall down to the step 3 (because null is not
And then reaching step 3.a,

  Let searcher be GetMethod(regexp, @@search).

Then TypeError is thrown by GetV's ToObject.

Is it intentional behavior?

Best Regards,
Yusuke Suzuki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list