Skip to content

Commit 7b55507

Browse files
committed
Merge branch 'release-1.5'
2 parents d17f13a + a24aa6f commit 7b55507

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

bin/tsserver.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35052,6 +35052,12 @@ var ts;
3505235052
var newSourceFile = ts.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
3505335053
setSourceFileFields(newSourceFile, scriptSnapshot, version);
3505435054
newSourceFile.nameTable = undefined;
35055+
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
35056+
if (sourceFile.scriptSnapshot.dispose) {
35057+
sourceFile.scriptSnapshot.dispose();
35058+
}
35059+
sourceFile.scriptSnapshot = undefined;
35060+
}
3505535061
return newSourceFile;
3505635062
}
3505735063
}

bin/typescript.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,8 @@ declare module "typescript" {
15911591
* not happen and the entire document will be re - parsed.
15921592
*/
15931593
getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange;
1594+
/** Releases all resources held by this script snapshot */
1595+
dispose?(): void;
15941596
}
15951597
module ScriptSnapshot {
15961598
function fromString(text: string): IScriptSnapshot;

bin/typescript.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41389,6 +41389,13 @@ var ts;
4138941389
// after incremental parsing nameTable might not be up-to-date
4139041390
// drop it so it can be lazily recreated later
4139141391
newSourceFile.nameTable = undefined;
41392+
// dispose all resources held by old script snapshot
41393+
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
41394+
if (sourceFile.scriptSnapshot.dispose) {
41395+
sourceFile.scriptSnapshot.dispose();
41396+
}
41397+
sourceFile.scriptSnapshot = undefined;
41398+
}
4139241399
return newSourceFile;
4139341400
}
4139441401
}
@@ -46760,6 +46767,13 @@ var ts;
4676046767
var decoded = JSON.parse(encoded);
4676146768
return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
4676246769
};
46770+
ScriptSnapshotShimAdapter.prototype.dispose = function () {
46771+
// if scriptSnapshotShim is a COM object then property check becomes method call with no arguments
46772+
// 'in' does not have this effect
46773+
if ("dispose" in this.scriptSnapshotShim) {
46774+
this.scriptSnapshotShim.dispose();
46775+
}
46776+
};
4676346777
return ScriptSnapshotShimAdapter;
4676446778
})();
4676546779
var LanguageServiceShimHostAdapter = (function () {

bin/typescriptServices.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,8 @@ declare namespace ts {
15911591
* not happen and the entire document will be re - parsed.
15921592
*/
15931593
getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange;
1594+
/** Releases all resources held by this script snapshot */
1595+
dispose?(): void;
15941596
}
15951597
module ScriptSnapshot {
15961598
function fromString(text: string): IScriptSnapshot;

bin/typescriptServices.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41389,6 +41389,13 @@ var ts;
4138941389
// after incremental parsing nameTable might not be up-to-date
4139041390
// drop it so it can be lazily recreated later
4139141391
newSourceFile.nameTable = undefined;
41392+
// dispose all resources held by old script snapshot
41393+
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
41394+
if (sourceFile.scriptSnapshot.dispose) {
41395+
sourceFile.scriptSnapshot.dispose();
41396+
}
41397+
sourceFile.scriptSnapshot = undefined;
41398+
}
4139241399
return newSourceFile;
4139341400
}
4139441401
}
@@ -46760,6 +46767,13 @@ var ts;
4676046767
var decoded = JSON.parse(encoded);
4676146768
return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
4676246769
};
46770+
ScriptSnapshotShimAdapter.prototype.dispose = function () {
46771+
// if scriptSnapshotShim is a COM object then property check becomes method call with no arguments
46772+
// 'in' does not have this effect
46773+
if ("dispose" in this.scriptSnapshotShim) {
46774+
this.scriptSnapshotShim.dispose();
46775+
}
46776+
};
4676346777
return ScriptSnapshotShimAdapter;
4676446778
})();
4676546779
var LanguageServiceShimHostAdapter = (function () {

0 commit comments

Comments
 (0)