Skip to content

Commit fcdd2a7

Browse files
author
Andy Hanson
committed
Fix API baselines
1 parent e31b4e9 commit fcdd2a7

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

Jakefile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
386386
else {
387387
options += " --lib es5";
388388
}
389-
options += " --noUnusedLocals --noUnusedParameters";
389+
options += " --noUnusedLocals --noUnusedParameters --strictNullChecks";
390390

391391
var cmd = host + " " + compilerPath + " " + options + " ";
392392
cmd = cmd + sources.join(" ");

src/compiler/factory.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2792,7 +2792,7 @@ namespace ts {
27922792
/**
27932793
* Gets the constant value to emit for an expression.
27942794
*/
2795-
export function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression) {
2795+
export function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): string | number | undefined {
27962796
const emitNode = node.emitNode;
27972797
return emitNode && emitNode.constantValue;
27982798
}

src/compiler/sys.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace ts {
8282
declare const global: any;
8383
declare const __filename: string;
8484

85-
export function getNodeMajorVersion() {
85+
export function getNodeMajorVersion(): number | undefined {
8686
if (typeof process === "undefined") {
8787
return undefined;
8888
}

src/compiler/utilities.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3777,7 +3777,7 @@ namespace ts {
37773777
return overlapStart < overlapEnd;
37783778
}
37793779

3780-
export function textSpanOverlap(span1: TextSpan, span2: TextSpan) {
3780+
export function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined {
37813781
const overlapStart = Math.max(span1.start, span2.start);
37823782
const overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
37833783
if (overlapStart < overlapEnd) {
@@ -3805,7 +3805,7 @@ namespace ts {
38053805
return position <= textSpanEnd(span) && position >= span.start;
38063806
}
38073807

3808-
export function textSpanIntersection(span1: TextSpan, span2: TextSpan) {
3808+
export function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined {
38093809
const intersectStart = Math.max(span1.start, span2.start);
38103810
const intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
38113811
if (intersectStart <= intersectEnd) {

tests/baselines/reference/api/tsserverlibrary.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -2896,7 +2896,7 @@ declare namespace ts {
28962896
interface FileWatcher {
28972897
close(): void;
28982898
}
2899-
function getNodeMajorVersion(): number;
2899+
function getNodeMajorVersion(): number | undefined;
29002900
let sys: System;
29012901
}
29022902
declare namespace ts {
@@ -2906,12 +2906,12 @@ declare namespace ts {
29062906
function textSpanContainsPosition(span: TextSpan, position: number): boolean;
29072907
function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
29082908
function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
2909-
function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan;
2909+
function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
29102910
function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
29112911
function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
29122912
function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean;
29132913
function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
2914-
function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan;
2914+
function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
29152915
function createTextSpan(start: number, length: number): TextSpan;
29162916
function createTextSpanFromBounds(start: number, end: number): TextSpan;
29172917
function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
@@ -3797,7 +3797,7 @@ declare namespace ts {
37973797
/**
37983798
* Gets the constant value to emit for an expression.
37993799
*/
3800-
function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): string | number;
3800+
function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): string | number | undefined;
38013801
/**
38023802
* Sets the constant value to emit for an expression.
38033803
*/

0 commit comments

Comments
 (0)