Index: test/mjsunit/es6/built-in-accessor-names.js |
diff --git a/test/mjsunit/es6/built-in-accessor-names.js b/test/mjsunit/es6/built-in-accessor-names.js |
index d902ae6700aa52a93cadaa783f45d254085aec33..4cfebdc3c71f8df711b31805116fd005ac1725a7 100644 |
--- a/test/mjsunit/es6/built-in-accessor-names.js |
+++ b/test/mjsunit/es6/built-in-accessor-names.js |
@@ -6,14 +6,22 @@ |
'use strict'; |
-function assertGetterName(expected, object, name) { |
- var descr = Object.getOwnPropertyDescriptor(object, name); |
+function getPropertyDescriptor(object, field, expectedDepth) { |
+ for (var depth = 0; depth < expectedDepth; depth++) { |
+ assertFalse(Object.hasOwnProperty(object, field)); |
+ object = object.__proto__; |
+ } |
+ return Object.getOwnPropertyDescriptor(object, field); |
+} |
+ |
+function assertGetterName(expected, object, name, expectedDepth) { |
+ var descr = getPropertyDescriptor(object, name, expectedDepth); |
assertSame(expected, descr.get.name); |
} |
-function assertSetterName(expected, object, name) { |
- var descr = Object.getOwnPropertyDescriptor(object, name); |
+function assertSetterName(expected, object, name, indirect) { |
+ var descr = getPropertyDescriptor(object, name); |
assertSame(expected, descr.set.name); |
} |
@@ -36,11 +44,11 @@ let typedArrays = [ |
]; |
for (let f of typedArrays) { |
- assertGetterName('get buffer', f.prototype, 'buffer'); |
- assertGetterName('get byteOffset', f.prototype, 'byteOffset'); |
- assertGetterName('get byteLength', f.prototype, 'byteLength'); |
- assertGetterName('get length', f.prototype, 'length'); |
- assertGetterName('get [Symbol.toStringTag]', f.prototype, Symbol.toStringTag); |
+ assertGetterName('get buffer', f.prototype, 'buffer', 1); |
+ assertGetterName('get byteOffset', f.prototype, 'byteOffset', 1); |
+ assertGetterName('get byteLength', f.prototype, 'byteLength', 1); |
+ assertGetterName('get length', f.prototype, 'length', 1); |
+ assertGetterName('get [Symbol.toStringTag]', f.prototype, Symbol.toStringTag, 1); |
} |