diff --git a/js/src/jit-test/tests/typedarray/oom-allocating-arraybuffer-contents.js b/js/src/jit-test/tests/typedarray/oom-allocating-arraybuffer-contents.js deleted file mode 100644 index 6bb0e018c262..000000000000 --- a/js/src/jit-test/tests/typedarray/oom-allocating-arraybuffer-contents.js +++ /dev/null @@ -1,8 +0,0 @@ -// |jit-test| skip-if: !('oomTest' in this) - -oomTest(function test() { - // The original missing OOM check was after failure to allocate ArrayBuffer - // contents, in the ctor call -- the particular operations after that aren't - // important. - new Uint8ClampedArray(256).toLocaleString('hi'); -}); diff --git a/js/src/vm/ArrayBufferObject.cpp b/js/src/vm/ArrayBufferObject.cpp index 90181d544fff..b839db70279f 100644 --- a/js/src/vm/ArrayBufferObject.cpp +++ b/js/src/vm/ArrayBufferObject.cpp @@ -463,7 +463,8 @@ ArrayBufferObject::class_constructor(JSContext* cx, unsigned argc, Value* vp) static ArrayBufferObject::BufferContents AllocateArrayBufferContents(JSContext* cx, uint32_t nbytes) { - uint8_t* p = cx->pod_callocCanGC(nbytes, js::ArrayBufferContentsArena); + uint8_t* p = cx->pod_callocCanGC(nbytes, + js::ArrayBufferContentsArena); return ArrayBufferObject::BufferContents::create(p); } @@ -1249,7 +1250,6 @@ ArrayBufferObject::create(JSContext* cx, uint32_t nbytes, BufferContents content } else { contents = AllocateArrayBufferContents(cx, nbytes); if (!contents) { - ReportOutOfMemory(cx); return nullptr; } allocated = true;