Add some test cases involving Symbol.iterator as a prelude to bug 918828. no_r=me, testonly.

--HG--
extra : rebase_source : 545cd0c1618b7f453c3afa2baa8eb4d860e7e6d2
extra : amend_source : 71045431741656cedad8832c7c690d4c96434b9a
This commit is contained in:
Jason Orendorff 2014-07-01 15:33:48 -05:00
parent 69f454387f
commit 67358d24ca
2 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,8 @@ if (typeof Symbol === "function") {
Symbol(),
Symbol("Symbol.iterator"),
Symbol("Symbol.iterator"), // distinct new symbol with the same description
Symbol.for("Symbol.iterator")
Symbol.for("Symbol.iterator"),
Symbol.iterator
];
// Distinct symbols are never equal to each other, even if they have the same

View File

@ -22,6 +22,11 @@ if (typeof Symbol === "function") {
assertEq(desc.enumerable, false);
assertEq(desc.writable, true);
desc = Object.getOwnPropertyDescriptor(Symbol, "iterator");
assertEq(desc.configurable, false);
assertEq(desc.enumerable, false);
assertEq(desc.writable, false);
assertEq(Symbol.for.length, 1);
assertEq(Symbol.prototype.toString.length, 0);
assertEq(Symbol.prototype.valueOf.length, 0);