Browse Source

add test for #901

rewrite
Rich Harris 8 years ago
parent
commit
9ded29e9ec
  1. 3
      test/form/side-effect-p/_config.js
  2. 11
      test/form/side-effect-p/_expected/amd.js
  3. 9
      test/form/side-effect-p/_expected/cjs.js
  4. 7
      test/form/side-effect-p/_expected/es.js
  5. 12
      test/form/side-effect-p/_expected/iife.js
  6. 15
      test/form/side-effect-p/_expected/umd.js
  7. 1
      test/form/side-effect-p/bool.js
  8. 7
      test/form/side-effect-p/main.js

3
test/form/side-effect-p/_config.js

@ -0,0 +1,3 @@
module.exports = {
description: 'detects mutation of globals'
};

11
test/form/side-effect-p/_expected/amd.js

@ -0,0 +1,11 @@
define(function () { 'use strict';
var bool = true;
const hs = document.documentElement.style;
if ( bool ) {
hs.color = "#222"
}
});

9
test/form/side-effect-p/_expected/cjs.js

@ -0,0 +1,9 @@
'use strict';
var bool = true;
const hs = document.documentElement.style;
if ( bool ) {
hs.color = "#222"
}

7
test/form/side-effect-p/_expected/es.js

@ -0,0 +1,7 @@
var bool = true;
const hs = document.documentElement.style;
if ( bool ) {
hs.color = "#222"
}

12
test/form/side-effect-p/_expected/iife.js

@ -0,0 +1,12 @@
(function () {
'use strict';
var bool = true;
const hs = document.documentElement.style;
if ( bool ) {
hs.color = "#222"
}
}());

15
test/form/side-effect-p/_expected/umd.js

@ -0,0 +1,15 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';
var bool = true;
const hs = document.documentElement.style;
if ( bool ) {
hs.color = "#222"
}
})));

1
test/form/side-effect-p/bool.js

@ -0,0 +1 @@
export default true;

7
test/form/side-effect-p/main.js

@ -0,0 +1,7 @@
import bool from './bool';
const hs = document.documentElement.style;
if ( bool ) {
hs.color = "#222"
}
Loading…
Cancel
Save