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

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

Issue 208423013: Spec adjustments for well-known symbols (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comment Created 6 years, 9 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/symbol.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/symbols.js
diff --git a/test/mjsunit/harmony/symbols.js b/test/mjsunit/harmony/symbols.js
index d19aece5b17202f6bd1b9e841561f5691c56fc86..e7bf36040621d5541378614d2d5e657b1b2ea463 100644
--- a/test/mjsunit/harmony/symbols.js
+++ b/test/mjsunit/harmony/symbols.js
@@ -410,12 +410,29 @@ function TestGetOwnPropertySymbolsWithProto() {
TestGetOwnPropertySymbolsWithProto()
-function TestRegistry() {
- assertFalse(Symbol.for("@@create") === Symbol.create)
- assertFalse(Symbol.for("@@iterator") === Symbol.iterator)
- assertTrue(Symbol.keyFor(Symbol.create) === undefined)
- assertTrue(Symbol.keyFor(Symbol.iterator) === undefined)
+function TestWellKnown() {
+ var symbols = [
+ "create", "hasInstance", "isConcatSpreadable", "isRegExp",
+ "iterator", "toStringTag", "unscopables"
+ ]
+ for (var i in symbols) {
+ var name = symbols[i]
+ var desc = Object.getOwnPropertyDescriptor(Symbol, name)
+ assertSame("symbol", typeof desc.value)
+ assertSame("Symbol(Symbol." + name + ")", desc.value.toString())
+ assertFalse(desc.writable)
+ assertFalse(desc.configurable)
+ assertFalse(desc.enumerable)
+
+ assertFalse(Symbol.for("Symbol." + name) === desc.value)
+ assertTrue(Symbol.keyFor(desc.value) === undefined)
+ }
+}
+TestWellKnown()
+
+
+function TestRegistry() {
var symbol1 = Symbol.for("x1")
var symbol2 = Symbol.for("x2")
assertFalse(symbol1 === symbol2)
« no previous file with comments | « src/symbol.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698