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.
|
+} |