⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 195375 in webkit


Ignore:
Timestamp:
Jan 20, 2016, 1:49:09 PM (11 years ago)
Author:
keith_miller@apple.com
Message:

TypedArray's .buffer does not return the JSArrayBuffer that was passed to it on creation.
https://bugs.webkit.org/show_bug.cgi?id=153281

Reviewed by Geoffrey Garen.

When creating an JSArrayBuffer we should make sure that the backing ArrayBuffer uses the
new JSArrayBuffer as its wrapper. This causes issues when we get the buffer of a Typed Array
created by passing a JSArrayBuffer as the backing ArrayBuffer does not have a reference to
the original JSArrayBuffer and a new object is created.

  • runtime/JSArrayBuffer.cpp:

(JSC::JSArrayBuffer::finishCreation):

  • tests/stress/typedarray-buffer-neutered.js: Added.

(arrays.typedArrays.map):

Location:
trunk/Source/JavaScriptCore
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r195365 r195375  
     12016-01-20  Keith Miller  <keith_miller@apple.com>
     2
     3        TypedArray's .buffer does not return the JSArrayBuffer that was passed to it on creation.
     4        https://bugs.webkit.org/show_bug.cgi?id=153281
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        When creating an JSArrayBuffer we should make sure that the backing ArrayBuffer uses the
     9        new JSArrayBuffer as its wrapper. This causes issues when we get the buffer of a Typed Array
     10        created by passing a JSArrayBuffer as the backing ArrayBuffer does not have a reference to
     11        the original JSArrayBuffer and a new object is created.
     12
     13        * runtime/JSArrayBuffer.cpp:
     14        (JSC::JSArrayBuffer::finishCreation):
     15        * tests/stress/typedarray-buffer-neutered.js: Added.
     16        (arrays.typedArrays.map):
     17
    1182016-01-20  Andreas Kling  <akling@apple.com>
    219
  • trunk/Source/JavaScriptCore/runtime/JSArrayBuffer.cpp

    r182280 r195375  
    4545    Base::finishCreation(vm);
    4646    vm.heap.addReference(this, m_impl);
     47    m_impl->m_wrapper = this;
    4748}
    4849
Note: See TracChangeset for help on using the changeset viewer.