| 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 } | 353 } |
| 354 | 354 |
| 355 var length = IS_UNDEFINED(byteLength) | 355 var length = IS_UNDEFINED(byteLength) |
| 356 ? bufferByteLength - offset | 356 ? bufferByteLength - offset |
| 357 : byteLength; | 357 : byteLength; |
| 358 if (length < 0 || offset + length > bufferByteLength) { | 358 if (length < 0 || offset + length > bufferByteLength) { |
| 359 throw new MakeRangeError('invalid_data_view_length'); | 359 throw new MakeRangeError('invalid_data_view_length'); |
| 360 } | 360 } |
| 361 %_DataViewInitialize(this, buffer, offset, length); | 361 %_DataViewInitialize(this, buffer, offset, length); |
| 362 } else { | 362 } else { |
| 363 throw MakeTypeError('constructor_not_function', ["DataView"]); | 363 throw MakeTypeError(kConstructorNotFunction, "DataView"); |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 | 366 |
| 367 function DataViewGetBufferJS() { | 367 function DataViewGetBufferJS() { |
| 368 if (!IS_DATAVIEW(this)) { | 368 if (!IS_DATAVIEW(this)) { |
| 369 throw MakeTypeError(kIncompatibleMethodReceiver, 'DataView.buffer', this); | 369 throw MakeTypeError(kIncompatibleMethodReceiver, 'DataView.buffer', this); |
| 370 } | 370 } |
| 371 return %DataViewGetBuffer(this); | 371 return %DataViewGetBuffer(this); |
| 372 } | 372 } |
| 373 | 373 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 "setUint32", DataViewSetUint32JS, | 468 "setUint32", DataViewSetUint32JS, |
| 469 | 469 |
| 470 "getFloat32", DataViewGetFloat32JS, | 470 "getFloat32", DataViewGetFloat32JS, |
| 471 "setFloat32", DataViewSetFloat32JS, | 471 "setFloat32", DataViewSetFloat32JS, |
| 472 | 472 |
| 473 "getFloat64", DataViewGetFloat64JS, | 473 "getFloat64", DataViewGetFloat64JS, |
| 474 "setFloat64", DataViewSetFloat64JS | 474 "setFloat64", DataViewSetFloat64JS |
| 475 ]); | 475 ]); |
| 476 | 476 |
| 477 })(); | 477 })(); |
| OLD | NEW |