diff --git a/src/Module.ts b/src/Module.ts index d967a21e17d..cf2a7ad2fb9 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -5,7 +5,7 @@ import extractAssignedNames from 'rollup-pluginutils/src/extractAssignedNames'; import { createHasEffectsContext, createInclusionContext, - InclusionContext, + InclusionContext } from './ast/ExecutionContext'; import ExportAllDeclaration from './ast/nodes/ExportAllDeclaration'; import ExportDefaultDeclaration from './ast/nodes/ExportDefaultDeclaration'; @@ -42,7 +42,7 @@ import { ResolvedIdMap, RollupError, RollupWarning, - TransformModuleJSON, + TransformModuleJSON } from './rollup/types'; import { error, Errors } from './utils/error'; import getCodeFrame from './utils/getCodeFrame'; @@ -123,7 +123,7 @@ export interface AstContext { export const defaultAcornOptions: acorn.Options = { ecmaVersion: 2020, preserveParens: false, - sourceType: 'module', + sourceType: 'module' }; function tryParse(module: Module, Parser: typeof acorn.Parser, acornOptions: acorn.Options) { @@ -132,7 +132,7 @@ function tryParse(module: Module, Parser: typeof acorn.Parser, acornOptions: aco ...defaultAcornOptions, ...acornOptions, onComment: (block: boolean, text: string, start: number, end: number) => - module.comments.push({ block, text, start, end }), + module.comments.push({ block, text, start, end }) }); } catch (err) { let message = err.message.replace(/ \(\d+:\d+\)$/, ''); @@ -145,7 +145,7 @@ function tryParse(module: Module, Parser: typeof acorn.Parser, acornOptions: aco { code: 'PARSE_ERROR', message, - parserError: err, + parserError: err }, err.pos ); @@ -164,7 +164,7 @@ function handleMissingExport( message: `'${exportName}' is not exported by ${relativeId( importedModule )}, imported by ${relativeId(importingModule.id)}`, - url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`, + url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` }, importerStart! ); @@ -172,7 +172,7 @@ function handleMissingExport( const MISSING_EXPORT_SHIM_DESCRIPTION: ExportDescription = { identifier: null, - localName: MISSING_EXPORT_SHIM_VARIABLE, + localName: MISSING_EXPORT_SHIM_VARIABLE }; function getVariableForExportNameRecursive( @@ -290,17 +290,17 @@ export default class Module { loc: { column: location.column, file: this.id, - line: location.line, + line: location.line }, message: `Error when using sourcemap for reporting an error: ${e.message}`, - pos, + pos }); } props.loc = { column: location.column, file: this.id, - line: location.line, + line: location.line }; props.frame = getCodeFrame(this.originalCode, location.line, location.column); } @@ -342,7 +342,7 @@ export default class Module { return error({ code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT, id: this.id, - message: `Modules with 'syntheticNamedExports' need a default export.`, + message: `Modules with 'syntheticNamedExports' need a default export.` }); } return this.defaultExport; @@ -632,7 +632,7 @@ export default class Module { sourcemapChain, syntheticNamedExports, transformDependencies, - transformFiles, + transformFiles }: TransformModuleJSON & { alwaysRemovedCode?: [number, number][]; transformFiles?: EmittedFile[] | undefined; @@ -678,7 +678,7 @@ export default class Module { this.magicString = new MagicString(code, { filename: (this.excludeFromSourcemap ? null : fileName)!, // don't include plugin helpers in sourcemap - indentExclusionRanges: [], + indentExclusionRanges: [] }); for (const [start, end] of this.alwaysRemovedCode) { this.magicString.remove(start, end); @@ -704,7 +704,7 @@ export default class Module { includeDynamicImport: this.includeDynamicImport.bind(this), includeExternalReexportNamespace: this.includeExternalReexportNamespace.bind(this), includeVariable: this.includeVariable.bind(this), - isCrossChunkImport: (importDescription) => + isCrossChunkImport: importDescription => (importDescription.module as Module).chunk !== this.chunk, magicString: this.magicString, module: this, @@ -722,7 +722,7 @@ export default class Module { this.graph.treeshakingOptions.unknownGlobalSideEffects)!, usesTopLevelAwait: false, warn: this.warn.bind(this), - warnDeprecation: this.graph.warnDeprecation.bind(this.graph), + warnDeprecation: this.graph.warnDeprecation.bind(this.graph) }; this.scope = new ModuleScope(this.graph.scope, this.astContext); @@ -741,7 +741,7 @@ export default class Module { ast: this.esTreeAst, code: this.code, customTransformCache: this.customTransformCache, - dependencies: Array.from(this.dependencies).map((module) => module.id), + dependencies: Array.from(this.dependencies).map(module => module.id), id: this.id, moduleSideEffects: this.moduleSideEffects, originalCode: this.originalCode, @@ -750,7 +750,7 @@ export default class Module { sourcemapChain: this.sourcemapChain, syntheticNamedExports: this.syntheticNamedExports, transformDependencies: this.transformDependencies, - transformFiles: this.transformFiles, + transformFiles: this.transformFiles }; } @@ -811,7 +811,7 @@ export default class Module { this.exports.default = { identifier: node.variable.getAssignedVariableName(), - localName: 'default', + localName: 'default' }; } else if (node instanceof ExportAllDeclaration) { // export * from './other' @@ -831,7 +831,7 @@ export default class Module { specifier.type === NodeType.ExportNamespaceSpecifier ? '*' : specifier.local.name, module: null as any, // filled in later, source, - start: specifier.start, + start: specifier.start }; } } else if (node.declaration) { @@ -872,7 +872,7 @@ export default class Module { return this.error( { code: 'DUPLICATE_IMPORT', - message: `Duplicated import '${localName}'`, + message: `Duplicated import '${localName}'` }, specifier.start ); @@ -890,7 +890,7 @@ export default class Module { module: null as any, // filled in later name, source, - start: specifier.start, + start: specifier.start }; } } @@ -910,9 +910,7 @@ export default class Module { } private includeDynamicImport(node: ImportExpression) { - const resolution = (this.dynamicImports.find( - (dynamicImport) => dynamicImport.node === node - ) as { + const resolution = (this.dynamicImports.find(dynamicImport => dynamicImport.node === node) as { resolution: string | Module | ExternalModule | undefined; }).resolution; if (resolution instanceof Module) { @@ -952,7 +950,7 @@ export default class Module { code: 'SHIMMED_EXPORT', exporter: relativeId(this.id), exportName: name, - message: `Missing export "${name}" has been shimmed in module ${relativeId(this.id)}.`, + message: `Missing export "${name}" has been shimmed in module ${relativeId(this.id)}.` }); this.exports[name] = MISSING_EXPORT_SHIM_DESCRIPTION; } diff --git a/src/ast/variables/NamespaceVariable.ts b/src/ast/variables/NamespaceVariable.ts index 65c124d5758..88ee22eb650 100644 --- a/src/ast/variables/NamespaceVariable.ts +++ b/src/ast/variables/NamespaceVariable.ts @@ -12,9 +12,9 @@ export default class NamespaceVariable extends Variable { isNamespace!: true; memberVariables: { [name: string]: Variable } = Object.create(null); module: Module; - reexportedNamespaces: string[] = []; - private reexportedNamespaceVariables: ExternalVariable[] = []; + private reexportedExternalNamespaces: string[] = []; + private reexportedExternalNamespaceVariables: ExternalVariable[] = []; private referencedEarly = false; private references: Identifier[] = []; private syntheticNamedExports: boolean; @@ -50,8 +50,10 @@ export default class NamespaceVariable extends Variable { break; } } - for (const name of this.reexportedNamespaces) { - this.reexportedNamespaceVariables.push(this.context.includeExternalReexportNamespace(name)); + for (const name of this.reexportedExternalNamespaces) { + this.reexportedExternalNamespaceVariables.push( + this.context.includeExternalReexportNamespace(name) + ); } if (this.context.preserveModules) { for (const memberName of Object.keys(this.memberVariables)) @@ -66,7 +68,7 @@ export default class NamespaceVariable extends Variable { initialise() { for (const name of this.context.getExports().concat(this.context.getReexports())) { if (name[0] === '*' && name.length > 1) { - this.reexportedNamespaces.push(name.slice(1)); + this.reexportedExternalNamespaces.push(name.slice(1)); } else { this.memberVariables[name] = this.context.traceExport(name); } @@ -78,7 +80,7 @@ export default class NamespaceVariable extends Variable { const n = options.compact ? '' : '\n'; const t = options.indent; - const members = Object.keys(this.memberVariables).map((name) => { + const members = Object.keys(this.memberVariables).map(name => { const original = this.memberVariables[name]; if (this.referencedEarly || original.isReassigned) { @@ -92,30 +94,33 @@ export default class NamespaceVariable extends Variable { return `${t}${safeName}: ${original.getName()}`; }); - const objectCreate = this.reexportedNamespaceVariables.length; - if (!objectCreate) members.unshift(`${t}__proto__:${_}null`); - if (options.namespaceToStringTag) { members.unshift(`${t}[Symbol.toStringTag]:${_}'Module'`); } - const name = this.getName(); + // TODO Lukas rename to reflect they are external + const hasExternalReexports = this.reexportedExternalNamespaceVariables.length > 0; + if (!hasExternalReexports) members.unshift(`${t}__proto__:${_}null`); + let output = `{${n}${members.join(`,${n}`)}${n}}`; - if (this.reexportedNamespaceVariables.length) { - output = `Object.assign(Object.create(null), ${this.reexportedNamespaceVariables - .map((v) => v.getName()) - .join(', ')}, ${output}${ - this.syntheticNamedExports ? ', ' + this.module.getDefaultExport().getName() : '' - })`; - if (!options.freeze) output = '*#__PURE__*/' + output; - } else if (this.syntheticNamedExports) { - output = `Object.assign(${output}, ${this.module.getDefaultExport().getName()})`; - if (!options.freeze) output = '*#__PURE__*/' + output; + if (hasExternalReexports || this.syntheticNamedExports) { + const assignmentArgs = [output]; + if (hasExternalReexports) { + assignmentArgs.unshift( + '/*#__PURE__*/Object.create(null)', + ...this.reexportedExternalNamespaceVariables.map(variable => variable.getName()) + ); + } + if (this.syntheticNamedExports) { + assignmentArgs.push(this.module.getDefaultExport().getName()); + } + output = `/*#__PURE__*/Object.assign(${assignmentArgs.join(`,${_}`)})`; } if (options.freeze) { output = `/*#__PURE__*/Object.freeze(${output})`; } + const name = this.getName(); output = `${options.varOrConst} ${name}${_}=${_}${output};`; if (options.format === 'system' && this.exportName) { diff --git a/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/amd/main.js b/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/amd/main.js index 5731e5c57a5..6285d62559e 100644 --- a/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/amd/main.js +++ b/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/amd/main.js @@ -6,7 +6,7 @@ define(function () { 'use strict'; }; const foo = 100; - var ns = /*#__PURE__*/Object.freeze(Object.assign({ + var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign({ __proto__: null, foo: foo, 'default': d diff --git a/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/cjs/main.js b/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/cjs/main.js index 282e6ab8941..f2c1b375abb 100644 --- a/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/cjs/main.js +++ b/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/cjs/main.js @@ -6,7 +6,7 @@ const d = { }; const foo = 100; -var ns = /*#__PURE__*/Object.freeze(Object.assign({ +var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign({ __proto__: null, foo: foo, 'default': d diff --git a/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/es/main.js b/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/es/main.js index ab1c380da37..3b23f6d33bb 100644 --- a/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/es/main.js +++ b/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/es/main.js @@ -4,7 +4,7 @@ const d = { }; const foo = 100; -var ns = /*#__PURE__*/Object.freeze(Object.assign({ +var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign({ __proto__: null, foo: foo, 'default': d diff --git a/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/system/main.js b/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/system/main.js index 6aecf6312bf..1147e48c999 100644 --- a/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/system/main.js +++ b/test/chunking-form/samples/mixed-synthetic-named-exports/_expected/system/main.js @@ -9,7 +9,7 @@ System.register([], function () { }; const foo = 100; - var ns = /*#__PURE__*/Object.freeze(Object.assign({ + var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign({ __proto__: null, foo: foo, 'default': d diff --git a/test/form/samples/compact/_expected/amd.js b/test/form/samples/compact/_expected/amd.js index 6be712a0259..dfa075b328d 100644 --- a/test/form/samples/compact/_expected/amd.js +++ b/test/form/samples/compact/_expected/amd.js @@ -1,6 +1,6 @@ -define(['external'],function(x){'use strict';x=x&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;var self=/*#__PURE__*/Object.freeze({[Symbol.toStringTag]:'Module',__proto__:null,get default(){return foo}});console.log(self); +define(['external'],function(x){'use strict';x=x&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x ); } // trailing comment -return foo;}); +return foo;}); \ No newline at end of file diff --git a/test/form/samples/compact/_expected/cjs.js b/test/form/samples/compact/_expected/cjs.js index 0c18fd099f3..f52e48bba2a 100644 --- a/test/form/samples/compact/_expected/cjs.js +++ b/test/form/samples/compact/_expected/cjs.js @@ -1,4 +1,4 @@ -'use strict';function _interopDefault(e){return(e&&(typeof e==='object')&&'default'in e)?e['default']:e}var x=_interopDefault(require('external'));var self=/*#__PURE__*/Object.freeze({[Symbol.toStringTag]:'Module',__proto__:null,get default(){return foo}});console.log(self); +'use strict';function _interopDefault(e){return(e&&(typeof e==='object')&&'default'in e)?e['default']:e}var x=_interopDefault(require('external'));var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x ); } diff --git a/test/form/samples/compact/_expected/es.js b/test/form/samples/compact/_expected/es.js index 8440fbc9991..a580d524969 100644 --- a/test/form/samples/compact/_expected/es.js +++ b/test/form/samples/compact/_expected/es.js @@ -1,4 +1,4 @@ -import x from'external';var self=/*#__PURE__*/Object.freeze({[Symbol.toStringTag]:'Module',__proto__:null,get default(){return foo}});console.log(self); +import x from'external';var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x ); } diff --git a/test/form/samples/compact/_expected/iife.js b/test/form/samples/compact/_expected/iife.js index d17c5d43442..e01b3cf90a4 100644 --- a/test/form/samples/compact/_expected/iife.js +++ b/test/form/samples/compact/_expected/iife.js @@ -1,6 +1,6 @@ -var foo=(function(x){'use strict';x=x&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;var self=/*#__PURE__*/Object.freeze({[Symbol.toStringTag]:'Module',__proto__:null,get default(){return foo}});console.log(self); +var foo=(function(x){'use strict';x=x&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x ); } // trailing comment -return foo;}(x)); +return foo;}(x)); \ No newline at end of file diff --git a/test/form/samples/compact/_expected/system.js b/test/form/samples/compact/_expected/system.js index 42b5074a7cb..31cc2cf03b0 100644 --- a/test/form/samples/compact/_expected/system.js +++ b/test/form/samples/compact/_expected/system.js @@ -1,4 +1,4 @@ -System.register('foo',['external'],function(exports){'use strict';var x;return{setters:[function(module){x=module.default;}],execute:function(){exports('default',foo);var self=/*#__PURE__*/Object.freeze({[Symbol.toStringTag]:'Module',__proto__:null,get default(){return foo}});console.log(self); +System.register('foo',['external'],function(exports){'use strict';var x;return{setters:[function(module){x=module.default;}],execute:function(){exports('default',foo);var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x ); } diff --git a/test/form/samples/compact/_expected/umd.js b/test/form/samples/compact/_expected/umd.js index 18250d221e0..0c0b249d51e 100644 --- a/test/form/samples/compact/_expected/umd.js +++ b/test/form/samples/compact/_expected/umd.js @@ -1,6 +1,6 @@ -(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?module.exports=f(require('external')):typeof define==='function'&&define.amd?define(['external'],f):(g=g||self,g.foo=f(g.x));}(this,(function(x){'use strict';x=x&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;var self=/*#__PURE__*/Object.freeze({[Symbol.toStringTag]:'Module',__proto__:null,get default(){return foo}});console.log(self); +(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?module.exports=f(require('external')):typeof define==='function'&&define.amd?define(['external'],f):(g=g||self,g.foo=f(g.x));}(this,(function(x){'use strict';x=x&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x ); } // trailing comment -return foo;}))); +return foo;}))); \ No newline at end of file diff --git a/test/form/samples/namespace-tostringtag/_expected/amd.js b/test/form/samples/namespace-tostringtag/_expected/amd.js index e6ddbfd62f1..28ab2705d81 100644 --- a/test/form/samples/namespace-tostringtag/_expected/amd.js +++ b/test/form/samples/namespace-tostringtag/_expected/amd.js @@ -1,8 +1,8 @@ define(['exports'], function (exports) { 'use strict'; var self = /*#__PURE__*/Object.freeze({ - [Symbol.toStringTag]: 'Module', __proto__: null, + [Symbol.toStringTag]: 'Module', get p () { return p; } }); diff --git a/test/form/samples/namespace-tostringtag/_expected/cjs.js b/test/form/samples/namespace-tostringtag/_expected/cjs.js index 9eb8fe5b21f..97f13a09c4c 100644 --- a/test/form/samples/namespace-tostringtag/_expected/cjs.js +++ b/test/form/samples/namespace-tostringtag/_expected/cjs.js @@ -3,8 +3,8 @@ Object.defineProperty(exports, '__esModule', { value: true }); var self = /*#__PURE__*/Object.freeze({ - [Symbol.toStringTag]: 'Module', __proto__: null, + [Symbol.toStringTag]: 'Module', get p () { return p; } }); diff --git a/test/form/samples/namespace-tostringtag/_expected/es.js b/test/form/samples/namespace-tostringtag/_expected/es.js index b5e71f3c02f..a7cd93962ea 100644 --- a/test/form/samples/namespace-tostringtag/_expected/es.js +++ b/test/form/samples/namespace-tostringtag/_expected/es.js @@ -1,6 +1,6 @@ var self = /*#__PURE__*/Object.freeze({ - [Symbol.toStringTag]: 'Module', __proto__: null, + [Symbol.toStringTag]: 'Module', get p () { return p; } }); diff --git a/test/form/samples/namespace-tostringtag/_expected/iife.js b/test/form/samples/namespace-tostringtag/_expected/iife.js index e03dfc5a3f2..f96940def5c 100644 --- a/test/form/samples/namespace-tostringtag/_expected/iife.js +++ b/test/form/samples/namespace-tostringtag/_expected/iife.js @@ -2,8 +2,8 @@ var iife = (function (exports) { 'use strict'; var self = /*#__PURE__*/Object.freeze({ - [Symbol.toStringTag]: 'Module', __proto__: null, + [Symbol.toStringTag]: 'Module', get p () { return p; } }); diff --git a/test/form/samples/namespace-tostringtag/_expected/system.js b/test/form/samples/namespace-tostringtag/_expected/system.js index 5e4bc576382..5ee50d33a91 100644 --- a/test/form/samples/namespace-tostringtag/_expected/system.js +++ b/test/form/samples/namespace-tostringtag/_expected/system.js @@ -4,8 +4,8 @@ System.register('iife', [], function (exports) { execute: function () { var self = /*#__PURE__*/Object.freeze({ - [Symbol.toStringTag]: 'Module', __proto__: null, + [Symbol.toStringTag]: 'Module', get p () { return p; } }); diff --git a/test/form/samples/namespace-tostringtag/_expected/umd.js b/test/form/samples/namespace-tostringtag/_expected/umd.js index cdc8347fa00..9ae146ed7ad 100644 --- a/test/form/samples/namespace-tostringtag/_expected/umd.js +++ b/test/form/samples/namespace-tostringtag/_expected/umd.js @@ -5,8 +5,8 @@ }(this, (function (exports) { 'use strict'; var self = /*#__PURE__*/Object.freeze({ - [Symbol.toStringTag]: 'Module', __proto__: null, + [Symbol.toStringTag]: 'Module', get p () { return p; } }); diff --git a/test/form/samples/ns-external-star-reexport/_expected/amd.js b/test/form/samples/ns-external-star-reexport/_expected/amd.js index 93459c8c30b..b2b58d5892e 100644 --- a/test/form/samples/ns-external-star-reexport/_expected/amd.js +++ b/test/form/samples/ns-external-star-reexport/_expected/amd.js @@ -2,7 +2,7 @@ define(['external-ns-1', 'external-ns-2'], function (externalNs1, externalNs2) { const val = 5; - var ns = /*#__PURE__*/Object.freeze(Object.assign(Object.create(null), externalNs1, externalNs2, { + var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), externalNs1, externalNs2, { val: val })); diff --git a/test/form/samples/ns-external-star-reexport/_expected/cjs.js b/test/form/samples/ns-external-star-reexport/_expected/cjs.js index 986e8a89707..31fee1d3da4 100644 --- a/test/form/samples/ns-external-star-reexport/_expected/cjs.js +++ b/test/form/samples/ns-external-star-reexport/_expected/cjs.js @@ -5,7 +5,7 @@ var externalNs2 = require('external-ns-2'); const val = 5; -var ns = /*#__PURE__*/Object.freeze(Object.assign(Object.create(null), externalNs1, externalNs2, { +var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), externalNs1, externalNs2, { val: val })); diff --git a/test/form/samples/ns-external-star-reexport/_expected/es.js b/test/form/samples/ns-external-star-reexport/_expected/es.js index b139f881c07..44d164b7849 100644 --- a/test/form/samples/ns-external-star-reexport/_expected/es.js +++ b/test/form/samples/ns-external-star-reexport/_expected/es.js @@ -3,7 +3,7 @@ import * as externalNs2 from 'external-ns-2'; const val = 5; -var ns = /*#__PURE__*/Object.freeze(Object.assign(Object.create(null), externalNs1, externalNs2, { +var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), externalNs1, externalNs2, { val: val })); diff --git a/test/form/samples/ns-external-star-reexport/_expected/system.js b/test/form/samples/ns-external-star-reexport/_expected/system.js index 0ab8d6a72e8..f7d0d98ff2e 100644 --- a/test/form/samples/ns-external-star-reexport/_expected/system.js +++ b/test/form/samples/ns-external-star-reexport/_expected/system.js @@ -11,7 +11,7 @@ System.register(['external-ns-1', 'external-ns-2'], function (exports) { const val = 5; - var ns = /*#__PURE__*/Object.freeze(Object.assign(Object.create(null), externalNs1, externalNs2, { + var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), externalNs1, externalNs2, { val: val }));