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() { | 5 (function() { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // propagate outside the function. | 99 // propagate outside the function. |
100 obj[i] = arrayLike[i]; | 100 obj[i] = arrayLike[i]; |
101 } | 101 } |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 function NAMEConstructor(arg1, arg2, arg3) { | 105 function NAMEConstructor(arg1, arg2, arg3) { |
106 if (%_IsConstructCall()) { | 106 if (%_IsConstructCall()) { |
107 if (IS_ARRAYBUFFER(arg1)) { | 107 if (IS_ARRAYBUFFER(arg1)) { |
108 NAMEConstructByArrayBuffer(this, arg1, arg2, arg3); | 108 NAMEConstructByArrayBuffer(this, arg1, arg2, arg3); |
| 109 } else if (IS_SHAREDARRAYBUFFER(arg1)) { |
| 110 throw MakeTypeError("invalid_argument"); |
109 } else if (IS_NUMBER(arg1) || IS_STRING(arg1) || | 111 } else if (IS_NUMBER(arg1) || IS_STRING(arg1) || |
110 IS_BOOLEAN(arg1) || IS_UNDEFINED(arg1)) { | 112 IS_BOOLEAN(arg1) || IS_UNDEFINED(arg1)) { |
111 NAMEConstructByLength(this, arg1); | 113 NAMEConstructByLength(this, arg1); |
112 } else { | 114 } else { |
113 NAMEConstructByArrayLike(this, arg1); | 115 NAMEConstructByArrayLike(this, arg1); |
114 } | 116 } |
115 } else { | 117 } else { |
116 throw MakeTypeError("constructor_not_function", ["NAME"]) | 118 throw MakeTypeError("constructor_not_function", ["NAME"]) |
117 } | 119 } |
118 } | 120 } |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 "setUint32", DataViewSetUint32JS, | 464 "setUint32", DataViewSetUint32JS, |
463 | 465 |
464 "getFloat32", DataViewGetFloat32JS, | 466 "getFloat32", DataViewGetFloat32JS, |
465 "setFloat32", DataViewSetFloat32JS, | 467 "setFloat32", DataViewSetFloat32JS, |
466 | 468 |
467 "getFloat64", DataViewGetFloat64JS, | 469 "getFloat64", DataViewGetFloat64JS, |
468 "setFloat64", DataViewSetFloat64JS | 470 "setFloat64", DataViewSetFloat64JS |
469 ]); | 471 ]); |
470 | 472 |
471 })(); | 473 })(); |
OLD | NEW |