Changeset 160876 in webkit


Ignore:
Timestamp:
Dec 19, 2013 4:42:47 PM (10 years ago)
Author:
Brent Fulgham
Message:

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.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r160875 r160876  
     12013-12-19  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Implement ArrayBuffer.isView
     4        https://bugs.webkit.org/show_bug.cgi?id=126004
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html:
     9        Correct test for 'isView' to actually check for 'isView' function.
     10
    1112013-12-19  Alexey Proskuryakov  <ap@apple.com>
    212
  • trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html

    r157888 r160876  
    149149
    150150  try {
    151     if (!ArrayBuffer.create) {
     151    if (!ArrayBuffer.isView) {
    152152      testFailed('ArrayBuffer.isView() method does not exist');
    153153    } else {
  • trunk/Source/JavaScriptCore/ChangeLog

    r160869 r160876  
     12013-12-19  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Implement ArrayBuffer.isView
     4        https://bugs.webkit.org/show_bug.cgi?id=126004
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Test coverage in webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html
     9
     10        * runtime/JSArrayBufferConstructor.cpp:
     11        (JSC::JSArrayBufferConstructor::finishCreation): Add 'isView' to object constructor.
     12        (JSC::arrayBufferFuncIsView): New method.
     13
    1142013-12-19  Mark Lam  <mark.lam@apple.com>
    215
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r159031 r160876  
    113113    macro(isArray) \
    114114    macro(isPrototypeOf) \
     115    macro(isView) \
    115116    macro(isWatchpoint) \
    116117    macro(join) \
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp

    r156624 r160876  
    3636namespace JSC {
    3737
     38static EncodedJSValue JSC_HOST_CALL arrayBufferFuncIsView(ExecState*);
     39
    3840const ClassInfo JSArrayBufferConstructor::s_info = {
    3941    "Function", &Base::s_info, 0, 0,
     
    5153    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
    5254    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontEnum | DontDelete | ReadOnly);
     55
     56    JSGlobalObject* globalObject = this->globalObject();
     57    JSC_NATIVE_FUNCTION(vm.propertyNames->isView, arrayBufferFuncIsView, DontEnum, 1);
    5358}
    5459
     
    109114}
    110115
     116// ------------------------------ Functions --------------------------------
     117
     118// ECMA 24.1.3.1
     119EncodedJSValue JSC_HOST_CALL arrayBufferFuncIsView(ExecState* exec)
     120{
     121    return JSValue::encode(jsBoolean(jsDynamicCast<JSArrayBufferView*>(exec->argument(0))));
     122}
     123   
     124
    111125} // namespace JSC
    112126
Note: See TracChangeset for help on using the changeset viewer.