From 7931f4c241fbde60b38ba589f879f42dc83d9543 Mon Sep 17 00:00:00 2001 From: James DiGioia Date: Thu, 12 Jul 2018 23:11:55 -0400 Subject: [PATCH] Rename topicContextState -> .topicContext --- .../babel-parser/src/parser/expression.js | 20 +++++++++---------- packages/babel-parser/src/tokenizer/state.js | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 49cd37faf3..c71b952ad1 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -2118,8 +2118,8 @@ export default class ExpressionParser extends LValParser { // had before the function was called. withTopicPermittingContext(callback: () => T): T { - const outerContextTopicState = this.state.topicContextState; - this.state.topicContextState = { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { // Enable the use of the primary topic reference. maxNumOfResolvableTopics: 1, // Hide the use of any topic references from outer contexts. @@ -2128,7 +2128,7 @@ export default class ExpressionParser extends LValParser { const callbackResult = callback(); - this.state.topicContextState = outerContextTopicState; + this.state.topicContext = outerContextTopicState; return callbackResult; } @@ -2140,8 +2140,8 @@ export default class ExpressionParser extends LValParser { // had before the function was called. withTopicForbiddingContext(callback: () => T): T { - const outerContextTopicState = this.state.topicContextState; - this.state.topicContextState = { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { // Disable the use of the primary topic reference. maxNumOfResolvableTopics: 0, // Hide the use of any topic references from outer contexts. @@ -2150,24 +2150,24 @@ export default class ExpressionParser extends LValParser { const callbackResult = callback(); - this.state.topicContextState = outerContextTopicState; + this.state.topicContext = outerContextTopicState; return callbackResult; } // Register the use of a primary topic reference (`#`) within the current // topic context. registerTopicReference(): void { - this.state.topicContextState.maxTopicIndex = 0; + this.state.topicContext.maxTopicIndex = 0; } primaryTopicReferenceIsAllowedInCurrentTopicContext(): boolean { - return this.state.topicContextState.maxNumOfResolvableTopics >= 1; + return this.state.topicContext.maxNumOfResolvableTopics >= 1; } topicReferenceWasUsedInCurrentTopicContext(): boolean { return ( - this.state.topicContextState.maxTopicIndex != null && - this.state.topicContextState.maxTopicIndex >= 0 + this.state.topicContext.maxTopicIndex != null && + this.state.topicContext.maxTopicIndex >= 0 ); } } diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index 536d815924..c520f43883 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -34,7 +34,7 @@ export default class State { this.isIterator = false; // Used by smartPipelines. - this.topicContextState = { + this.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: undefined, };