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 "use strict"; | 5 "use strict"; |
6 | 6 |
7 // This file relies on the fact that the following declaration has been made | 7 // This file relies on the fact that the following declaration has been made |
8 // in runtime.js: | 8 // in runtime.js: |
9 // var $Array = global.Array; | 9 // var $Array = global.Array; |
10 var $ArrayBuffer = global.ArrayBuffer; | 10 var $ArrayBuffer = global.ArrayBuffer; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 READ_ONLY | DONT_ENUM | DONT_DELETE); | 315 READ_ONLY | DONT_ENUM | DONT_DELETE); |
316 InstallGetter(global.NAME.prototype, "buffer", NAME_GetBuffer); | 316 InstallGetter(global.NAME.prototype, "buffer", NAME_GetBuffer); |
317 InstallGetter(global.NAME.prototype, "byteOffset", NAME_GetByteOffset, | 317 InstallGetter(global.NAME.prototype, "byteOffset", NAME_GetByteOffset, |
318 DONT_ENUM | DONT_DELETE); | 318 DONT_ENUM | DONT_DELETE); |
319 InstallGetter(global.NAME.prototype, "byteLength", NAME_GetByteLength, | 319 InstallGetter(global.NAME.prototype, "byteLength", NAME_GetByteLength, |
320 DONT_ENUM | DONT_DELETE); | 320 DONT_ENUM | DONT_DELETE); |
321 InstallGetter(global.NAME.prototype, "length", NAME_GetLength, | 321 InstallGetter(global.NAME.prototype, "length", NAME_GetLength, |
322 DONT_ENUM | DONT_DELETE); | 322 DONT_ENUM | DONT_DELETE); |
323 InstallGetter(global.NAME.prototype, symbolToStringTag, | 323 InstallGetter(global.NAME.prototype, symbolToStringTag, |
324 TypedArrayGetToStringTag); | 324 TypedArrayGetToStringTag); |
325 InstallFunctions(global.NAME.prototype, DONT_ENUM, $Array( | 325 InstallFunctions(global.NAME.prototype, DONT_ENUM, [ |
326 "subarray", NAMESubArray, | 326 "subarray", NAMESubArray, |
327 "set", TypedArraySet | 327 "set", TypedArraySet |
328 )); | 328 ]); |
329 endmacro | 329 endmacro |
330 | 330 |
331 TYPED_ARRAYS(SETUP_TYPED_ARRAY) | 331 TYPED_ARRAYS(SETUP_TYPED_ARRAY) |
332 } | 332 } |
333 | 333 |
334 SetupTypedArrays(); | 334 SetupTypedArrays(); |
335 | 335 |
336 // --------------------------- DataView ----------------------------- | 336 // --------------------------- DataView ----------------------------- |
337 | 337 |
338 var $DataView = global.DataView; | 338 var $DataView = global.DataView; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 448 |
449 // Set up constructor property on the DataView prototype. | 449 // Set up constructor property on the DataView prototype. |
450 %AddNamedProperty($DataView.prototype, "constructor", $DataView, DONT_ENUM); | 450 %AddNamedProperty($DataView.prototype, "constructor", $DataView, DONT_ENUM); |
451 %AddNamedProperty( | 451 %AddNamedProperty( |
452 $DataView.prototype, symbolToStringTag, "DataView", READ_ONLY|DONT_ENUM); | 452 $DataView.prototype, symbolToStringTag, "DataView", READ_ONLY|DONT_ENUM); |
453 | 453 |
454 InstallGetter($DataView.prototype, "buffer", DataViewGetBufferJS); | 454 InstallGetter($DataView.prototype, "buffer", DataViewGetBufferJS); |
455 InstallGetter($DataView.prototype, "byteOffset", DataViewGetByteOffset); | 455 InstallGetter($DataView.prototype, "byteOffset", DataViewGetByteOffset); |
456 InstallGetter($DataView.prototype, "byteLength", DataViewGetByteLength); | 456 InstallGetter($DataView.prototype, "byteLength", DataViewGetByteLength); |
457 | 457 |
458 InstallFunctions($DataView.prototype, DONT_ENUM, $Array( | 458 InstallFunctions($DataView.prototype, DONT_ENUM, [ |
459 "getInt8", DataViewGetInt8JS, | 459 "getInt8", DataViewGetInt8JS, |
460 "setInt8", DataViewSetInt8JS, | 460 "setInt8", DataViewSetInt8JS, |
461 | 461 |
462 "getUint8", DataViewGetUint8JS, | 462 "getUint8", DataViewGetUint8JS, |
463 "setUint8", DataViewSetUint8JS, | 463 "setUint8", DataViewSetUint8JS, |
464 | 464 |
465 "getInt16", DataViewGetInt16JS, | 465 "getInt16", DataViewGetInt16JS, |
466 "setInt16", DataViewSetInt16JS, | 466 "setInt16", DataViewSetInt16JS, |
467 | 467 |
468 "getUint16", DataViewGetUint16JS, | 468 "getUint16", DataViewGetUint16JS, |
469 "setUint16", DataViewSetUint16JS, | 469 "setUint16", DataViewSetUint16JS, |
470 | 470 |
471 "getInt32", DataViewGetInt32JS, | 471 "getInt32", DataViewGetInt32JS, |
472 "setInt32", DataViewSetInt32JS, | 472 "setInt32", DataViewSetInt32JS, |
473 | 473 |
474 "getUint32", DataViewGetUint32JS, | 474 "getUint32", DataViewGetUint32JS, |
475 "setUint32", DataViewSetUint32JS, | 475 "setUint32", DataViewSetUint32JS, |
476 | 476 |
477 "getFloat32", DataViewGetFloat32JS, | 477 "getFloat32", DataViewGetFloat32JS, |
478 "setFloat32", DataViewSetFloat32JS, | 478 "setFloat32", DataViewSetFloat32JS, |
479 | 479 |
480 "getFloat64", DataViewGetFloat64JS, | 480 "getFloat64", DataViewGetFloat64JS, |
481 "setFloat64", DataViewSetFloat64JS | 481 "setFloat64", DataViewSetFloat64JS |
482 )); | 482 ]); |
483 } | 483 } |
484 | 484 |
485 SetupDataView(); | 485 SetupDataView(); |
OLD | NEW |