diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 285787f12b..49cd37faf3 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -2118,7 +2118,7 @@ export default class ExpressionParser extends LValParser { // had before the function was called. withTopicPermittingContext(callback: () => T): T { - const outerContextTopicState = this.readTopicContextState(); + const outerContextTopicState = this.state.topicContextState; this.state.topicContextState = { // Enable the use of the primary topic reference. maxNumOfResolvableTopics: 1, @@ -2140,7 +2140,7 @@ export default class ExpressionParser extends LValParser { // had before the function was called. withTopicForbiddingContext(callback: () => T): T { - const outerContextTopicState = this.readTopicContextState(); + const outerContextTopicState = this.state.topicContextState; this.state.topicContextState = { // Disable the use of the primary topic reference. maxNumOfResolvableTopics: 0, @@ -2154,10 +2154,6 @@ export default class ExpressionParser extends LValParser { return callbackResult; } - readTopicContextState(): tt.TopicContextState { - return this.state.topicContextState; - } - // Register the use of a primary topic reference (`#`) within the current // topic context. registerTopicReference(): void {