Browse Source

test side-effecty function inside block

gh-109
Rich-Harris 9 years ago
parent
commit
2c1774fc7f
  1. 1
      test/function/globally-called-modifying-function/_config.js
  2. 2
      test/function/globally-called-modifying-function/main.js
  3. 12
      test/function/globally-called-modifying-function/module.js

1
test/function/globally-called-modifying-function/_config.js

@ -1,4 +1,3 @@
module.exports = {
// solo: true, show: true,
description: 'globally called function should be included if it modifies an exported value (#112)'
};

2
test/function/globally-called-modifying-function/main.js

@ -1,3 +1,3 @@
import value from './module.js';
assert.equal( value, 'changed' );
assert.equal( value, 3 );

12
test/function/globally-called-modifying-function/module.js

@ -1,9 +1,17 @@
var value = 'original';
var value = 1;
function change () {
value = 'changed';
value = 2;
}
function changeAgain () {
value += 1;
}
change();
if ( true ) {
changeAgain();
}
export default value;

Loading…
Cancel
Save