Browse Source

reinstate #392 fix

gh-438-b
Rich-Harris 9 years ago
parent
commit
aac5365f42
  1. 2
      src/finalisers/umd.js
  2. 2
      test/cli/indent-none/_expected.js
  3. 2
      test/cli/module-name/_expected.js
  4. 2
      test/form/banner-and-footer-plugin/_expected/umd.js
  5. 2
      test/form/banner-and-footer/_expected/umd.js
  6. 2
      test/form/block-comments/_expected/umd.js
  7. 2
      test/form/dedupes-external-imports/_expected/umd.js
  8. 2
      test/form/exclude-unnecessary-modifications/_expected/umd.js
  9. 2
      test/form/export-all-from-internal/_expected/umd.js
  10. 2
      test/form/export-default-2/_expected/umd.js
  11. 2
      test/form/export-default-3/_expected/umd.js
  12. 2
      test/form/export-default/_expected/umd.js
  13. 2
      test/form/export-multiple-vars/_expected/umd.js
  14. 2
      test/form/exports-at-end-if-possible/_expected/umd.js
  15. 2
      test/form/external-imports-custom-names/_expected/umd.js
  16. 2
      test/form/external-imports/_expected/umd.js
  17. 2
      test/form/indent-false/_expected/umd.js
  18. 2
      test/form/indent-true-spaces/_expected/umd.js
  19. 2
      test/form/indent-true/_expected/umd.js
  20. 2
      test/form/internal-conflict-resolution/_expected/umd.js
  21. 2
      test/form/intro-and-outro/_expected/umd.js
  22. 2
      test/form/multiple-exports/_expected/umd.js
  23. 2
      test/form/namespace-optimization-b/_expected/umd.js
  24. 2
      test/form/namespace-optimization/_expected/umd.js
  25. 2
      test/form/namespaced-default-exports/_expected/umd.js
  26. 2
      test/form/namespaced-named-exports/_expected/umd.js
  27. 2
      test/form/no-imports-or-exports/_expected/umd.js
  28. 2
      test/form/object-destructuring-default-values/_expected/umd.js
  29. 2
      test/form/preserves-comments-after-imports/_expected/umd.js
  30. 2
      test/form/removes-existing-sourcemap-comments/_expected/umd.js
  31. 2
      test/form/self-contained-bundle/_expected/umd.js
  32. 2
      test/form/shorthand-properties/_expected/umd.js
  33. 2
      test/form/side-effect-b/_expected/umd.js
  34. 2
      test/form/side-effect-c/_expected/umd.js
  35. 2
      test/form/side-effect-d/_expected/umd.js
  36. 2
      test/form/side-effect-e/_expected/umd.js
  37. 2
      test/form/side-effect-f/_expected/umd.js
  38. 2
      test/form/side-effect-g/_expected/umd.js
  39. 2
      test/form/side-effect-h/_expected/umd.js
  40. 2
      test/form/side-effect-i/_expected/umd.js
  41. 2
      test/form/side-effect-j/_expected/umd.js
  42. 2
      test/form/side-effect-k/_expected/umd.js
  43. 2
      test/form/side-effect-l/_expected/umd.js
  44. 2
      test/form/side-effect/_expected/umd.js
  45. 2
      test/form/sourcemaps-inline/_expected/umd.js
  46. 2
      test/form/sourcemaps/_expected/umd.js
  47. 2
      test/form/spacing-after-function-with-semicolon/_expected/umd.js
  48. 2
      test/form/string-indentation-b/_expected/umd.js
  49. 2
      test/form/string-indentation/_expected/umd.js
  50. 2
      test/form/unmodified-default-exports-function-argument/_expected/umd.js
  51. 2
      test/form/unmodified-default-exports/_expected/umd.js
  52. 2
      test/form/unused-default-exports/_expected/umd.js

2
src/finalisers/umd.js

@ -50,7 +50,7 @@ export default function umd ( bundle, magicString, { exportMode, indentString },
`(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? ${cjsExport}factory(${cjsDeps.join( ', ' )}) :
typeof define === 'function' && define.amd ? define(${amdParams}factory) :
${defaultExport}factory(${globalDeps});
(${defaultExport}factory(${globalDeps}));
}(this, function (${args}) {${useStrict}
`.replace( /^\t\t/gm, '' ).replace( /^\t/gm, magicString.getIndentString() );

2
test/cli/indent-none/_expected.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
assert.equal( 1 + 1, 2 );

2
test/cli/module-name/_expected.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var main = 42;

2
test/form/banner-and-footer-plugin/_expected/umd.js

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

2
test/form/banner-and-footer/_expected/umd.js

@ -2,7 +2,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
console.log( 'hello world' );

2
test/form/block-comments/_expected/umd.js

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

2
test/form/dedupes-external-imports/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) :
typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) :
factory((global.myBundle = {}),global.external);
(factory((global.myBundle = {}),global.external));
}(this, function (exports,external) { 'use strict';
class Foo extends external.Component {

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

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

2
test/form/export-all-from-internal/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
factory((global.exposedInternals = {}));
(factory((global.exposedInternals = {})));
}(this, function (exports) { 'use strict';
const a = 1;

2
test/form/export-default-2/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var bar = 1;

2
test/form/export-default-3/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var bar = 1;

2
test/form/export-default/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var main = 42;

2
test/form/export-multiple-vars/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
var a = 1;

2
test/form/exports-at-end-if-possible/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
factory((global.myBundle = {}));
(factory((global.myBundle = {})));
}(this, function (exports) { 'use strict';
var FOO = 'foo';

2
test/form/external-imports-custom-names/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
factory(global.jQuery);
(factory(global.jQuery));
}(this, function ($) { 'use strict';
$ = 'default' in $ ? $['default'] : $;

2
test/form/external-imports/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('factory'), require('baz'), require('shipping-port'), require('alphabet')) :
typeof define === 'function' && define.amd ? define(['factory', 'baz', 'shipping-port', 'alphabet'], factory) :
factory(global.factory,global.baz,global.containers,global.alphabet);
(factory(global.factory,global.baz,global.containers,global.alphabet));
}(this, function (factory,baz,containers,alphabet) { 'use strict';
factory = 'default' in factory ? factory['default'] : factory;

2
test/form/indent-false/_expected/umd.js

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

2
test/form/indent-true-spaces/_expected/umd.js

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

2
test/form/indent-true/_expected/umd.js

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

2
test/form/internal-conflict-resolution/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
var bar$1 = 42;

2
test/form/intro-and-outro/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
/* this is an intro */

2
test/form/multiple-exports/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
factory((global.myBundle = {}));
(factory((global.myBundle = {})));
}(this, function (exports) { 'use strict';
var foo = 1;

2
test/form/namespace-optimization-b/_expected/umd.js

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

2
test/form/namespace-optimization/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
function a () {}

2
test/form/namespaced-default-exports/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.foo = global.foo || {}, global.foo.bar = global.foo.bar || {}, global.foo.bar.baz = factory();
(global.foo = global.foo || {}, global.foo.bar = global.foo.bar || {}, global.foo.bar.baz = factory());
}(this, function () { 'use strict';
var main = 42;

2
test/form/namespaced-named-exports/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
factory((global.foo = global.foo || {}, global.foo.bar = global.foo.bar || {}, global.foo.bar.baz = {}));
(factory((global.foo = global.foo || {}, global.foo.bar = global.foo.bar || {}, global.foo.bar.baz = {})));
}(this, function (exports) { 'use strict';
var answer = 42;

2
test/form/no-imports-or-exports/_expected/umd.js

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

2
test/form/object-destructuring-default-values/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
const a = 1;

2
test/form/preserves-comments-after-imports/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
factory((global.myBundle = {}));
(factory((global.myBundle = {})));
}(this, function (exports) { 'use strict';
/** A comment for a number */

2
test/form/removes-existing-sourcemap-comments/_expected/umd.js

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

2
test/form/self-contained-bundle/_expected/umd.js

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

2
test/form/shorthand-properties/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
function x () {

2
test/form/side-effect-b/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var main = 42;

2
test/form/side-effect-c/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var main = 42;

2
test/form/side-effect-d/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var main = 42;

2
test/form/side-effect-e/_expected/umd.js

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

2
test/form/side-effect-f/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var main = 42;

2
test/form/side-effect-g/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var main = 42;

2
test/form/side-effect-h/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var main = 42;

2
test/form/side-effect-i/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
if ( !ok ) {

2
test/form/side-effect-j/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
var augment;

2
test/form/side-effect-k/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
(global.myBundle = factory());
}(this, function () { 'use strict';
function augment ( x ) {

2
test/form/side-effect-l/_expected/umd.js

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

2
test/form/side-effect/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
var foo = 42;

2
test/form/sourcemaps-inline/_expected/umd.js

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

2
test/form/sourcemaps/_expected/umd.js

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

2
test/form/spacing-after-function-with-semicolon/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
function x () { return 'x' };

2
test/form/string-indentation-b/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
var a = 'a';

2
test/form/string-indentation/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
var a = '1\

2
test/form/unmodified-default-exports-function-argument/_expected/umd.js

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

2
test/form/unmodified-default-exports/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
var Foo = function () {

2
test/form/unused-default-exports/_expected/umd.js

@ -1,7 +1,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
factory();
(factory());
}(this, function () { 'use strict';
var foo = { value: 1 };

Loading…
Cancel
Save