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

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

Issue 1093183006: [es6] Map/Set size getter should have "get size" name (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use IS_UNDEFINED instead Created 5 years, 8 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/v8natives.js ('k') | test/mjsunit/es6/collections.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
new file mode 100644
index 0000000000000000000000000000000000000000..79de239ab305bce54bd7db67e3b8e6e3860a6edc
--- /dev/null
+++ b/test/mjsunit/es6/built-in-accessor-names.js
@@ -0,0 +1,51 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+function assertGetterName(expected, object, name) {
+ var descr = Object.getOwnPropertyDescriptor(object, name);
+ assertSame(expected, descr.get.name);
+}
+
+
+function assertSetterName(expected, object, name) {
+ var descr = Object.getOwnPropertyDescriptor(object, name);
+ assertSame(expected, descr.set.name);
+}
+
+
+assertGetterName('get byteLength', ArrayBuffer.prototype, 'byteLength');
+assertGetterName('get size', Set.prototype, 'size');
+assertGetterName('get size', Map.prototype, 'size');
+
+
+let typedArrays = [
+ Uint8Array,
+ Int8Array,
+ Uint16Array,
+ Int16Array,
+ Uint32Array,
+ Int32Array,
+ Float32Array,
+ Float64Array,
+ Uint8ClampedArray
+];
+
+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', DataView.prototype, 'buffer');
+assertGetterName('get byteOffset', DataView.prototype, 'byteOffset');
+assertGetterName('get byteLength', DataView.prototype, 'byteLength');
+
+
+assertGetterName('get __proto__', Object.prototype, '__proto__');
+assertSetterName('set __proto__', Object.prototype, '__proto__');
« no previous file with comments | « src/v8natives.js ('k') | test/mjsunit/es6/collections.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698