diff options
Diffstat (limited to 'js/src/tests/non262/String/normalize-parameter.js')
-rw-r--r-- | js/src/tests/non262/String/normalize-parameter.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/tests/non262/String/normalize-parameter.js b/js/src/tests/non262/String/normalize-parameter.js new file mode 100644 index 0000000000..4831c27176 --- /dev/null +++ b/js/src/tests/non262/String/normalize-parameter.js @@ -0,0 +1,19 @@ +var BUGNUMBER = 918987; +var summary = 'String.prototype.normalize - passing wrong parameter'; + +print(BUGNUMBER + ": " + summary); + +function test() { + assertThrowsInstanceOf(() => "abc".normalize("NFE"), RangeError, + "String.prototype.normalize should raise RangeError on invalid form"); + + assertEq("".normalize(), ""); +} + +if ("normalize" in String.prototype) { + // String.prototype.normalize is not enabled in all builds. + test(); +} + +if (typeof reportCompare === "function") + reportCompare(true, true); |