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// Flags: --harmony-tostring 6 7'use strict'; 8 9function assertGetterName(expected, object, name) { 10 var descr = Object.getOwnPropertyDescriptor(object, name); 11 assertSame(expected, descr.get.name); 12} 13 14 15function assertSetterName(expected, object, name) { 16 var descr = Object.getOwnPropertyDescriptor(object, name); 17 assertSame(expected, descr.set.name); 18} 19 20 21assertGetterName('get byteLength', ArrayBuffer.prototype, 'byteLength'); 22assertGetterName('get size', Set.prototype, 'size'); 23assertGetterName('get size', Map.prototype, 'size'); 24 25 26let TypedArray = Uint8Array.__proto__; 27 28assertGetterName('get buffer', TypedArray.prototype, 'buffer'); 29assertGetterName('get byteOffset', TypedArray.prototype, 'byteOffset'); 30assertGetterName('get byteLength', TypedArray.prototype, 'byteLength'); 31assertGetterName('get length', TypedArray.prototype, 'length'); 32assertGetterName('get [Symbol.toStringTag]', TypedArray.prototype, Symbol.toStringTag); 33 34 35assertGetterName('get buffer', DataView.prototype, 'buffer'); 36assertGetterName('get byteOffset', DataView.prototype, 'byteOffset'); 37assertGetterName('get byteLength', DataView.prototype, 'byteLength'); 38 39 40assertGetterName('get __proto__', Object.prototype, '__proto__'); 41assertSetterName('set __proto__', Object.prototype, '__proto__'); 42