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

Unified Diff: test/mjsunit/es6/prototype-ordinary-objects.js

Issue 1072573002: [es6] ship @@toStringTag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix prototype-ordinary-objects test 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/flag-definitions.h ('k') | test/mjsunit/function-arguments-null.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/prototype-ordinary-objects.js
diff --git a/test/mjsunit/es6/prototype-ordinary-objects.js b/test/mjsunit/es6/prototype-ordinary-objects.js
index 6704288089a50dd355a09e16d96de47925d83e85..fdbc18d36dc19596513333820ff6a32313b9c1a8 100644
--- a/test/mjsunit/es6/prototype-ordinary-objects.js
+++ b/test/mjsunit/es6/prototype-ordinary-objects.js
@@ -23,27 +23,18 @@ var funcs = [
// https://code.google.com/p/v8/issues/detail?id=4006
// String,
- ArrayBuffer,
Boolean,
- DataView,
Float32Array,
Float64Array,
Int16Array,
Int32Array,
Int8Array,
- Map,
Number,
Object,
- Promise,
- // Proxy,
- Set,
- Symbol,
Uint16Array,
Uint32Array,
Uint8Array,
- Uint8ClampedArray,
- WeakMap,
- WeakSet,
+ Uint8ClampedArray
];
for (var fun of funcs) {
@@ -62,3 +53,25 @@ for (var fun of funcs) {
var p = fun.prototype;
assertEquals('[object ' + fun.name + ']', Object.prototype.toString.call(p));
}
+
+
+// @@toStringTag alters the result of O.p.toString()
+// %TypedArray% [ @@toStringTag ] is an accessor which returns undefined if
arv (Not doing code reviews) 2015/04/09 13:41:22 Do we have a bug then? Float32Array etc above shou
caitp (gmail) 2015/04/09 14:10:22 They have @@toStringTag --- it's a getter which is
+// receiver is not a %TypedArray%, and thus does not appear in this list.
+var funcs = [
+ ArrayBuffer,
+ DataView,
+ Map,
+ Promise,
+ Set,
+ Symbol,
+ WeakMap,
+ WeakSet
+];
+
+for (var fun of funcs) {
+ var p = fun.prototype;
+ var name = p[Symbol.toStringTag];
+ assertEquals(name, fun.name);
+ assertEquals(`[object ${name}]`, Object.prototype.toString.call(p));
arv (Not doing code reviews) 2015/04/09 13:41:22 update line 54 for consistency?
caitp (gmail) 2015/04/09 14:10:22 Acknowledged.
+}
« no previous file with comments | « src/flag-definitions.h ('k') | test/mjsunit/function-arguments-null.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698