From 318481f2f027ee44f2e9fec4bb41bcb056d4af38 Mon Sep 17 00:00:00 2001 From: mnater Date: Mon, 4 Jan 2016 10:39:07 +0100 Subject: [PATCH] Style iife Style iife Style iife Style iife Style iife del log Delete npm-debug.log --- src/finalisers/iife.js | 9 +++++---- test/cli/banner-intro-outro-footer/_expected.js | 5 +++-- test/form/banner-and-footer-plugin/_expected/iife.js | 5 +++-- test/form/banner-and-footer/_expected/iife.js | 5 +++-- test/form/block-comments/_expected/iife.js | 5 +++-- test/form/dedupes-external-imports/_expected/iife.js | 5 +++-- .../exclude-unnecessary-modifications/_expected/iife.js | 5 +++-- test/form/export-all-from-internal/_expected/iife.js | 5 +++-- test/form/export-default-2/_expected/iife.js | 5 +++-- test/form/export-default-3/_expected/iife.js | 5 +++-- test/form/export-default/_expected/iife.js | 5 +++-- test/form/export-multiple-vars/_expected/iife.js | 5 +++-- test/form/exports-at-end-if-possible/_expected/iife.js | 5 +++-- .../_expected/iife.js | 5 +++-- .../form/external-imports-custom-names/_expected/iife.js | 5 +++-- test/form/external-imports/_expected/iife.js | 5 +++-- test/form/indent-false/_expected/iife.js | 5 +++-- test/form/indent-true-spaces/_expected/iife.js | 5 +++-- test/form/indent-true/_expected/iife.js | 5 +++-- test/form/internal-conflict-resolution/_expected/iife.js | 5 +++-- test/form/intro-and-outro/_expected/iife.js | 5 +++-- test/form/multiple-exports/_expected/iife.js | 5 +++-- test/form/namespace-optimization-b/_expected/iife.js | 5 +++-- test/form/namespace-optimization/_expected/iife.js | 5 +++-- test/form/namespaced-default-exports/_expected/iife.js | 5 +++-- test/form/namespaced-named-exports/_expected/iife.js | 5 +++-- test/form/no-imports-or-exports/_expected/iife.js | 5 +++-- .../_expected/iife.js | 5 +++-- .../preserves-comments-after-imports/_expected/iife.js | 5 +++-- .../_expected/iife.js | 5 +++-- test/form/self-contained-bundle/_expected/iife.js | 5 +++-- test/form/shorthand-properties/_expected/iife.js | 5 +++-- test/form/side-effect-b/_expected/iife.js | 5 +++-- test/form/side-effect-c/_expected/iife.js | 5 +++-- test/form/side-effect-d/_expected/iife.js | 5 +++-- test/form/side-effect-e/_expected/iife.js | 5 +++-- test/form/side-effect-f/_expected/iife.js | 5 +++-- test/form/side-effect-g/_expected/iife.js | 5 +++-- test/form/side-effect-h/_expected/iife.js | 5 +++-- test/form/side-effect-i/_expected/iife.js | 5 +++-- test/form/side-effect-j/_expected/iife.js | 5 +++-- test/form/side-effect-k/_expected/iife.js | 5 +++-- test/form/side-effect-l/_expected/iife.js | 5 +++-- test/form/side-effect-m/_expected/iife.js | 5 +++-- test/form/side-effect/_expected/iife.js | 5 +++-- test/form/sourcemaps-inline/_expected/iife.js | 7 ++++--- test/form/sourcemaps/_expected/iife.js | 5 +++-- test/form/sourcemaps/_expected/iife.js.map | 2 +- .../_expected/iife.js | 5 +++-- test/form/string-indentation-b/_expected/iife.js | 5 +++-- test/form/string-indentation/_expected/iife.js | 5 +++-- .../_expected/iife.js | 5 +++-- test/form/unmodified-default-exports/_expected/iife.js | 5 +++-- test/form/unused-default-exports/_expected/iife.js | 5 +++-- 54 files changed, 163 insertions(+), 110 deletions(-) diff --git a/src/finalisers/iife.js b/src/finalisers/iife.js index 6e11ef5..95c6d65 100644 --- a/src/finalisers/iife.js +++ b/src/finalisers/iife.js @@ -35,9 +35,10 @@ export default function iife ( bundle, magicString, { exportMode, indentString } args.unshift( 'exports' ); } - const useStrict = options.useStrict !== false ? ` 'use strict';` : ``; - let intro = `(function (${args}) {${useStrict}\n\n`; - let outro = `\n\n})(${dependencies});`; + const useStrict = options.useStrict !== false ? `'use strict';` : ``; + + let intro = `(function (${args}) {\n`; + let outro = `\n\n}(${dependencies}));`; if ( exportMode === 'default' ) { intro = ( isNamespaced ? `this.` : `var ` ) + `${name} = ${intro}`; @@ -50,7 +51,7 @@ export default function iife ( bundle, magicString, { exportMode, indentString } // var foo__default = 'default' in foo ? foo['default'] : foo; const interopBlock = getInteropBlock( bundle ); if ( interopBlock ) magicString.prepend( interopBlock + '\n\n' ); - + if ( useStrict ) magicString.prepend( useStrict + '\n\n' ); const exportBlock = getExportBlock( bundle.entryModule, exportMode ); if ( exportBlock ) magicString.append( '\n\n' + exportBlock ); diff --git a/test/cli/banner-intro-outro-footer/_expected.js b/test/cli/banner-intro-outro-footer/_expected.js index ee1aeb3..521af55 100644 --- a/test/cli/banner-intro-outro-footer/_expected.js +++ b/test/cli/banner-intro-outro-footer/_expected.js @@ -1,9 +1,10 @@ // banner -(function () { 'use strict'; +(function () { + 'use strict'; // intro console.log( 42 ); // outro -})(); +}()); // footer diff --git a/test/form/banner-and-footer-plugin/_expected/iife.js b/test/form/banner-and-footer-plugin/_expected/iife.js index 03dc18b..36a9599 100644 --- a/test/form/banner-and-footer-plugin/_expected/iife.js +++ b/test/form/banner-and-footer-plugin/_expected/iife.js @@ -1,9 +1,10 @@ /* first banner */ /* second banner */ -(function () { 'use strict'; +(function () { + 'use strict'; console.log( 1 + 1 ); -})(); +}()); /* first footer */ /* second footer */ diff --git a/test/form/banner-and-footer/_expected/iife.js b/test/form/banner-and-footer/_expected/iife.js index 8135f24..37662b5 100644 --- a/test/form/banner-and-footer/_expected/iife.js +++ b/test/form/banner-and-footer/_expected/iife.js @@ -1,7 +1,8 @@ /* this is a banner */ -(function () { 'use strict'; +(function () { + 'use strict'; console.log( 'hello world' ); -})(); +}()); /* this is a footer */ diff --git a/test/form/block-comments/_expected/iife.js b/test/form/block-comments/_expected/iife.js index 41a0980..f8fbf52 100644 --- a/test/form/block-comments/_expected/iife.js +++ b/test/form/block-comments/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function foo () { return embiggen( 6, 7 ); @@ -16,4 +17,4 @@ alert( foo() ); -})(); +}()); diff --git a/test/form/dedupes-external-imports/_expected/iife.js b/test/form/dedupes-external-imports/_expected/iife.js index 6e465c7..17ed0b7 100644 --- a/test/form/dedupes-external-imports/_expected/iife.js +++ b/test/form/dedupes-external-imports/_expected/iife.js @@ -1,4 +1,5 @@ -(function (exports,external) { 'use strict'; +(function (exports,external) { + 'use strict'; class Foo extends external.Component { constructor () { @@ -29,4 +30,4 @@ exports.bar = bar; exports.baz = baz; -})((this.myBundle = {}),external); +}((this.myBundle = {}),external)); diff --git a/test/form/exclude-unnecessary-modifications/_expected/iife.js b/test/form/exclude-unnecessary-modifications/_expected/iife.js index 0fd4c40..9a3501b 100644 --- a/test/form/exclude-unnecessary-modifications/_expected/iife.js +++ b/test/form/exclude-unnecessary-modifications/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; var foo = {}; @@ -25,4 +26,4 @@ console.log( foo ); -})(); +}()); diff --git a/test/form/export-all-from-internal/_expected/iife.js b/test/form/export-all-from-internal/_expected/iife.js index 238e208..b5dad56 100644 --- a/test/form/export-all-from-internal/_expected/iife.js +++ b/test/form/export-all-from-internal/_expected/iife.js @@ -1,4 +1,5 @@ -(function (exports) { 'use strict'; +(function (exports) { + 'use strict'; const a = 1; const b = 2; @@ -6,4 +7,4 @@ exports.a = a; exports.b = b; -})((this.exposedInternals = {})); +}((this.exposedInternals = {}))); diff --git a/test/form/export-default-2/_expected/iife.js b/test/form/export-default-2/_expected/iife.js index c580759..240a5fe 100644 --- a/test/form/export-default-2/_expected/iife.js +++ b/test/form/export-default-2/_expected/iife.js @@ -1,7 +1,8 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var bar = 1; return bar; -})(); +}()); diff --git a/test/form/export-default-3/_expected/iife.js b/test/form/export-default-3/_expected/iife.js index c580759..240a5fe 100644 --- a/test/form/export-default-3/_expected/iife.js +++ b/test/form/export-default-3/_expected/iife.js @@ -1,7 +1,8 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var bar = 1; return bar; -})(); +}()); diff --git a/test/form/export-default/_expected/iife.js b/test/form/export-default/_expected/iife.js index b7b15ee..69d1387 100644 --- a/test/form/export-default/_expected/iife.js +++ b/test/form/export-default/_expected/iife.js @@ -1,7 +1,8 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var main = 42; return main; -})(); +}()); diff --git a/test/form/export-multiple-vars/_expected/iife.js b/test/form/export-multiple-vars/_expected/iife.js index c1c798a..2bc534b 100644 --- a/test/form/export-multiple-vars/_expected/iife.js +++ b/test/form/export-multiple-vars/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; var a = 1; @@ -10,4 +11,4 @@ assert.equal( e, 5 ); assert.equal( i, 9 ); -})(); +}()); diff --git a/test/form/exports-at-end-if-possible/_expected/iife.js b/test/form/exports-at-end-if-possible/_expected/iife.js index d1b29c8..a0ce6a9 100644 --- a/test/form/exports-at-end-if-possible/_expected/iife.js +++ b/test/form/exports-at-end-if-possible/_expected/iife.js @@ -1,4 +1,5 @@ -(function (exports) { 'use strict'; +(function (exports) { + 'use strict'; var FOO = 'foo'; @@ -8,4 +9,4 @@ exports.FOO = FOO; -})((this.myBundle = {})); +}((this.myBundle = {}))); diff --git a/test/form/external-imports-custom-names-function/_expected/iife.js b/test/form/external-imports-custom-names-function/_expected/iife.js index d8d719b..07f634a 100644 --- a/test/form/external-imports-custom-names-function/_expected/iife.js +++ b/test/form/external-imports-custom-names-function/_expected/iife.js @@ -1,5 +1,6 @@ -(function (aBC) { 'use strict'; +(function (aBC) { + 'use strict'; aBC.foo(); -})(a_b_c); \ No newline at end of file +}(a_b_c)); \ No newline at end of file diff --git a/test/form/external-imports-custom-names/_expected/iife.js b/test/form/external-imports-custom-names/_expected/iife.js index 4b34e9b..057d897 100644 --- a/test/form/external-imports-custom-names/_expected/iife.js +++ b/test/form/external-imports-custom-names/_expected/iife.js @@ -1,4 +1,5 @@ -(function ($) { 'use strict'; +(function ($) { + 'use strict'; $ = 'default' in $ ? $['default'] : $; @@ -6,4 +7,4 @@ $( 'body' ).html( '

hello world!

' ); }); -})(jQuery); +}(jQuery)); diff --git a/test/form/external-imports/_expected/iife.js b/test/form/external-imports/_expected/iife.js index d839138..2a4d5c2 100644 --- a/test/form/external-imports/_expected/iife.js +++ b/test/form/external-imports/_expected/iife.js @@ -1,4 +1,5 @@ -(function (factory,baz,containers,alphabet) { 'use strict'; +(function (factory,baz,containers,alphabet) { + 'use strict'; factory = 'default' in factory ? factory['default'] : factory; var alphabet__default = 'default' in alphabet ? alphabet['default'] : alphabet; @@ -9,4 +10,4 @@ console.log( alphabet.a ); console.log( alphabet__default.length ); -})(factory,baz,containers,alphabet); +}(factory,baz,containers,alphabet)); diff --git a/test/form/indent-false/_expected/iife.js b/test/form/indent-false/_expected/iife.js index df244ea..54ba717 100644 --- a/test/form/indent-false/_expected/iife.js +++ b/test/form/indent-false/_expected/iife.js @@ -1,4 +1,5 @@ -var foo = (function () { 'use strict'; +var foo = (function () { +'use strict'; function foo () { console.log( 'indented with tabs' ); @@ -6,4 +7,4 @@ function foo () { return foo; -})(); +}()); diff --git a/test/form/indent-true-spaces/_expected/iife.js b/test/form/indent-true-spaces/_expected/iife.js index 38cfb95..e22164f 100644 --- a/test/form/indent-true-spaces/_expected/iife.js +++ b/test/form/indent-true-spaces/_expected/iife.js @@ -1,4 +1,5 @@ -var foo = (function () { 'use strict'; +var foo = (function () { + 'use strict'; function foo () { console.log( 'indented with spaces' ); @@ -6,4 +7,4 @@ var foo = (function () { 'use strict'; return foo; -})(); +}()); diff --git a/test/form/indent-true/_expected/iife.js b/test/form/indent-true/_expected/iife.js index badad2c..14d0a76 100644 --- a/test/form/indent-true/_expected/iife.js +++ b/test/form/indent-true/_expected/iife.js @@ -1,4 +1,5 @@ -var foo = (function () { 'use strict'; +var foo = (function () { + 'use strict'; function foo () { console.log( 'indented with tabs' ); @@ -6,4 +7,4 @@ var foo = (function () { 'use strict'; return foo; -})(); +}()); diff --git a/test/form/internal-conflict-resolution/_expected/iife.js b/test/form/internal-conflict-resolution/_expected/iife.js index b32c809..6e484fd 100644 --- a/test/form/internal-conflict-resolution/_expected/iife.js +++ b/test/form/internal-conflict-resolution/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; var bar$1 = 42; @@ -12,4 +13,4 @@ bar(); -})(); +}()); diff --git a/test/form/intro-and-outro/_expected/iife.js b/test/form/intro-and-outro/_expected/iife.js index 51f9826..15a21d9 100644 --- a/test/form/intro-and-outro/_expected/iife.js +++ b/test/form/intro-and-outro/_expected/iife.js @@ -1,7 +1,8 @@ -(function () { 'use strict'; +(function () { + 'use strict'; /* this is an intro */ console.log( 'hello world' ); /* this is an outro */ -})(); +}()); diff --git a/test/form/multiple-exports/_expected/iife.js b/test/form/multiple-exports/_expected/iife.js index 8ed8290..3a3975d 100644 --- a/test/form/multiple-exports/_expected/iife.js +++ b/test/form/multiple-exports/_expected/iife.js @@ -1,4 +1,5 @@ -(function (exports) { 'use strict'; +(function (exports) { + 'use strict'; var foo = 1; var bar = 2; @@ -6,4 +7,4 @@ exports.foo = foo; exports.bar = bar; -})((this.myBundle = {})); +}((this.myBundle = {}))); diff --git a/test/form/namespace-optimization-b/_expected/iife.js b/test/form/namespace-optimization-b/_expected/iife.js index 59b2ce7..6aeb1cd 100644 --- a/test/form/namespace-optimization-b/_expected/iife.js +++ b/test/form/namespace-optimization-b/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function foo () { console.log( 'foo' ); @@ -16,4 +17,4 @@ a(); -})(); \ No newline at end of file +}()); \ No newline at end of file diff --git a/test/form/namespace-optimization/_expected/iife.js b/test/form/namespace-optimization/_expected/iife.js index aac8ff9..206c237 100644 --- a/test/form/namespace-optimization/_expected/iife.js +++ b/test/form/namespace-optimization/_expected/iife.js @@ -1,7 +1,8 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function a () {} a(); -})(); +}()); diff --git a/test/form/namespaced-default-exports/_expected/iife.js b/test/form/namespaced-default-exports/_expected/iife.js index 1869f2d..cf8f364 100644 --- a/test/form/namespaced-default-exports/_expected/iife.js +++ b/test/form/namespaced-default-exports/_expected/iife.js @@ -1,9 +1,10 @@ this.foo = this.foo || {}; this.foo.bar = this.foo.bar || {}; -this.foo.bar.baz = (function () { 'use strict'; +this.foo.bar.baz = (function () { + 'use strict'; var main = 42; return main; -})(); +}()); diff --git a/test/form/namespaced-named-exports/_expected/iife.js b/test/form/namespaced-named-exports/_expected/iife.js index 74e1d58..2fc75df 100644 --- a/test/form/namespaced-named-exports/_expected/iife.js +++ b/test/form/namespaced-named-exports/_expected/iife.js @@ -1,9 +1,10 @@ this.foo = this.foo || {}; this.foo.bar = this.foo.bar || {}; -(function (exports) { 'use strict'; +(function (exports) { + 'use strict'; var answer = 42; exports.answer = answer; -})((this.foo.bar.baz = {})); +}((this.foo.bar.baz = {}))); diff --git a/test/form/no-imports-or-exports/_expected/iife.js b/test/form/no-imports-or-exports/_expected/iife.js index 0ec6aae..a57b26d 100644 --- a/test/form/no-imports-or-exports/_expected/iife.js +++ b/test/form/no-imports-or-exports/_expected/iife.js @@ -1,5 +1,6 @@ -(function () { 'use strict'; +(function () { + 'use strict'; console.log( 'this is it' ); -})(); +}()); diff --git a/test/form/object-destructuring-default-values/_expected/iife.js b/test/form/object-destructuring-default-values/_expected/iife.js index 643b120..fd22a66 100644 --- a/test/form/object-destructuring-default-values/_expected/iife.js +++ b/test/form/object-destructuring-default-values/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; const a = 1; const b = 2; @@ -6,4 +7,4 @@ const [ d = b ] = []; console.log(c, d); -})(); \ No newline at end of file +}()); \ No newline at end of file diff --git a/test/form/preserves-comments-after-imports/_expected/iife.js b/test/form/preserves-comments-after-imports/_expected/iife.js index 9da8252..e9338dc 100644 --- a/test/form/preserves-comments-after-imports/_expected/iife.js +++ b/test/form/preserves-comments-after-imports/_expected/iife.js @@ -1,4 +1,5 @@ -(function (exports) { 'use strict'; +(function (exports) { + 'use strict'; /** A comment for a number */ var number = 5; @@ -8,4 +9,4 @@ exports.obj = obj; -})((this.myBundle = {})); +}((this.myBundle = {}))); diff --git a/test/form/removes-existing-sourcemap-comments/_expected/iife.js b/test/form/removes-existing-sourcemap-comments/_expected/iife.js index 07a64a4..5867d0f 100644 --- a/test/form/removes-existing-sourcemap-comments/_expected/iife.js +++ b/test/form/removes-existing-sourcemap-comments/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function foo () { return 42; @@ -6,4 +7,4 @@ console.log( foo() ); -})(); +}()); diff --git a/test/form/self-contained-bundle/_expected/iife.js b/test/form/self-contained-bundle/_expected/iife.js index 1017054..d0b884e 100644 --- a/test/form/self-contained-bundle/_expected/iife.js +++ b/test/form/self-contained-bundle/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function foo () { console.log( bar() ); @@ -15,4 +16,4 @@ foo(); console.log( 3 ); -})(); +}()); diff --git a/test/form/shorthand-properties/_expected/iife.js b/test/form/shorthand-properties/_expected/iife.js index d5ba3c7..4dc95d5 100644 --- a/test/form/shorthand-properties/_expected/iife.js +++ b/test/form/shorthand-properties/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function x () { return 'foo'; @@ -22,4 +23,4 @@ assert.equal( bar.x(), 'bar' ); assert.equal( baz.x(), 'baz' ); -})(); +}()); diff --git a/test/form/side-effect-b/_expected/iife.js b/test/form/side-effect-b/_expected/iife.js index 0880329..ae23229 100644 --- a/test/form/side-effect-b/_expected/iife.js +++ b/test/form/side-effect-b/_expected/iife.js @@ -1,7 +1,8 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var main = 42; return main; -})(); \ No newline at end of file +}()); \ No newline at end of file diff --git a/test/form/side-effect-c/_expected/iife.js b/test/form/side-effect-c/_expected/iife.js index 0880329..ae23229 100644 --- a/test/form/side-effect-c/_expected/iife.js +++ b/test/form/side-effect-c/_expected/iife.js @@ -1,7 +1,8 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var main = 42; return main; -})(); \ No newline at end of file +}()); \ No newline at end of file diff --git a/test/form/side-effect-d/_expected/iife.js b/test/form/side-effect-d/_expected/iife.js index b7b15ee..69d1387 100644 --- a/test/form/side-effect-d/_expected/iife.js +++ b/test/form/side-effect-d/_expected/iife.js @@ -1,7 +1,8 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var main = 42; return main; -})(); +}()); diff --git a/test/form/side-effect-e/_expected/iife.js b/test/form/side-effect-e/_expected/iife.js index 5757003..4e30885 100644 --- a/test/form/side-effect-e/_expected/iife.js +++ b/test/form/side-effect-e/_expected/iife.js @@ -1,4 +1,5 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; function foo () { var Object = { @@ -17,4 +18,4 @@ var myBundle = (function () { 'use strict'; return main; -})(); +}()); diff --git a/test/form/side-effect-f/_expected/iife.js b/test/form/side-effect-f/_expected/iife.js index b7b15ee..69d1387 100644 --- a/test/form/side-effect-f/_expected/iife.js +++ b/test/form/side-effect-f/_expected/iife.js @@ -1,7 +1,8 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var main = 42; return main; -})(); +}()); diff --git a/test/form/side-effect-g/_expected/iife.js b/test/form/side-effect-g/_expected/iife.js index b7b15ee..69d1387 100644 --- a/test/form/side-effect-g/_expected/iife.js +++ b/test/form/side-effect-g/_expected/iife.js @@ -1,7 +1,8 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var main = 42; return main; -})(); +}()); diff --git a/test/form/side-effect-h/_expected/iife.js b/test/form/side-effect-h/_expected/iife.js index b7b15ee..69d1387 100644 --- a/test/form/side-effect-h/_expected/iife.js +++ b/test/form/side-effect-h/_expected/iife.js @@ -1,7 +1,8 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var main = 42; return main; -})(); +}()); diff --git a/test/form/side-effect-i/_expected/iife.js b/test/form/side-effect-i/_expected/iife.js index b728697..29825a5 100644 --- a/test/form/side-effect-i/_expected/iife.js +++ b/test/form/side-effect-i/_expected/iife.js @@ -1,4 +1,5 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; if ( !ok ) { throw new Error( 'this will be included' ); @@ -8,4 +9,4 @@ var myBundle = (function () { 'use strict'; return main; -})(); +}()); diff --git a/test/form/side-effect-j/_expected/iife.js b/test/form/side-effect-j/_expected/iife.js index 7ab44e8..6b85109 100644 --- a/test/form/side-effect-j/_expected/iife.js +++ b/test/form/side-effect-j/_expected/iife.js @@ -1,4 +1,5 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; var augment; augment = x => x.augmented = true; @@ -8,4 +9,4 @@ var myBundle = (function () { 'use strict'; return x; -})(); \ No newline at end of file +}()); \ No newline at end of file diff --git a/test/form/side-effect-k/_expected/iife.js b/test/form/side-effect-k/_expected/iife.js index 2929269..bccee01 100644 --- a/test/form/side-effect-k/_expected/iife.js +++ b/test/form/side-effect-k/_expected/iife.js @@ -1,4 +1,5 @@ -var myBundle = (function () { 'use strict'; +var myBundle = (function () { + 'use strict'; function augment ( x ) { var prop, source; @@ -25,4 +26,4 @@ var myBundle = (function () { 'use strict'; return x; -})(); \ No newline at end of file +}()); \ No newline at end of file diff --git a/test/form/side-effect-l/_expected/iife.js b/test/form/side-effect-l/_expected/iife.js index fe68252..43ef542 100644 --- a/test/form/side-effect-l/_expected/iife.js +++ b/test/form/side-effect-l/_expected/iife.js @@ -1,5 +1,6 @@ -(function () { 'use strict'; +(function () { + 'use strict'; -})(); +}()); diff --git a/test/form/side-effect-m/_expected/iife.js b/test/form/side-effect-m/_expected/iife.js index 6c27951..d4be68e 100644 --- a/test/form/side-effect-m/_expected/iife.js +++ b/test/form/side-effect-m/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function odd ( n ) { return n !== 0 && even( n - 1 ); @@ -18,4 +19,4 @@ console.log( counter ); -})(); +}()); diff --git a/test/form/side-effect/_expected/iife.js b/test/form/side-effect/_expected/iife.js index a3f7fc8..5dbfbd5 100644 --- a/test/form/side-effect/_expected/iife.js +++ b/test/form/side-effect/_expected/iife.js @@ -1,7 +1,8 @@ -(function () { 'use strict'; +(function () { + 'use strict'; var foo = 42; assert.equal( foo, 42 ); -})(); +}()); diff --git a/test/form/sourcemaps-inline/_expected/iife.js b/test/form/sourcemaps-inline/_expected/iife.js index c02953f..3f48012 100644 --- a/test/form/sourcemaps-inline/_expected/iife.js +++ b/test/form/sourcemaps-inline/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function foo () { console.log( 'hello from foo.js' ); @@ -13,5 +14,5 @@ foo(); bar(); -})(); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWlmZS5qcyIsInNvdXJjZXMiOlsiLi4vZm9vLmpzIiwiLi4vYmFyLmpzIiwiLi4vbWFpbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBmb28gKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gZm9vLmpzJyApO1xufVxuIiwiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gYmFyICgpIHtcblx0Y29uc29sZS5sb2coICdoZWxsbyBmcm9tIGJhci5qcycgKTtcbn1cbiIsImltcG9ydCBmb28gZnJvbSAnLi9mb28nO1xuaW1wb3J0IGJhciBmcm9tICcuL2Jhcic7XG5cbmNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBtYWluLmpzJyApO1xuXG5mb28oKTtcbmJhcigpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0NBQWUsU0FBUyxHQUFHLElBQUk7QUFDL0IsQ0FBQSxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztBQUNwQyxDQUFBLENBQUM7O0NDRmMsU0FBUyxHQUFHLElBQUk7QUFDL0IsQ0FBQSxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztBQUNwQyxDQUFBLENBQUM7O0NDQ0QsT0FBTyxDQUFDLEdBQUcsRUFBRSxvQkFBb0IsRUFBRSxDQUFDOztBQUVwQyxDQUFBLEdBQUcsRUFBRSxDQUFDO0FBQ04sQ0FBQSxHQUFHLEVBQUUsQ0FBQyw7OyJ9 \ No newline at end of file +}()); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWlmZS5qcyIsInNvdXJjZXMiOlsiLi4vZm9vLmpzIiwiLi4vYmFyLmpzIiwiLi4vbWFpbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBmb28gKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gZm9vLmpzJyApO1xufVxuIiwiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gYmFyICgpIHtcblx0Y29uc29sZS5sb2coICdoZWxsbyBmcm9tIGJhci5qcycgKTtcbn1cbiIsImltcG9ydCBmb28gZnJvbSAnLi9mb28nO1xuaW1wb3J0IGJhciBmcm9tICcuL2Jhcic7XG5cbmNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBtYWluLmpzJyApO1xuXG5mb28oKTtcbmJhcigpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztDQUFlLFNBQVMsR0FBRyxJQUFJO0FBQy9CLENBQUEsQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLG1CQUFtQixFQUFFLENBQUM7QUFDcEMsQ0FBQSxDQUFDOztDQ0ZjLFNBQVMsR0FBRyxJQUFJO0FBQy9CLENBQUEsQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLG1CQUFtQixFQUFFLENBQUM7QUFDcEMsQ0FBQSxDQUFDOztDQ0NELE9BQU8sQ0FBQyxHQUFHLEVBQUUsb0JBQW9CLEVBQUUsQ0FBQzs7QUFFcEMsQ0FBQSxHQUFHLEVBQUUsQ0FBQztBQUNOLENBQUEsR0FBRyxFQUFFLENBQUMsOzsifQ== \ No newline at end of file diff --git a/test/form/sourcemaps/_expected/iife.js b/test/form/sourcemaps/_expected/iife.js index 683379d..b45e3e8 100644 --- a/test/form/sourcemaps/_expected/iife.js +++ b/test/form/sourcemaps/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function foo () { console.log( 'hello from foo.js' ); @@ -13,5 +14,5 @@ foo(); bar(); -})(); +}()); //# sourceMappingURL=iife.js.map \ No newline at end of file diff --git a/test/form/sourcemaps/_expected/iife.js.map b/test/form/sourcemaps/_expected/iife.js.map index bdf6170..7c5cde5 100644 --- a/test/form/sourcemaps/_expected/iife.js.map +++ b/test/form/sourcemaps/_expected/iife.js.map @@ -1 +1 @@ -{"version":3,"file":"iife.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;CAAe,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCFc,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCCD,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;;AAEpC,CAAA,GAAG,EAAE,CAAC;AACN,CAAA,GAAG,EAAE,CAAC,;;"} \ No newline at end of file +{"version":3,"file":"iife.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;;CAAe,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCFc,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCCD,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;;AAEpC,CAAA,GAAG,EAAE,CAAC;AACN,CAAA,GAAG,EAAE,CAAC,;;"} \ No newline at end of file diff --git a/test/form/spacing-after-function-with-semicolon/_expected/iife.js b/test/form/spacing-after-function-with-semicolon/_expected/iife.js index ea1be49..7ff78ec 100644 --- a/test/form/spacing-after-function-with-semicolon/_expected/iife.js +++ b/test/form/spacing-after-function-with-semicolon/_expected/iife.js @@ -1,7 +1,8 @@ -(function () { 'use strict'; +(function () { + 'use strict'; function x () { return 'x' }; assert.equal( x(), 'x' ); -})(); +}()); diff --git a/test/form/string-indentation-b/_expected/iife.js b/test/form/string-indentation-b/_expected/iife.js index 0ffdcbe..ae8c969 100644 --- a/test/form/string-indentation-b/_expected/iife.js +++ b/test/form/string-indentation-b/_expected/iife.js @@ -1,8 +1,9 @@ -(function () { 'use strict'; +(function () { + 'use strict'; var a = 'a'; var b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); -})(); \ No newline at end of file +}()); \ No newline at end of file diff --git a/test/form/string-indentation/_expected/iife.js b/test/form/string-indentation/_expected/iife.js index 47c6737..c2426fa 100644 --- a/test/form/string-indentation/_expected/iife.js +++ b/test/form/string-indentation/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; var a = '1\ 2'; @@ -17,4 +18,4 @@ assert.equal( c, '1\n 2' ); assert.equal( d, '1\n\t2' ); -})(); +}()); diff --git a/test/form/unmodified-default-exports-function-argument/_expected/iife.js b/test/form/unmodified-default-exports-function-argument/_expected/iife.js index 9fb882d..c21e450 100644 --- a/test/form/unmodified-default-exports-function-argument/_expected/iife.js +++ b/test/form/unmodified-default-exports-function-argument/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; var foo = function () { return 42; @@ -13,4 +14,4 @@ console.log( answer ); -})(); +}()); diff --git a/test/form/unmodified-default-exports/_expected/iife.js b/test/form/unmodified-default-exports/_expected/iife.js index 2942fdd..c07ff1a 100644 --- a/test/form/unmodified-default-exports/_expected/iife.js +++ b/test/form/unmodified-default-exports/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; var Foo = function () { this.isFoo = true; @@ -12,4 +13,4 @@ var foo = new Foo(); -})(); +}()); diff --git a/test/form/unused-default-exports/_expected/iife.js b/test/form/unused-default-exports/_expected/iife.js index a745745..2c6a515 100644 --- a/test/form/unused-default-exports/_expected/iife.js +++ b/test/form/unused-default-exports/_expected/iife.js @@ -1,4 +1,5 @@ -(function () { 'use strict'; +(function () { + 'use strict'; var foo = { value: 1 }; @@ -11,4 +12,4 @@ assert.equal( foo.value, 2 ); -})(); +}());