Commit b42262a8 authored by bfulgham@apple.com's avatar bfulgham@apple.com

Implement ArrayBuffer.isView

https://bugs.webkit.org/show_bug.cgi?id=126004

Reviewed by Filip Pizlo.

Source/JavaScriptCore: 

Test coverage in webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html

* runtime/JSArrayBufferConstructor.cpp:
(JSC::JSArrayBufferConstructor::finishCreation): Add 'isView' to object constructor.
(JSC::arrayBufferFuncIsView): New method.

LayoutTests: 

* webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html:
Correct test for 'isView' to actually check for 'isView' function.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3c8488dc
2013-12-19 Brent Fulgham <bfulgham@apple.com>
Implement ArrayBuffer.isView
https://bugs.webkit.org/show_bug.cgi?id=126004
Reviewed by Filip Pizlo.
* webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html:
Correct test for 'isView' to actually check for 'isView' function.
2013-12-19 Alexey Proskuryakov <ap@apple.com>
Layout Test plugins/destroy-during-npp-new.html is flaky
......@@ -148,7 +148,7 @@ function testArrayBufferIsViewMethod() {
debug('test ArrayBuffer.isView() with various values');
try {
if (!ArrayBuffer.create) {
if (!ArrayBuffer.isView) {
testFailed('ArrayBuffer.isView() method does not exist');
} else {
testPassed('ArrayBuffer.isView() method exists');
......
2013-12-19 Brent Fulgham <bfulgham@apple.com>
Implement ArrayBuffer.isView
https://bugs.webkit.org/show_bug.cgi?id=126004
Reviewed by Filip Pizlo.
Test coverage in webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html
* runtime/JSArrayBufferConstructor.cpp:
(JSC::JSArrayBufferConstructor::finishCreation): Add 'isView' to object constructor.
(JSC::arrayBufferFuncIsView): New method.
2013-12-19 Mark Lam <mark.lam@apple.com>
Fix broken C loop LLINT build.
......
......@@ -112,6 +112,7 @@
macro(instructionCount) \
macro(isArray) \
macro(isPrototypeOf) \
macro(isView) \
macro(isWatchpoint) \
macro(join) \
macro(keys) \
......
......@@ -35,6 +35,8 @@
namespace JSC {
static EncodedJSValue JSC_HOST_CALL arrayBufferFuncIsView(ExecState*);
const ClassInfo JSArrayBufferConstructor::s_info = {
"Function", &Base::s_info, 0, 0,
CREATE_METHOD_TABLE(JSArrayBufferConstructor)
......@@ -50,6 +52,9 @@ void JSArrayBufferConstructor::finishCreation(VM& vm, JSArrayBufferPrototype* pr
Base::finishCreation(vm, "ArrayBuffer");
putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontEnum | DontDelete | ReadOnly);
JSGlobalObject* globalObject = this->globalObject();
JSC_NATIVE_FUNCTION(vm.propertyNames->isView, arrayBufferFuncIsView, DontEnum, 1);
}
JSArrayBufferConstructor* JSArrayBufferConstructor::create(VM& vm, Structure* structure, JSArrayBufferPrototype* prototype)
......@@ -108,5 +113,14 @@ CallType JSArrayBufferConstructor::getCallData(JSCell*, CallData& callData)
return CallTypeHost;
}
// ------------------------------ Functions --------------------------------
// ECMA 24.1.3.1
EncodedJSValue JSC_HOST_CALL arrayBufferFuncIsView(ExecState* exec)
{
return JSValue::encode(jsBoolean(jsDynamicCast<JSArrayBufferView*>(exec->argument(0))));
}
} // namespace JSC
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment