diff --git a/test/form/namespace-optimization-b/_config.js b/test/form/namespace-optimization-b/_config.js new file mode 100644 index 0000000..8dd58ca --- /dev/null +++ b/test/form/namespace-optimization-b/_config.js @@ -0,0 +1,3 @@ +module.exports = { + description: 'it does static lookup optimization of internal namespaces, coping with multiple namespaces in one function' +}; diff --git a/test/form/namespace-optimization-b/_expected/amd.js b/test/form/namespace-optimization-b/_expected/amd.js new file mode 100644 index 0000000..dfdc405 --- /dev/null +++ b/test/form/namespace-optimization-b/_expected/amd.js @@ -0,0 +1,15 @@ +define(function () { 'use strict'; + + function foo() { + } + + function a() { + foo(); + foo(); + var a; + if (a.b) { + } + } + a(); + +}); diff --git a/test/form/namespace-optimization-b/_expected/cjs.js b/test/form/namespace-optimization-b/_expected/cjs.js new file mode 100644 index 0000000..dde7292 --- /dev/null +++ b/test/form/namespace-optimization-b/_expected/cjs.js @@ -0,0 +1,13 @@ +'use strict'; + +function foo() { +} + +function a() { + foo(); + foo(); + var a; + if (a.b) { + } +} +a(); \ No newline at end of file diff --git a/test/form/namespace-optimization-b/_expected/es6.js b/test/form/namespace-optimization-b/_expected/es6.js new file mode 100644 index 0000000..d424ea2 --- /dev/null +++ b/test/form/namespace-optimization-b/_expected/es6.js @@ -0,0 +1,11 @@ +function foo() { +} + +function a() { + foo(); + foo(); + var a; + if (a.b) { + } +} +a(); \ No newline at end of file diff --git a/test/form/namespace-optimization-b/_expected/iife.js b/test/form/namespace-optimization-b/_expected/iife.js new file mode 100644 index 0000000..8200fa0 --- /dev/null +++ b/test/form/namespace-optimization-b/_expected/iife.js @@ -0,0 +1,15 @@ +(function () { 'use strict'; + + function foo() { + } + + function a() { + foo(); + foo(); + var a; + if (a.b) { + } + } + a(); + +})(); \ No newline at end of file diff --git a/test/form/namespace-optimization-b/_expected/umd.js b/test/form/namespace-optimization-b/_expected/umd.js new file mode 100644 index 0000000..3fc19c3 --- /dev/null +++ b/test/form/namespace-optimization-b/_expected/umd.js @@ -0,0 +1,19 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory() : + typeof define === 'function' && define.amd ? define(factory) : + factory(); +}(this, function () { 'use strict'; + + function foo() { + } + + function a() { + foo(); + foo(); + var a; + if (a.b) { + } + } + a(); + +})); \ No newline at end of file diff --git a/test/form/namespace-optimization-b/foo.js b/test/form/namespace-optimization-b/foo.js new file mode 100644 index 0000000..20630ba --- /dev/null +++ b/test/form/namespace-optimization-b/foo.js @@ -0,0 +1,2 @@ +export function foo() { +}; diff --git a/test/form/namespace-optimization-b/main.js b/test/form/namespace-optimization-b/main.js new file mode 100644 index 0000000..041ecb1 --- /dev/null +++ b/test/form/namespace-optimization-b/main.js @@ -0,0 +1,10 @@ +import * as foo from './foo'; + +function a() { + foo.foo(); + foo.foo(); + var a; + if (a.b) { + } +} +a(); \ No newline at end of file