diff options
Diffstat (limited to 'js/src/tests/ecma_6/String/split.js')
-rw-r--r-- | js/src/tests/ecma_6/String/split.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/tests/ecma_6/String/split.js b/js/src/tests/ecma_6/String/split.js new file mode 100644 index 000000000..1cce47f28 --- /dev/null +++ b/js/src/tests/ecma_6/String/split.js @@ -0,0 +1,19 @@ +var BUGNUMBER = 887016; +var summary = "Call RegExp.prototype[@@split] from String.prototype.split."; + +print(BUGNUMBER + ": " + summary); + +var called = 0; +var myRegExp = { + [Symbol.split](S, limit) { + assertEq(S, "abcAbcABC"); + assertEq(limit, 10); + called++; + return ["X", "Y", "Z"]; + } +}; +assertEq("abcAbcABC".split(myRegExp, 10).join(","), "X,Y,Z"); +assertEq(called, 1); + +if (typeof reportCompare === "function") + reportCompare(true, true); |