According to the ES5.1, /^[\s]/ means a space character from the beginning of a string, and the String.prototype.split method divides a String into an ordered set of substrings. The division of the testcase is done by searching for the pattern /^[\s]/. And the output is different from other engines like V8, SpiderMonkey and javascriptCore. It maybe an issue of jerryscript.
I'm unable to reproduce the issue on the current master (even v2.2.0 is fine). It seems that the 2a29b72a83df01e356cb3eb850e2b52c7f75350c commit fixed this.
According to the ES5.1,
/^[\s]/
means a space character from the beginning of a string, and theString.prototype.split
method divides a String into an ordered set of substrings. The division of the testcase is done by searching for the pattern/^[\s]/
. And the output is different from other engines like V8, SpiderMonkey and javascriptCore. It maybe an issue of jerryscript.JerryScript revision
996bf76
Test case
Output
Expected output