Browse Source

more tests for #37

contingency-plan
Rich-Harris 10 years ago
parent
commit
cdc721cc71
  1. 6
      test/form/exclude-unnecessary-modifications/_expected/amd.js
  2. 6
      test/form/exclude-unnecessary-modifications/_expected/cjs.js
  3. 6
      test/form/exclude-unnecessary-modifications/_expected/es6.js
  4. 6
      test/form/exclude-unnecessary-modifications/_expected/iife.js
  5. 6
      test/form/exclude-unnecessary-modifications/_expected/umd.js
  6. 24
      test/form/exclude-unnecessary-modifications/foo.js

6
test/form/exclude-unnecessary-modifications/_expected/amd.js

@ -7,7 +7,11 @@ define(function () { 'use strict';
// should be included
[ 'a', 'b', 'c' ].forEach( function ( letter, i ) {
foo[ letter ] = i;
})
});
[ 'd', 'e', 'f' ].forEach( ( letter, i ) => {
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;

6
test/form/exclude-unnecessary-modifications/_expected/cjs.js

@ -7,7 +7,11 @@ mutate1( foo );
// should be included
[ 'a', 'b', 'c' ].forEach( function ( letter, i ) {
foo[ letter ] = i;
})
});
[ 'd', 'e', 'f' ].forEach( ( letter, i ) => {
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;

6
test/form/exclude-unnecessary-modifications/_expected/es6.js

@ -5,7 +5,11 @@ mutate1( foo );
// should be included
[ 'a', 'b', 'c' ].forEach( function ( letter, i ) {
foo[ letter ] = i;
})
});
[ 'd', 'e', 'f' ].forEach( ( letter, i ) => {
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;

6
test/form/exclude-unnecessary-modifications/_expected/iife.js

@ -7,7 +7,11 @@
// should be included
[ 'a', 'b', 'c' ].forEach( function ( letter, i ) {
foo[ letter ] = i;
})
});
[ 'd', 'e', 'f' ].forEach( ( letter, i ) => {
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;

6
test/form/exclude-unnecessary-modifications/_expected/umd.js

@ -11,7 +11,11 @@
// should be included
[ 'a', 'b', 'c' ].forEach( function ( letter, i ) {
foo[ letter ] = i;
})
});
[ 'd', 'e', 'f' ].forEach( ( letter, i ) => {
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;

24
test/form/exclude-unnecessary-modifications/foo.js

@ -5,7 +5,11 @@ mutate1( foo );
// should be included
[ 'a', 'b', 'c' ].forEach( function ( letter, i ) {
foo[ letter ] = i;
})
});
[ 'd', 'e', 'f' ].forEach( ( letter, i ) => {
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;
@ -24,4 +28,22 @@ function unused2 () {
mutate1( foo );
}
var obj1 = {
mutate3 () { foo.mutated = 3; }
};
var obj2 = {
mutate4: function () { foo.mutated = 4; }
};
var obj3 = {
mutate5: () => foo.mutated = 5
};
class Mutator {
mutate6 () {
foo.mutated = 6;
}
}
export default foo;

Loading…
Cancel
Save