1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
drop_console_1: {
options = {}
input: {
console.log('foo');
console.log.apply(console, arguments);
}
expect: {
console.log('foo');
console.log.apply(console, arguments);
}
}
drop_console_2: {
options = {
drop_console: true,
}
input: {
console.log('foo');
console.log.apply(console, arguments);
}
expect: {
// with regular compression these will be stripped out as well
void 0;
void 0;
}
}
unexpected_side_effects_dropping_console: {
options = {
drop_console: true,
evaluate: true,
reduce_vars: true,
side_effects: true,
unused: true,
}
input: {
function f() {
var a = 33;
console.log(a++);
alert(a);
}
}
expect: {
function f() {
alert(33);
}
}
}
unexpected_returned_value_dropping_console: {
options = {
drop_console: true,
evaluate: true,
reduce_vars: true,
side_effects: true,
unused: true,
toplevel: true,
}
input: {
const b = {
log: console.log.bind(console),
};
b.log("hi");
}
expect: {
const b={
log: function(){}.bind(),
};
b.log("hi");
}
}
drop_console_with_array_option: {
options = {
drop_console: ["log"],
}
input: {
console.log("foo");
console.log.apply(console, arguments);
console.info("foo");
}
expect: {
void 0;
void 0;
console.info("foo");
}
}
|