Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: test/mjsunit/es6/built-in-accessor-names.js

Issue 1186733002: Add %TypedArray% to proto chain (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: changes from arv's review Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/typedarray.js ('k') | test/mjsunit/get-prototype-of.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/typedarray.js ('k') | test/mjsunit/get-prototype-of.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698