Browse Source

failing test for #397

gh-438-b
Rich-Harris 9 years ago
parent
commit
cbf6bd6ffb
  1. 4
      test/form/side-effect-m/_config.js
  2. 21
      test/form/side-effect-m/_expected/amd.js
  3. 19
      test/form/side-effect-m/_expected/cjs.js
  4. 17
      test/form/side-effect-m/_expected/es6.js
  5. 21
      test/form/side-effect-m/_expected/iife.js
  6. 25
      test/form/side-effect-m/_expected/umd.js
  7. 11
      test/form/side-effect-m/even.js
  8. 5
      test/form/side-effect-m/main.js
  9. 5
      test/form/side-effect-m/odd.js

4
test/form/side-effect-m/_config.js

@ -0,0 +1,4 @@
module.exports = {
solo: true,
description: 'detects side-effects with cyclical dependencies'
};

21
test/form/side-effect-m/_expected/amd.js

@ -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 );
});

19
test/form/side-effect-m/_expected/cjs.js

@ -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 );

17
test/form/side-effect-m/_expected/es6.js

@ -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 );

21
test/form/side-effect-m/_expected/iife.js

@ -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 );
})();

25
test/form/side-effect-m/_expected/umd.js

@ -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 );
}));

11
test/form/side-effect-m/even.js

@ -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 );
}

5
test/form/side-effect-m/main.js

@ -0,0 +1,5 @@
import { counter, even } from './even.js';
console.log( even( 5 ) );
console.log( counter );

5
test/form/side-effect-m/odd.js

@ -0,0 +1,5 @@
import { even } from './even.js';
export function odd ( n ) {
return n !== 0 && even( n - 1 );
}
Loading…
Cancel
Save