Skip to content

Commit 7abe36f

Browse files
committed
use Object.create(null), indenting
1 parent ab4fde0 commit 7abe36f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/codegeneration/InstantiateModuleTransformer.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,28 +349,26 @@ export class InstantiateModuleTransformer extends ModuleTransformer {
349349

350350
// then do export bindings of re-exported dependencies
351351
if (externalExportBindings) {
352-
let reexports = {};
352+
let reexports = Object.create(null);
353353
externalExportBindings.forEach(({exportName, importName}) => {
354354
reexports[exportName] = importName === null ?
355355
parseExpression `$__m` : parseExpression `$__m.${importName}`;
356356
});
357357
setterStatements.push(
358-
parseStatement `$__export(${createObjectLiteral(reexports)})`
359-
);
358+
parseStatement `$__export(${createObjectLiteral(reexports)})`);
360359
}
361360

362361
// create local module bindings
363362
if (moduleBinding) {
364363
setterStatements.push(
365-
parseStatement `${id(moduleBinding)} = $__m;`
366-
);
364+
parseStatement `${id(moduleBinding)} = $__m;`);
367365
}
368366

369367
// finally run export * if applying to this dependency, for not-already
370368
// exported dependencies
371369
if (exportStarBinding) {
372370
setterStatements = setterStatements.concat(parseStatements `
373-
var exportObj = {};
371+
var exportObj = Object.create(null);
374372
Object.keys($__m).forEach(function(p) {
375373
if (p !== 'default' && !$__exportNames[p])
376374
exportObj[p] = $__m[p];

0 commit comments

Comments
 (0)