minor lints (#5761)
This commit is contained in:
@@ -11179,7 +11179,7 @@ Compressor.prototype.compress = function(node) {
|
||||
function append_var(decls, expressions, name, value) {
|
||||
var def = name.definition();
|
||||
if (!scope.var_names().has(name.name)) {
|
||||
if (def.first_decl === name) def.first_decl = null;
|
||||
def.first_decl = null;
|
||||
scope.var_names().set(name.name, true);
|
||||
decls.push(make_node(AST_VarDef, name, {
|
||||
name: name,
|
||||
|
||||
@@ -125,6 +125,7 @@ log_nested: {
|
||||
|
||||
timers: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
reduce_vars: true,
|
||||
toplevel: true,
|
||||
unused: true,
|
||||
@@ -132,26 +133,22 @@ timers: {
|
||||
input: {
|
||||
var count = 0, interval = 1000, duration = 3210;
|
||||
var timer = setInterval(function() {
|
||||
console.log(++count);
|
||||
}, interval);
|
||||
setTimeout(function() {
|
||||
if (!count++) setTimeout(function() {
|
||||
clearInterval(timer);
|
||||
console.log(count <= 4 ? "PASS" : "FAIL");
|
||||
}, duration);
|
||||
}, interval);
|
||||
}
|
||||
expect: {
|
||||
var count = 0;
|
||||
var timer = setInterval(function() {
|
||||
console.log(++count);
|
||||
}, 1000);
|
||||
setTimeout(function() {
|
||||
if (!count++) setTimeout(function() {
|
||||
clearInterval(timer);
|
||||
console.log(count <= 4 ? "PASS" : "FAIL");
|
||||
}, 3210);
|
||||
}, 1000);
|
||||
}
|
||||
expect_stdout: [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
]
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=0.12"
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ exports.run_code = semver.satisfies(process.version, "0.8") ? function(code, top
|
||||
].some(function(pattern) {
|
||||
return pattern.test(code);
|
||||
}) ? run_code_exec : run_code_vm)(code, toplevel, timeout);
|
||||
return stdout.length > 1000 ? stdout.slice(0, 1000) + "…《" + stdout.length + "》" : stdout;
|
||||
var len = typeof stdout == "string" && stdout.length;
|
||||
return len > 1000 ? stdout.slice(0, 1000) + "…《" + len + "》" : stdout;
|
||||
};
|
||||
exports.same_stdout = semver.satisfies(process.version, "0.12") ? function(expected, actual) {
|
||||
if (typeof expected != typeof actual) return false;
|
||||
|
||||
Reference in New Issue
Block a user