mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Rename addPrologueDirectives->addStandardPrologue
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user