OLD | NEW |
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 function TypedArraySet(obj, offset) { | 147 function TypedArraySet(obj, offset) { |
148 var intOffset = IS_UNDEFINED(offset) ? 0 : TO_INTEGER(offset); | 148 var intOffset = IS_UNDEFINED(offset) ? 0 : TO_INTEGER(offset); |
149 if (intOffset < 0) { | 149 if (intOffset < 0) { |
150 throw MakeTypeError("typed_array_set_negative_offset"); | 150 throw MakeTypeError("typed_array_set_negative_offset"); |
151 } | 151 } |
152 if (%TypedArraySetFastCases(this, obj, intOffset)) | 152 if (%TypedArraySetFastCases(this, obj, intOffset)) |
153 return; | 153 return; |
154 | 154 |
155 var l = obj.length; | 155 var l = obj.length; |
156 if (IS_UNDEFINED(l)) { | 156 if (IS_UNDEFINED(l)) { |
157 throw MakeTypeError("invalid_argument"); | 157 return; |
158 } | 158 } |
159 if (intOffset + l > this.length) { | 159 if (intOffset + l > this.length) { |
160 throw MakeRangeError("typed_array_set_source_too_large"); | 160 throw MakeRangeError("typed_array_set_source_too_large"); |
161 } | 161 } |
162 for (var i = 0; i < l; i++) { | 162 for (var i = 0; i < l; i++) { |
163 this[intOffset + i] = obj[i]; | 163 this[intOffset + i] = obj[i]; |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 // ------------------------------------------------------------------- | 167 // ------------------------------------------------------------------- |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 505 |
506 "getFloat32", DataViewGetFloat32, | 506 "getFloat32", DataViewGetFloat32, |
507 "setFloat32", DataViewSetFloat32, | 507 "setFloat32", DataViewSetFloat32, |
508 | 508 |
509 "getFloat64", DataViewGetFloat64, | 509 "getFloat64", DataViewGetFloat64, |
510 "setFloat64", DataViewSetFloat64 | 510 "setFloat64", DataViewSetFloat64 |
511 )); | 511 )); |
512 } | 512 } |
513 | 513 |
514 SetupDataView(); | 514 SetupDataView(); |
OLD | NEW |