Browse Source

failing test for #1187

gh-1187
Rich-Harris 8 years ago
parent
commit
a70db5faff
  1. 3
      test/form/unused-declarations-in-function/_config.js
  2. 9
      test/form/unused-declarations-in-function/_expected/amd.js
  3. 7
      test/form/unused-declarations-in-function/_expected/cjs.js
  4. 5
      test/form/unused-declarations-in-function/_expected/es.js
  5. 10
      test/form/unused-declarations-in-function/_expected/iife.js
  6. 13
      test/form/unused-declarations-in-function/_expected/umd.js
  7. 18
      test/form/unused-declarations-in-function/main.js

3
test/form/unused-declarations-in-function/_config.js

@ -0,0 +1,3 @@
module.exports = {
description: 'removes unused declarations and statements inside function (#1187)'
};

9
test/form/unused-declarations-in-function/_expected/amd.js

@ -0,0 +1,9 @@
define(function () { 'use strict';
function foo() {
console.log("foo");
}
foo();
});

7
test/form/unused-declarations-in-function/_expected/cjs.js

@ -0,0 +1,7 @@
'use strict';
function foo() {
console.log("foo");
}
foo();

5
test/form/unused-declarations-in-function/_expected/es.js

@ -0,0 +1,5 @@
function foo() {
console.log("foo");
}
foo();

10
test/form/unused-declarations-in-function/_expected/iife.js

@ -0,0 +1,10 @@
(function () {
'use strict';
function foo() {
console.log("foo");
}
foo();
}());

13
test/form/unused-declarations-in-function/_expected/umd.js

@ -0,0 +1,13 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';
function foo() {
console.log("foo");
}
foo();
})));

18
test/form/unused-declarations-in-function/main.js

@ -0,0 +1,18 @@
(function UnusedFunctionExpression() {});
(class UnusedClassExpression {});
var UnusedClassExpression = class UnusedClassExpression {};
var unusedVar;
let unusedLet;
const unusedConst = 1;
function foo() {
(function UnusedFunctionExpression() {});
(class UnusedClassExpression {});
var UnusedClassExpression = class UnusedClassExpression {};
var unusedVar;
let unusedLet;
const unusedConst = 1;
console.log("foo");
}
foo();
Loading…
Cancel
Save