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

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

Issue 1474343002: Use new.target in favor of %_IsConstructCall intrinsic (2). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_js-use-new-target-1
Patch Set: Skip ignition. Created 5 years 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/js/i18n.js ('k') | src/js/v8natives.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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // TODO(littledan): Computed properties don't work yet in nosnap. 196 // TODO(littledan): Computed properties don't work yet in nosnap.
197 // Rephrase when they do. 197 // Rephrase when they do.
198 newIterable[iteratorSymbol] = function() { return iterator; } 198 newIterable[iteratorSymbol] = function() { return iterator; }
199 for (var value of newIterable) { 199 for (var value of newIterable) {
200 list.push(value); 200 list.push(value);
201 } 201 }
202 NAMEConstructByArrayLike(obj, list); 202 NAMEConstructByArrayLike(obj, list);
203 } 203 }
204 204
205 function NAMEConstructor(arg1, arg2, arg3) { 205 function NAMEConstructor(arg1, arg2, arg3) {
206 if (%_IsConstructCall()) { 206 if (!IS_UNDEFINED(new.target)) {
207 if (IS_ARRAYBUFFER(arg1) || IS_SHAREDARRAYBUFFER(arg1)) { 207 if (IS_ARRAYBUFFER(arg1) || IS_SHAREDARRAYBUFFER(arg1)) {
208 NAMEConstructByArrayBuffer(this, arg1, arg2, arg3); 208 NAMEConstructByArrayBuffer(this, arg1, arg2, arg3);
209 } else if (IS_NUMBER(arg1) || IS_STRING(arg1) || 209 } else if (IS_NUMBER(arg1) || IS_STRING(arg1) ||
210 IS_BOOLEAN(arg1) || IS_UNDEFINED(arg1)) { 210 IS_BOOLEAN(arg1) || IS_UNDEFINED(arg1)) {
211 NAMEConstructByLength(this, arg1); 211 NAMEConstructByLength(this, arg1);
212 } else { 212 } else {
213 var iteratorFn = arg1[iteratorSymbol]; 213 var iteratorFn = arg1[iteratorSymbol];
214 if (IS_UNDEFINED(iteratorFn) || iteratorFn === ArrayValues) { 214 if (IS_UNDEFINED(iteratorFn) || iteratorFn === ArrayValues) {
215 NAMEConstructByArrayLike(this, arg1); 215 NAMEConstructByArrayLike(this, arg1);
216 } else { 216 } else {
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 "setUint32", DataViewSetUint32JS, 889 "setUint32", DataViewSetUint32JS,
890 890
891 "getFloat32", DataViewGetFloat32JS, 891 "getFloat32", DataViewGetFloat32JS,
892 "setFloat32", DataViewSetFloat32JS, 892 "setFloat32", DataViewSetFloat32JS,
893 893
894 "getFloat64", DataViewGetFloat64JS, 894 "getFloat64", DataViewGetFloat64JS,
895 "setFloat64", DataViewSetFloat64JS 895 "setFloat64", DataViewSetFloat64JS
896 ]); 896 ]);
897 897
898 }) 898 })
OLDNEW
« no previous file with comments | « src/js/i18n.js ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698