mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
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:
parent
547eca961f
commit
2018b51d54
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user