OLD | NEW |
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 Loading... |
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 Loading... |
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 }) |
OLD | NEW |