Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(886)

Side by Side Diff: src/js/typedarray.js

Issue 2798403004: [SAB] Fix {newtarget-prototype-is-not-object,proto-from-ctor-realm} tests (Closed)
Patch Set: fix broken test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | test/mjsunit/harmony/sharedarraybuffer.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 // ES#sec-typedarray-typedarray TypedArray ( typedArray ) 142 // ES#sec-typedarray-typedarray TypedArray ( typedArray )
143 function NAMEConstructByTypedArray(obj, typedArray) { 143 function NAMEConstructByTypedArray(obj, typedArray) {
144 // TODO(littledan): Throw on detached typedArray 144 // TODO(littledan): Throw on detached typedArray
145 var srcData = %TypedArrayGetBuffer(typedArray); 145 var srcData = %TypedArrayGetBuffer(typedArray);
146 var length = %_TypedArrayGetLength(typedArray); 146 var length = %_TypedArrayGetLength(typedArray);
147 var byteLength = %_ArrayBufferViewGetByteLength(typedArray); 147 var byteLength = %_ArrayBufferViewGetByteLength(typedArray);
148 var newByteLength = length * ELEMENT_SIZE; 148 var newByteLength = length * ELEMENT_SIZE;
149 %typed_array_construct_by_array_like(obj, typedArray, length, ELEMENT_SIZE); 149 %typed_array_construct_by_array_like(obj, typedArray, length, ELEMENT_SIZE);
150 var bufferConstructor = SpeciesConstructor(srcData, GlobalArrayBuffer); 150 var bufferConstructor = (IS_SHAREDARRAYBUFFER(srcData))
adamk 2017/04/07 17:24:21 Nit: no need for the extra parens (the macros alre
binji 2017/04/07 18:55:36 Done.
151 ? GlobalArrayBuffer
152 : SpeciesConstructor(srcData, GlobalArrayBuffer);
151 var prototype = bufferConstructor.prototype; 153 var prototype = bufferConstructor.prototype;
152 // TODO(littledan): Use the right prototype based on bufferConstructor's realm 154 // TODO(littledan): Use the right prototype based on bufferConstructor's realm
153 if (IS_RECEIVER(prototype) && prototype !== GlobalArrayBufferPrototype) { 155 if (IS_RECEIVER(prototype) && prototype !== GlobalArrayBufferPrototype) {
154 %InternalSetPrototype(%TypedArrayGetBuffer(obj), prototype); 156 %InternalSetPrototype(%TypedArrayGetBuffer(obj), prototype);
155 } 157 }
156 } 158 }
157 159
158 function NAMEConstructor(arg1, arg2, arg3) { 160 function NAMEConstructor(arg1, arg2, arg3) {
159 if (!IS_UNDEFINED(new.target)) { 161 if (!IS_UNDEFINED(new.target)) {
160 if (IS_ARRAYBUFFER(arg1) || IS_SHAREDARRAYBUFFER(arg1)) { 162 if (IS_ARRAYBUFFER(arg1) || IS_SHAREDARRAYBUFFER(arg1)) {
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 %AddNamedProperty(GlobalNAME.prototype, 691 %AddNamedProperty(GlobalNAME.prototype,
690 "constructor", global.NAME, DONT_ENUM); 692 "constructor", global.NAME, DONT_ENUM);
691 %AddNamedProperty(GlobalNAME.prototype, 693 %AddNamedProperty(GlobalNAME.prototype,
692 "BYTES_PER_ELEMENT", ELEMENT_SIZE, 694 "BYTES_PER_ELEMENT", ELEMENT_SIZE,
693 READ_ONLY | DONT_ENUM | DONT_DELETE); 695 READ_ONLY | DONT_ENUM | DONT_DELETE);
694 endmacro 696 endmacro
695 697
696 TYPED_ARRAYS(SETUP_TYPED_ARRAY) 698 TYPED_ARRAYS(SETUP_TYPED_ARRAY)
697 699
698 }) 700 })
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | test/mjsunit/harmony/sharedarraybuffer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698