Bug 1498458 - Add a test for OOM on failure to allocate ArrayBuffer contents that won't fit in a typed array's inline storage. r=nbp
authorJeff Walden <jwalden@mit.edu>
Mon, 15 Oct 2018 15:07:29 -0700
changeset 489668 5b5648ea1b5b33d8406a0a78661dd7c86f4cd7b0
parent 489667 e08e5aa479a939385404466ea06227eb754f254b
child 489669 2ec2641a20ae953f6f6119777acb44c580310943
child 489711 3c8790a73b7f31b253704a07e1bf7d0a65696b04
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersnbp
bugs1498458
milestone64.0a1
Bug 1498458 - Add a test for OOM on failure to allocate ArrayBuffer contents that won't fit in a typed array's inline storage. r=nbp
js/src/jit-test/tests/typedarray/oom-allocating-arraybuffer-contents.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/typedarray/oom-allocating-arraybuffer-contents.js
@@ -0,0 +1,15 @@
+// |jit-test| skip-if: !('oomTest' in this)
+
+// Resolve ArrayBuffer before OOM-testing, so OOM-testing runs less code and is
+// less fragile.
+var AB = ArrayBuffer;
+
+function f()
+{
+  return new AB(256);
+}
+
+// Create |f|'s script before OOM-testing for the same reason.
+f();
+
+oomTest(f);