diff options
Diffstat (limited to 'js/src/jit-test/tests/basic/arraybuffer-slice-warn.js')
-rw-r--r-- | js/src/jit-test/tests/basic/arraybuffer-slice-warn.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/arraybuffer-slice-warn.js b/js/src/jit-test/tests/basic/arraybuffer-slice-warn.js new file mode 100644 index 000000000..291063e4a --- /dev/null +++ b/js/src/jit-test/tests/basic/arraybuffer-slice-warn.js @@ -0,0 +1,13 @@ +// ArrayBuffer.slice should be warned once and only once. + +enableLastWarning(); + +ArrayBuffer.slice(new ArrayBuffer(10), 1); +var warning = getLastWarning(); +assertEq(warning !== null, true, "warning should be generated"); +assertEq(warning.name, "Warning"); + +clearLastWarning(); +ArrayBuffer.slice(new ArrayBuffer(10), 1); +warning = getLastWarning(); +assertEq(warning, null, "warning should not generated for 2nd ocurrence"); |