From 3b298413efb1c2b4633980e399dcf9d06ebc5e4d Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Fri, 14 Jan 2022 11:36:32 -0800 Subject: [PATCH] Corresponding change in typescript's checkCommaAfterRest. Reviewed by @tolmasky. --- packages/babel-parser/src/plugins/typescript/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 1673c1e3e27f..e869bcf3d75d 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -3161,15 +3161,16 @@ export default (superClass: Class): Class => return super.parseMaybeDecoratorArguments(expr); } - checkCommaAfterRest(close) { + checkCommaAfterRest(close): boolean { if ( this.state.isAmbientContext && this.match(tt.comma) && this.lookaheadCharCode() === close ) { this.next(); + return false; } else { - super.checkCommaAfterRest(close); + return super.checkCommaAfterRest(close); } }