mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
9 years ago
9 changed files with 128 additions and 0 deletions
@ -0,0 +1,4 @@ |
|||
module.exports = { |
|||
solo: true, |
|||
description: 'detects side-effects with cyclical dependencies' |
|||
}; |
@ -0,0 +1,21 @@ |
|||
define(function () { 'use strict'; |
|||
|
|||
function odd ( n ) { |
|||
return n !== 0 && even( n - 1 ); |
|||
} |
|||
|
|||
var counter = 0; |
|||
|
|||
// This should be in the output
|
|||
export var foo = odd( 12 ); |
|||
|
|||
function even ( n ) { |
|||
alert( counter++ ) |
|||
return n === 0 || odd( n - 1 ); |
|||
} |
|||
|
|||
console.log( even( 5 ) ); |
|||
|
|||
console.log( counter ); |
|||
|
|||
}); |
@ -0,0 +1,19 @@ |
|||
'use strict'; |
|||
|
|||
function odd ( n ) { |
|||
return n !== 0 && even( n - 1 ); |
|||
} |
|||
|
|||
var counter = 0; |
|||
|
|||
// This should be in the output
|
|||
export var foo = odd( 12 ); |
|||
|
|||
function even ( n ) { |
|||
alert( counter++ ) |
|||
return n === 0 || odd( n - 1 ); |
|||
} |
|||
|
|||
console.log( even( 5 ) ); |
|||
|
|||
console.log( counter ); |
@ -0,0 +1,17 @@ |
|||
function odd ( n ) { |
|||
return n !== 0 && even( n - 1 ); |
|||
} |
|||
|
|||
var counter = 0; |
|||
|
|||
// This should be in the output
|
|||
export var foo = odd( 12 ); |
|||
|
|||
function even ( n ) { |
|||
alert( counter++ ) |
|||
return n === 0 || odd( n - 1 ); |
|||
} |
|||
|
|||
console.log( even( 5 ) ); |
|||
|
|||
console.log( counter ); |
@ -0,0 +1,21 @@ |
|||
(function () { 'use strict'; |
|||
|
|||
function odd ( n ) { |
|||
return n !== 0 && even( n - 1 ); |
|||
} |
|||
|
|||
var counter = 0; |
|||
|
|||
// This should be in the output
|
|||
export var foo = odd( 12 ); |
|||
|
|||
function even ( n ) { |
|||
alert( counter++ ) |
|||
return n === 0 || odd( n - 1 ); |
|||
} |
|||
|
|||
console.log( even( 5 ) ); |
|||
|
|||
console.log( counter ); |
|||
|
|||
})(); |
@ -0,0 +1,25 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory() : |
|||
typeof define === 'function' && define.amd ? define(factory) : |
|||
(factory()); |
|||
}(this, function () { 'use strict'; |
|||
|
|||
function odd ( n ) { |
|||
return n !== 0 && even( n - 1 ); |
|||
} |
|||
|
|||
var counter = 0; |
|||
|
|||
// This should be in the output
|
|||
export var foo = odd( 12 ); |
|||
|
|||
function even ( n ) { |
|||
alert( counter++ ) |
|||
return n === 0 || odd( n - 1 ); |
|||
} |
|||
|
|||
console.log( even( 5 ) ); |
|||
|
|||
console.log( counter ); |
|||
|
|||
})); |
@ -0,0 +1,11 @@ |
|||
import { odd } from './odd.js' |
|||
|
|||
export var counter = 0; |
|||
|
|||
// This should be in the output
|
|||
export var foo = odd( 12 ); |
|||
|
|||
export function even ( n ) { |
|||
alert( counter++ ) |
|||
return n === 0 || odd( n - 1 ); |
|||
} |
@ -0,0 +1,5 @@ |
|||
import { counter, even } from './even.js'; |
|||
|
|||
console.log( even( 5 ) ); |
|||
|
|||
console.log( counter ); |
@ -0,0 +1,5 @@ |
|||
import { even } from './even.js'; |
|||
|
|||
export function odd ( n ) { |
|||
return n !== 0 && even( n - 1 ); |
|||
} |
Loading…
Reference in new issue