Rename addPrologueDirectives->addStandardPrologue

This commit is contained in:
Nathan Shively-Sanders
2017-04-13 13:21:56 -07:00
parent b2199bd23c
commit 58a6c92c29
2 changed files with 6 additions and 6 deletions

View File

@@ -3059,7 +3059,7 @@ namespace ts {
* @param visitor: Optional callback used to visit any custom prologue directives.
*/
export function addPrologue(target: Statement[], source: Statement[], ensureUseStrict?: boolean, visitor?: (node: Node) => VisitResult<Node>): number {
const offset = addPrologueDirectives(target, source, ensureUseStrict);
const offset = addStandardPrologue(target, source, ensureUseStrict);
return addCustomPrologue(target, source, offset, visitor);
}
@@ -3069,7 +3069,7 @@ namespace ts {
* This function needs to be called whenever we transform the statement
* list of a source file, namespace, or function-like body.
*/
export function addPrologueDirectives(target: Statement[], source: Statement[], ensureUseStrict?: boolean): number {
export function addStandardPrologue(target: Statement[], source: Statement[], ensureUseStrict?: boolean): number {
Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array");
let foundUseStrict = false;
let statementOffset = 0;

View File

@@ -515,7 +515,7 @@ namespace ts {
const ancestorFacts = enterSubtree(HierarchyFacts.SourceFileExcludes, HierarchyFacts.SourceFileIncludes);
const statements: Statement[] = [];
startLexicalEnvironment();
let statementOffset = addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ false);
let statementOffset = addStandardPrologue(statements, node.statements, /*ensureUseStrict*/ false);
addCaptureThisForNodeIfNeeded(statements, node);
statementOffset = addCustomPrologue(statements, node.statements, statementOffset, visitor);
addRange(statements, visitNodes(node.statements, visitor, isStatement, statementOffset));
@@ -925,7 +925,7 @@ namespace ts {
statementOffset = 0;
}
else if (constructor) {
statementOffset = addPrologueDirectives(statements, constructor.body.statements, /*ensureUseStrict*/ false);
statementOffset = addStandardPrologue(statements, constructor.body.statements, /*ensureUseStrict*/ false);
}
if (constructor) {
@@ -1825,8 +1825,8 @@ namespace ts {
resumeLexicalEnvironment();
if (isBlock(body)) {
// ensureUseStrict is false because no new prologue-directive should be added.
// addPrologueDirectives will put already-existing directives at the beginning of the target statement-array
statementOffset = addPrologueDirectives(statements, body.statements, /*ensureUseStrict*/ false);
// addStandardPrologue will put already-existing directives at the beginning of the target statement-array
statementOffset = addStandardPrologue(statements, body.statements, /*ensureUseStrict*/ false);
}
addCaptureThisForNodeIfNeeded(statements, node);