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