mirror of https://github.com/lukechilds/rollup.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
492 B
29 lines
492 B
8 years ago
|
function x () {
|
||
|
return new Promise( ( resolve, reject ) => {
|
||
|
console.log( 'this is a side-effect' );
|
||
|
resolve();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
x();
|
||
|
|
||
|
function promiseCallback ( resolve, reject ) {
|
||
|
console.log( 'this is a side-effect' );
|
||
|
resolve();
|
||
|
}
|
||
|
|
||
|
function y () {
|
||
|
return new Promise( promiseCallback );
|
||
|
}
|
||
|
|
||
|
y();
|
||
|
|
||
|
function z ( x ) {
|
||
|
// this function has no side-effects, so should be excluded...
|
||
|
}
|
||
|
|
||
|
let a = 1;
|
||
|
z( a += 1 ); // ...unless the call expression statement has its own side-effects
|
||
|
|
||
|
export { a };
|