mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
9 years ago
5 changed files with 29 additions and 1 deletions
@ -0,0 +1,3 @@ |
|||
module.exports = { |
|||
description: 'detects side-effects in complex call expressions' |
|||
}; |
@ -0,0 +1,9 @@ |
|||
function foo () { |
|||
console.log( 'foo' ); |
|||
} |
|||
|
|||
function bar () { |
|||
console.log( 'bar' ); |
|||
} |
|||
|
|||
( Math.random() < 0.5 ? foo : bar )(); |
@ -0,0 +1,3 @@ |
|||
module.exports = { |
|||
description: 'detects side-effects in complex call expressions' |
|||
}; |
@ -0,0 +1,13 @@ |
|||
function fn () { |
|||
return Math.random() < 0.5 ? foo : bar; |
|||
} |
|||
|
|||
function foo () { |
|||
console.log( 'foo' ); |
|||
} |
|||
|
|||
function bar () { |
|||
console.log( 'bar' ); |
|||
} |
|||
|
|||
fn()(); |
Loading…
Reference in new issue