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

Side by Side Diff: src/typedarray.js

Issue 16542002: Fix TypedArray error for parameterless constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 return function (arg1, arg2, arg3) { 88 return function (arg1, arg2, arg3) {
89 if (%_IsConstructCall()) { 89 if (%_IsConstructCall()) {
90 if (IS_ARRAYBUFFER(arg1)) { 90 if (IS_ARRAYBUFFER(arg1)) {
91 ConstructByArrayBuffer(this, arg1, arg2, arg3); 91 ConstructByArrayBuffer(this, arg1, arg2, arg3);
92 } else if (IS_NUMBER(arg1) || IS_STRING(arg1) || IS_BOOLEAN(arg1)) { 92 } else if (IS_NUMBER(arg1) || IS_STRING(arg1) || IS_BOOLEAN(arg1)) {
93 ConstructByLength(this, arg1); 93 ConstructByLength(this, arg1);
94 } else if (!IS_UNDEFINED(arg1)){ 94 } else if (!IS_UNDEFINED(arg1)){
95 ConstructByArrayLike(this, arg1); 95 ConstructByArrayLike(this, arg1);
96 } else { 96 } else {
97 throw MakeTypeError("parameterless_typed_array_constr", name); 97 throw MakeTypeError("parameterless_typed_array_constr", [name]);
98 } 98 }
99 } else { 99 } else {
100 return new constructor(arg1, arg2, arg3); 100 return new constructor(arg1, arg2, arg3);
101 } 101 }
102 } 102 }
103 } 103 }
104 104
105 function TypedArrayGetBuffer() { 105 function TypedArrayGetBuffer() {
106 return %TypedArrayGetBuffer(this); 106 return %TypedArrayGetBuffer(this);
107 } 107 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // arrayIds below should be synchronized with Runtime_TypedArrayInitialize. 190 // arrayIds below should be synchronized with Runtime_TypedArrayInitialize.
191 SetupTypedArray(1, "Uint8Array", global.Uint8Array, 1); 191 SetupTypedArray(1, "Uint8Array", global.Uint8Array, 1);
192 SetupTypedArray(2, "Int8Array", global.Int8Array, 1); 192 SetupTypedArray(2, "Int8Array", global.Int8Array, 1);
193 SetupTypedArray(3, "Uint16Array", global.Uint16Array, 2); 193 SetupTypedArray(3, "Uint16Array", global.Uint16Array, 2);
194 SetupTypedArray(4, "Int16Array", global.Int16Array, 2); 194 SetupTypedArray(4, "Int16Array", global.Int16Array, 2);
195 SetupTypedArray(5, "Uint32Array", global.Uint32Array, 4); 195 SetupTypedArray(5, "Uint32Array", global.Uint32Array, 4);
196 SetupTypedArray(6, "Int32Array", global.Int32Array, 4); 196 SetupTypedArray(6, "Int32Array", global.Int32Array, 4);
197 SetupTypedArray(7, "Float32Array", global.Float32Array, 4); 197 SetupTypedArray(7, "Float32Array", global.Float32Array, 4);
198 SetupTypedArray(8, "Float64Array", global.Float64Array, 8); 198 SetupTypedArray(8, "Float64Array", global.Float64Array, 8);
199 SetupTypedArray(9, "Uint8ClampedArray", global.Uint8ClampedArray, 1); 199 SetupTypedArray(9, "Uint8ClampedArray", global.Uint8ClampedArray, 1);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698