From ccaf2695e7e746bbe18f1db0888fbcf12a013624 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Tue, 6 May 2014 10:40:04 -0700 Subject: [PATCH] Bug 1003997. r=sfink --- js/src/vm/ArrayBufferObject.cpp | 4 +++- js/src/vm/TypedArrayObject.h | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/src/vm/ArrayBufferObject.cpp b/js/src/vm/ArrayBufferObject.cpp index cee3573d858d..3982a56b1423 100644 --- a/js/src/vm/ArrayBufferObject.cpp +++ b/js/src/vm/ArrayBufferObject.cpp @@ -970,8 +970,10 @@ ArrayBufferViewObject::bufferObject(JSContext *cx, Handle typedArray(cx, &thisObject->as()); if (!TypedArrayObject::ensureHasBuffer(cx, typedArray)) return nullptr; + return thisObject->as().buffer(); } - return &thisObject->getFixedSlot(BUFFER_SLOT).toObject().as(); + MOZ_ASSERT(thisObject->is()); + return &thisObject->as().arrayBuffer(); } /* JS Friend API */ diff --git a/js/src/vm/TypedArrayObject.h b/js/src/vm/TypedArrayObject.h index b904f829a94f..bc07337566c1 100644 --- a/js/src/vm/TypedArrayObject.h +++ b/js/src/vm/TypedArrayObject.h @@ -367,8 +367,7 @@ template <> inline bool JSObject::is() const { - return is() || is() || - IsTypedObjectClass(getClass()); + return is() || is(); } #endif /* vm_TypedArrayObject_h */