Skip to content

Commit 21fb3bc

Browse files
committed
Update check for syntax tree existance
1 parent ab05b75 commit 21fb3bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ module ts {
392392
// the old syntax tree.
393393
var oldSyntaxTree = this.syntaxTree;
394394

395-
if (textChangeRange !== null && Debug.shouldAssert(AssertionLevel.Normal)) {
395+
if (textChangeRange && Debug.shouldAssert(AssertionLevel.Normal)) {
396396
var oldText = this.scriptSnapshot;
397397
var newText = scriptSnapshot;
398398

@@ -413,7 +413,7 @@ module ts {
413413

414414
// If we don't have a text change, or we don't have an old syntax tree, then do a full
415415
// parse. Otherwise, do an incremental parse.
416-
var newSyntaxTree = textChangeRange === null || oldSyntaxTree === null
416+
var newSyntaxTree = !textChangeRange || !oldSyntaxTree
417417
? TypeScript.Parser.parse(this.filename, text, this.languageVersion, TypeScript.isDTSFile(this.filename))
418418
: TypeScript.IncrementalParser.parse(oldSyntaxTree, textChangeRange, text);
419419

0 commit comments

Comments
 (0)