mirror of
https://github.com/tc39/test262.git
synced 2025-05-03 14:30:27 +02:00
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
80 lines
1.4 KiB
JavaScript
80 lines
1.4 KiB
JavaScript
(function () {
|
|
"use strict";
|
|
|
|
function verify() {
|
|
for (var i = 0; i < counter; ++i) {
|
|
if (results[i] != i)
|
|
throw "strict mode verify() failed for item " + i + "."
|
|
}
|
|
}
|
|
|
|
let results = [ ];
|
|
let counter = 0;
|
|
|
|
let x = counter++;
|
|
results.push(eval("x"));
|
|
|
|
{
|
|
let x = counter++;
|
|
results.push(eval("x"));
|
|
}
|
|
|
|
try {
|
|
throw counter++;
|
|
} catch (x) {
|
|
results.push(eval("x"));
|
|
}
|
|
|
|
(() => {
|
|
var x = counter++;
|
|
results.push(eval("x"));
|
|
})();
|
|
|
|
(function (x) {
|
|
results.push(eval("x"));
|
|
})(counter++);
|
|
|
|
verify();
|
|
})();
|
|
|
|
(function () {
|
|
function verify() {
|
|
for (var i = 0; i < counter; ++i) {
|
|
if (results[i] != i)
|
|
throw "non-strict mode verify() failed for item " + i + "."
|
|
}
|
|
}
|
|
|
|
let results = [ ];
|
|
let counter = 0;
|
|
|
|
let x = counter++;
|
|
results.push(eval("x"));
|
|
|
|
{
|
|
let x = counter++;
|
|
results.push(eval("x"));
|
|
}
|
|
|
|
try {
|
|
throw counter++;
|
|
} catch (x) {
|
|
results.push(eval("x"));
|
|
}
|
|
|
|
(() => {
|
|
var x = counter++;
|
|
results.push(eval("x"));
|
|
})();
|
|
|
|
(function (x) {
|
|
results.push(eval("x"));
|
|
})(counter++);
|
|
|
|
with ({ x : counter++ }) {
|
|
results.push(eval("x"));
|
|
}
|
|
|
|
verify();
|
|
})();
|