From 48765ec9041b89c640652b11d47ddb2df5430f7b Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 10 Dec 2014 12:18:31 -0800 Subject: [PATCH] Update comment. --- src/compiler/types.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 07fc909a9aa..3bb937f6e69 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -871,13 +871,15 @@ module ts { getPositionFromLineAndCharacter(line: number, character: number): number; getLineStarts(): number[]; - // Updates this source file to represent the 'newText' passed in. The 'textChangeRange' - // parameter indicates what changed between the 'text' that this SourceFile has and the - // 'newText'. + // Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter + // indicates what changed between the 'text' that this SourceFile has and the 'newText'. + // The SourceFile will be created with the compiler attempting to reuse as many nodes from + // this file as possible. // // Note: this function mutates nodes from this SourceFile. That means any existing nodes // from this SourceFile that are being held onto may change as a result (including - // becoming detached from any SourceFile). + // becoming detached from any SourceFile). It is recommended that this SourceFile not + // be used once 'update' is called on it. update(newText: string, textChangeRange: TextChangeRange): SourceFile; amdDependencies: string[];