2020-04-21 19:21:26 +01:00
|
|
|
load("test-common.js");
|
|
|
|
|
|
|
|
|
|
try {
|
2020-07-05 09:27:00 -07:00
|
|
|
assertVisitsAll(visit => {
|
|
|
|
|
for (const property in "") {
|
|
|
|
|
visit(property);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
2020-04-21 19:21:26 +01:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
assertVisitsAll(visit => {
|
|
|
|
|
for (const property in 123) {
|
|
|
|
|
visit(property);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
2020-04-21 19:21:26 +01:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
assertVisitsAll(visit => {
|
|
|
|
|
for (const property in {}) {
|
|
|
|
|
visit(property);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
2020-04-21 19:21:26 +01:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
assertVisitsAll(
|
|
|
|
|
visit => {
|
|
|
|
|
for (const property in "hello") {
|
|
|
|
|
visit(property);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
["0", "1", "2", "3", "4"]
|
|
|
|
|
);
|
2020-04-21 19:21:26 +01:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
assertVisitsAll(
|
|
|
|
|
visit => {
|
|
|
|
|
for (const property in { a: 1, b: 2, c: 2 }) {
|
|
|
|
|
visit(property);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
["a", "b", "c"]
|
|
|
|
|
);
|
2020-04-21 19:21:26 +01:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
var property;
|
|
|
|
|
for (property in "abc");
|
|
|
|
|
assert(property === "2");
|
2020-04-21 19:21:26 +01:00
|
|
|
|
2020-07-05 09:27:00 -07:00
|
|
|
console.log("PASS");
|
2020-04-21 19:21:26 +01:00
|
|
|
} catch (e) {
|
2020-07-05 09:27:00 -07:00
|
|
|
console.log("FAIL: " + e);
|
2020-04-21 19:21:26 +01:00
|
|
|
}
|