Browse Source

another test for #37

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

3
test/form/exclude-unnecessary-modifications/_config.js

@ -1,3 +1,4 @@
module.exports = {
description: 'statements that modify definitions within unused functions are excluded'
description: 'statements that modify definitions within unused functions are excluded',
solo: true
};

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

@ -13,10 +13,16 @@ define(function () { 'use strict';
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;
function mutate1 () {
foo.mutated = 1;
}
({
mutate2: function () {
foo.mutated = 2;
}
}).mutate2();
console.log( foo );
});

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

@ -13,8 +13,14 @@ mutate1( foo );
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;
function mutate1 () {
foo.mutated = 1;
}
({
mutate2: function () {
foo.mutated = 2;
}
}).mutate2();
console.log( foo );

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

@ -11,8 +11,14 @@ mutate1( foo );
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;
function mutate1 () {
foo.mutated = 1;
}
({
mutate2: function () {
foo.mutated = 2;
}
}).mutate2();
console.log( foo );

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

@ -13,10 +13,16 @@
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;
function mutate1 () {
foo.mutated = 1;
}
({
mutate2: function () {
foo.mutated = 2;
}
}).mutate2();
console.log( foo );
})();

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

@ -17,10 +17,16 @@
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;
function mutate1 () {
foo.mutated = 1;
}
({
mutate2: function () {
foo.mutated = 2;
}
}).mutate2();
console.log( foo );
}));

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

@ -11,10 +11,16 @@ mutate1( foo );
foo[ letter ] = i;
});
function mutate1 ( obj ) {
obj.mutated = 1;
function mutate1 () {
foo.mutated = 1;
}
({
mutate2: function () {
foo.mutated = 2;
}
}).mutate2();
// should be excluded
var mutate2 = function () {
foo.mutated = 2;

Loading…
Cancel
Save