From 530917179892bb0dfd34af6f55d4a32c97cc42eb Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 25 Nov 2014 00:27:32 -0800 Subject: [PATCH] Rename methods as per CR feedback. --- src/compiler/parser.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 231120021e9..9da5d5cb111 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -946,7 +946,7 @@ module ts { return result; } - function enterYieldContextAnd(func: () => T): T { + function doInYieldContext(func: () => T): T { if (contextFlags & ParserContextFlags.ParsedInYieldContext) { // no need to do anything special if we're already in the [Yield] context. return func(); @@ -958,7 +958,7 @@ module ts { return result; } - function exitYieldContextAnd(func: () => T): T { + function doOutsideOfYieldContext(func: () => T): T { if (contextFlags & ParserContextFlags.ParsedInYieldContext) { setYieldContext(false); var result = func(); @@ -1639,7 +1639,7 @@ module ts { // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt node.name = inGeneratorParameterContext() - ? enterYieldContextAnd(parseIdentifier) + ? doInYieldContext(parseIdentifier) : parseIdentifier(); if (node.name.kind === SyntaxKind.Missing && node.flags === 0 && isModifier(token)) { @@ -1659,7 +1659,7 @@ module ts { } node.type = parseParameterType(); node.initializer = inGeneratorParameterContext() - ? exitYieldContextAnd(parseParameterInitializer) + ? doOutsideOfYieldContext(parseParameterInitializer) : parseParameterInitializer(); // Do not check for initializers in an ambient context for parameters. This is not @@ -2787,7 +2787,7 @@ module ts { var pos = getNodePos(); parseExpected(SyntaxKind.FunctionKeyword); var isGenerator = parseOptional(SyntaxKind.AsteriskToken); - var name = isGenerator ? enterYieldContextAnd(parseOptionalIdentifier) : parseOptionalIdentifier(); + var name = isGenerator ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*isGenerator:*/ isGenerator); var body = parseFunctionBlock(/*allowYield:*/ isGenerator, /* ignoreMissingOpenBrace */ false); @@ -3440,7 +3440,7 @@ module ts { // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } node.baseType = inGeneratorParameterContext() - ? exitYieldContextAnd(parseClassBaseType) + ? doOutsideOfYieldContext(parseClassBaseType) : parseClassBaseType(); if (parseOptional(SyntaxKind.ImplementsKeyword)) { @@ -3452,7 +3452,7 @@ module ts { // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } node.members = inGeneratorParameterContext() - ? exitYieldContextAnd(parseClassMembers) + ? doOutsideOfYieldContext(parseClassMembers) : parseClassMembers(); parseExpected(SyntaxKind.CloseBraceToken); }