Skip to content

Commit 2d38652

Browse files
committed
Fixed toJSArrayBufferView to return properly constructed JSObject
1 parent 4cc58ec commit 2d38652

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2883,6 +2883,7 @@
28832883
B6D18813166FA73300D1037C /* TypedArrays */ = {
28842884
isa = PBXGroup;
28852885
children = (
2886+
B6D188881673751400D1037C /* GlobalDataHelper.h */,
28862887
B6D18814166FA73400D1037C /* JSArrayBuffer.cpp */,
28872888
B6D18815166FA73400D1037C /* JSArrayBuffer.h */,
28882889
B6D18816166FA73400D1037C /* JSArrayBufferCustom.cpp */,
@@ -2892,7 +2893,6 @@
28922893
B6D1888D167381A300D1037C /* JSFloat32ArrayCustom.cpp */,
28932894
B6D1886E1672DFE700D1037C /* JSFloat32Array.cpp */,
28942895
B6D1886F1672DFE700D1037C /* JSFloat32Array.h */,
2895-
B6D188881673751400D1037C /* GlobalDataHelper.h */,
28962896
);
28972897
path = TypedArrays;
28982898
sourceTree = "<group>";

JavaScriptCore/runtime/TypedArrays/JSArrayBufferViewHelper.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,11 @@ PassRefPtr<C> constructArrayBufferView(JSC::ExecState* exec)
163163
template <typename JSType, typename WebCoreType>
164164
static JSC::JSValue toJSArrayBufferView(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, WebCoreType* object)
165165
{
166-
ASSERT_UNUSED(globalObject, globalObject);
167166
if (!object)
168167
return JSC::jsNull();
169168

170169
exec->heap()->reportExtraMemoryCost(object->byteLength());
171-
JSC::JSCell* jsCell = reinterpret_cast<JSC::JSCell*>(object);
170+
JSC::JSCell * jsCell = JSType::create(JSType::createStructure(exec->globalData(), globalObject,JSType::createPrototype(exec, globalObject)), globalObject, object);
172171
return jsCell;
173172
}
174173

0 commit comments

Comments
 (0)