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

--HG--
extra : rebase_source : 1bd8721f904456a7805d75e6e6b91c6cdf9eabb1
This commit is contained in:
Jason Orendorff 2014-07-01 15:33:48 -05:00
parent 547eca961f
commit 2018b51d54
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);