OLD | NEW |
| (Empty) |
1 // Copyright 2015 the V8 project authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 'use strict'; | |
6 | |
7 function assertGetterName(expected, object, name) { | |
8 var descr = Object.getOwnPropertyDescriptor(object, name); | |
9 assertSame(expected, descr.get.name); | |
10 } | |
11 | |
12 | |
13 function assertSetterName(expected, object, name) { | |
14 var descr = Object.getOwnPropertyDescriptor(object, name); | |
15 assertSame(expected, descr.set.name); | |
16 } | |
17 | |
18 | |
19 assertGetterName('get byteLength', ArrayBuffer.prototype, 'byteLength'); | |
20 assertGetterName('get size', Set.prototype, 'size'); | |
21 assertGetterName('get size', Map.prototype, 'size'); | |
22 | |
23 | |
24 let typedArrays = [ | |
25 Uint8Array, | |
26 Int8Array, | |
27 Uint16Array, | |
28 Int16Array, | |
29 Uint32Array, | |
30 Int32Array, | |
31 Float32Array, | |
32 Float64Array, | |
33 Uint8ClampedArray | |
34 ]; | |
35 | |
36 for (let f of typedArrays) { | |
37 assertGetterName('get buffer', f.prototype, 'buffer'); | |
38 assertGetterName('get byteOffset', f.prototype, 'byteOffset'); | |
39 assertGetterName('get byteLength', f.prototype, 'byteLength'); | |
40 assertGetterName('get length', f.prototype, 'length'); | |
41 assertGetterName('get [Symbol.toStringTag]', f.prototype, Symbol.toStringTag); | |
42 } | |
43 | |
44 | |
45 assertGetterName('get buffer', DataView.prototype, 'buffer'); | |
46 assertGetterName('get byteOffset', DataView.prototype, 'byteOffset'); | |
47 assertGetterName('get byteLength', DataView.prototype, 'byteLength'); | |
48 | |
49 | |
50 assertGetterName('get __proto__', Object.prototype, '__proto__'); | |
51 assertSetterName('set __proto__', Object.prototype, '__proto__'); | |
OLD | NEW |