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

Unified Diff: test/mjsunit/harmony/typedarrays.js

Issue 664333003: Add remaining @@toStringTag symbols to builtins (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make heap-snapshot-generator not explode Created 6 years, 2 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 | « test/mjsunit/es6/string-iterator.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/typedarrays.js
diff --git a/test/mjsunit/harmony/typedarrays.js b/test/mjsunit/harmony/typedarrays.js
index 537fba326c2b43f2c7b6ab3879474d069ec7664d..a4d6e7927a2b257dc7fcec23757a4e2ac5c6d9db 100644
--- a/test/mjsunit/harmony/typedarrays.js
+++ b/test/mjsunit/harmony/typedarrays.js
@@ -265,6 +265,17 @@ function TestTypedArray(constr, elementSize, typicalElement) {
assertSame(0, aNoParam.length);
assertSame(0, aNoParam.byteLength);
assertSame(0, aNoParam.byteOffset);
+
+ var a = new constr(ab, 64*elementSize, 128);
+ assertEquals("[object " + constr.name + "]",
+ Object.prototype.toString.call(a));
+ var desc = Object.getOwnPropertyDescriptor(
+ constr.prototype, Symbol.toStringTag);
+ assertTrue(desc.configurable);
+ assertFalse(desc.enumerable);
+ assertFalse(!!desc.writable);
+ assertFalse(!!desc.set);
+ assertEquals("function", typeof desc.get);
}
TestTypedArray(Uint8Array, 1, 0xFF);
@@ -654,6 +665,19 @@ function TestDataViewPropertyTypeChecks() {
TestDataViewPropertyTypeChecks();
+
+function TestDataViewToStringTag() {
+ var a = new DataView(new ArrayBuffer(10));
+ assertEquals("[object DataView]", Object.prototype.toString.call(a));
+ var desc = Object.getOwnPropertyDescriptor(
+ DataView.prototype, Symbol.toStringTag);
+ assertTrue(desc.configurable);
+ assertFalse(desc.enumerable);
+ assertFalse(desc.writable);
+ assertEquals("DataView", desc.value);
+}
+
+
// General tests for properties
// Test property attribute [[Enumerable]]
« no previous file with comments | « test/mjsunit/es6/string-iterator.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698