From 1d61f869874eea27beb15c45e6beaf8a559fab1f Mon Sep 17 00:00:00 2001 From: aleclarson Date: Sun, 18 Nov 2018 16:35:58 -0500 Subject: [PATCH] create scope for parenL case --- src/transformers/CJSImportTransformer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transformers/CJSImportTransformer.ts b/src/transformers/CJSImportTransformer.ts index 3d531a18..e7df6a0c 100644 --- a/src/transformers/CJSImportTransformer.ts +++ b/src/transformers/CJSImportTransformer.ts @@ -186,7 +186,7 @@ export default class CJSImportTransformer extends Transformer { // use `Function.prototype.call` when the identifier is a guaranteed // function call. When using `call`, pass undefined as the context. switch (this.tokens.tokenAtRelativeIndex(1).type) { - case tt.parenL: + case tt.parenL: { // We can use `(0, f)` when the previous token is an open brace, // semicolon, or equal operator. const prevToken = this.tokens.tokenAtRelativeIndex(-1); @@ -204,6 +204,7 @@ export default class CJSImportTransformer extends Transformer { this.rootTransformer.processBalancedCode(0, 1); return true; } + } case tt.parenR: // See here: http://2ality.com/2015/12/references.html this.tokens.replaceToken(`(0, ${replacement})`);