Merge branch 'master' into preserveFormatting

Conflicts:
	tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js
This commit is contained in:
Cyrus Najmabadi
2015-03-08 19:47:34 -07:00
29 changed files with 84 additions and 29 deletions
+3
View File
@@ -5,6 +5,9 @@ module ts {
/* @internal */ export var emitTime = 0;
/* @internal */ export var ioReadTime = 0;
/** The version of the TypeScript compiler release */
export var version = "1.5.0.0";
export function createCompilerHost(options: CompilerOptions): CompilerHost {
var currentDirectory: string;
var existingDirectories: Map<boolean> = {};
+2 -4
View File
@@ -2,8 +2,6 @@
/// <reference path="commandLineParser.ts"/>
module ts {
var version = "1.5.0.0";
export interface SourceFile {
fileWatcher: FileWatcher;
}
@@ -178,7 +176,7 @@ module ts {
}
if (commandLine.options.version) {
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Version_0, version));
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Version_0, ts.version));
return sys.exit(ExitStatus.Success);
}
@@ -419,7 +417,7 @@ module ts {
}
function printVersion() {
sys.write(getDiagnosticText(Diagnostics.Version_0, version) + sys.newLine);
sys.write(getDiagnosticText(Diagnostics.Version_0, ts.version) + sys.newLine);
}
function printHelp() {
+1 -1
View File
@@ -1174,7 +1174,7 @@ module ts {
}
export function nodeIsSynthesized(node: Node): boolean {
return node.pos === -1 && node.end === -1;
return node.pos === -1;
}
export function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node {
+6
View File
@@ -410,6 +410,9 @@ interface String {
*/
substr(from: number, length?: number): string;
/** Returns the primitive value of the specified object. */
valueOf(): string;
[index: number]: string;
}
@@ -462,6 +465,9 @@ interface Number {
* @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
*/
toPrecision(precision?: number): string;
/** Returns the primitive value of the specified object. */
valueOf(): number;
}
interface NumberConstructor {
+1
View File
@@ -11,6 +11,7 @@
/// <reference path='formatting\smartIndenter.ts' />
module ts {
/** The version of the language service API */
export var servicesVersion = "0.4"
export interface Node {
@@ -1475,12 +1475,15 @@ declare module "typescript" {
function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker;
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
var version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
}
declare module "typescript" {
/** The version of the language service API */
var servicesVersion: string;
interface Node {
getSourceFile(): SourceFile;
@@ -4724,6 +4724,10 @@ declare module "typescript" {
>TypeChecker : TypeChecker
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
var version: string;
>version : string
function createCompilerHost(options: CompilerOptions): CompilerHost;
>createCompilerHost : (options: CompilerOptions) => CompilerHost
>options : CompilerOptions
@@ -4752,6 +4756,7 @@ declare module "typescript" {
>Program : Program
}
declare module "typescript" {
/** The version of the language service API */
var servicesVersion: string;
>servicesVersion : string
@@ -1506,12 +1506,15 @@ declare module "typescript" {
function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker;
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
var version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
}
declare module "typescript" {
/** The version of the language service API */
var servicesVersion: string;
interface Node {
getSourceFile(): SourceFile;
@@ -4870,6 +4870,10 @@ declare module "typescript" {
>TypeChecker : TypeChecker
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
var version: string;
>version : string
function createCompilerHost(options: CompilerOptions): CompilerHost;
>createCompilerHost : (options: CompilerOptions) => CompilerHost
>options : CompilerOptions
@@ -4898,6 +4902,7 @@ declare module "typescript" {
>Program : Program
}
declare module "typescript" {
/** The version of the language service API */
var servicesVersion: string;
>servicesVersion : string
@@ -1507,12 +1507,15 @@ declare module "typescript" {
function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker;
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
var version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
}
declare module "typescript" {
/** The version of the language service API */
var servicesVersion: string;
interface Node {
getSourceFile(): SourceFile;
@@ -4820,6 +4820,10 @@ declare module "typescript" {
>TypeChecker : TypeChecker
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
var version: string;
>version : string
function createCompilerHost(options: CompilerOptions): CompilerHost;
>createCompilerHost : (options: CompilerOptions) => CompilerHost
>options : CompilerOptions
@@ -4848,6 +4852,7 @@ declare module "typescript" {
>Program : Program
}
declare module "typescript" {
/** The version of the language service API */
var servicesVersion: string;
>servicesVersion : string
@@ -1544,12 +1544,15 @@ declare module "typescript" {
function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker;
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
var version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
}
declare module "typescript" {
/** The version of the language service API */
var servicesVersion: string;
interface Node {
getSourceFile(): SourceFile;
@@ -4993,6 +4993,10 @@ declare module "typescript" {
>TypeChecker : TypeChecker
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
var version: string;
>version : string
function createCompilerHost(options: CompilerOptions): CompilerHost;
>createCompilerHost : (options: CompilerOptions) => CompilerHost
>options : CompilerOptions
@@ -5021,6 +5025,7 @@ declare module "typescript" {
>Program : Program
}
declare module "typescript" {
/** The version of the language service API */
var servicesVersion: string;
>servicesVersion : string
@@ -1,5 +1,5 @@
tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(23,1): error TS2322: Type 'Number' is not assignable to type 'number'.
tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24,1): error TS2322: Type 'NotNumber' is not assignable to type 'number'.
tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24,1): error TS2322: Type 'Number' is not assignable to type 'number'.
tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(25,1): error TS2322: Type 'NotNumber' is not assignable to type 'number'.
==== tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts (2 errors) ====
@@ -12,6 +12,7 @@ tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24
toFixed(fractionDigits?: number): string;
toExponential(fractionDigits?: number): string;
toPrecision(precision?: number): string;
valueOf(): number;
doStuff(): string;
}
@@ -8,6 +8,7 @@ interface NotNumber {
toFixed(fractionDigits?: number): string;
toExponential(fractionDigits?: number): string;
toPrecision(precision?: number): string;
valueOf(): number;
doStuff(): string;
}
@@ -1,5 +1,5 @@
tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(46,1): error TS2322: Type 'String' is not assignable to type 'string'.
tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47,1): error TS2322: Type 'NotString' is not assignable to type 'string'.
tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47,1): error TS2322: Type 'String' is not assignable to type 'string'.
tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(48,1): error TS2322: Type 'NotString' is not assignable to type 'string'.
==== tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts (2 errors) ====
@@ -35,6 +35,7 @@ tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47
trim(): string;
length: number;
substr(from: number, length?: number): string;
valueOf(): string;
[index: number]: string;
}
@@ -31,6 +31,7 @@ interface NotString {
trim(): string;
length: number;
substr(from: number, length?: number): string;
valueOf(): string;
[index: number]: string;
}
@@ -1,13 +1,15 @@
tests/cases/compiler/booleanAssignment.ts(2,1): error TS2322: Type 'number' is not assignable to type 'Boolean'.
Types of property 'valueOf' are incompatible.
Type '() => Object' is not assignable to type '() => boolean'.
Type 'Object' is not assignable to type 'boolean'.
Type '() => number' is not assignable to type '() => boolean'.
Type 'number' is not assignable to type 'boolean'.
tests/cases/compiler/booleanAssignment.ts(3,1): error TS2322: Type 'string' is not assignable to type 'Boolean'.
Types of property 'valueOf' are incompatible.
Type '() => Object' is not assignable to type '() => boolean'.
Type '() => string' is not assignable to type '() => boolean'.
Type 'string' is not assignable to type 'boolean'.
tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not assignable to type 'Boolean'.
Types of property 'valueOf' are incompatible.
Type '() => Object' is not assignable to type '() => boolean'.
Type 'Object' is not assignable to type 'boolean'.
==== tests/cases/compiler/booleanAssignment.ts (3 errors) ====
@@ -16,18 +18,20 @@ tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not a
~
!!! error TS2322: Type 'number' is not assignable to type 'Boolean'.
!!! error TS2322: Types of property 'valueOf' are incompatible.
!!! error TS2322: Type '() => Object' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'Object' is not assignable to type 'boolean'.
!!! error TS2322: Type '() => number' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
b = "a"; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'Boolean'.
!!! error TS2322: Types of property 'valueOf' are incompatible.
!!! error TS2322: Type '() => Object' is not assignable to type '() => boolean'.
!!! error TS2322: Type '() => string' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
b = {}; // Error
~
!!! error TS2322: Type '{}' is not assignable to type 'Boolean'.
!!! error TS2322: Types of property 'valueOf' are incompatible.
!!! error TS2322: Type '() => Object' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'Object' is not assignable to type 'boolean'.
var o = {};
o = b; // OK
@@ -3,14 +3,14 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLite
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(30,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(34,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(38,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(76,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(89,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(93,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(77,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(90,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(94,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(95,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(97,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(96,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(98,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(99,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(100,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts (13 errors) ====
@@ -86,6 +86,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLite
trim(): string { return null; }
length: number;
substr(from: number, length?: number): string { return null; }
valueOf(): string { return null; }
[index: number]: string;
}
@@ -61,6 +61,7 @@ class C implements String {
trim(): string { return null; }
length: number;
substr(from: number, length?: number): string { return null; }
valueOf(): string { return null; }
[index: number]: string;
}
@@ -183,6 +184,9 @@ var C = (function () {
C.prototype.substr = function (from, length) {
return null;
};
C.prototype.valueOf = function () {
return null;
};
return C;
})();
function f10(x) {
@@ -1,4 +1,4 @@
lib.d.ts(515,11): error TS2300: Duplicate identifier 'TemplateStringsArray'.
lib.d.ts(521,11): error TS2300: Duplicate identifier 'TemplateStringsArray'.
tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(2,7): error TS2300: Duplicate identifier 'TemplateStringsArray'.
tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(8,3): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'.
Property 'raw' is missing in type '{ [x: number]: undefined; }'.
@@ -1,4 +1,4 @@
lib.d.ts(515,11): error TS2300: Duplicate identifier 'TemplateStringsArray'.
lib.d.ts(521,11): error TS2300: Duplicate identifier 'TemplateStringsArray'.
tests/cases/compiler/templateStringsArrayTypeRedefinedInES6Mode.ts(2,7): error TS2300: Duplicate identifier 'TemplateStringsArray'.
tests/cases/compiler/templateStringsArrayTypeRedefinedInES6Mode.ts(8,3): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'.
Property 'raw' is missing in type '{ [x: number]: undefined; }'.
@@ -7,6 +7,7 @@ interface NotNumber {
toFixed(fractionDigits?: number): string;
toExponential(fractionDigits?: number): string;
toPrecision(precision?: number): string;
valueOf(): number;
doStuff(): string;
}
@@ -30,6 +30,7 @@ interface NotString {
trim(): string;
length: number;
substr(from: number, length?: number): string;
valueOf(): string;
[index: number]: string;
}
@@ -60,6 +60,7 @@ class C implements String {
trim(): string { return null; }
length: number;
substr(from: number, length?: number): string { return null; }
valueOf(): string { return null; }
[index: number]: string;
}
@@ -16,4 +16,5 @@
goTo.marker();
verify.memberListContains("toString", "(method) toString(): string");
verify.memberListCount(1);
verify.memberListContains("valueOf", "(method) valueOf(): string | number");
verify.memberListCount(2);
@@ -21,4 +21,4 @@ verify.memberListCount(0);
goTo.marker('enumValueReference');
verify.memberListContains("toString");
verify.memberListContains("toFixed");
verify.memberListCount(4);
verify.memberListCount(5);
@@ -7,11 +7,10 @@
goTo.marker('1');
edit.insert('.');
verify.memberListContains('trim');
verify.memberListCount(20);
verify.memberListCount(21);
edit.insert('});'); // need the following lines to not have parse errors in order for completion list to appear
goTo.marker('2');
edit.insert('.');
verify.memberListContains('trim');
verify.memberListCount(20);
verify.memberListCount(21);
+2 -3
View File
@@ -7,11 +7,10 @@
goTo.marker('1');
edit.insert('.');
verify.memberListContains('trim');
verify.memberListCount(20);
verify.memberListCount(21);
edit.insert('});'); // need the following lines to not have parse errors in order for completion list to appear
goTo.marker('2');
edit.insert('.');
verify.memberListContains('trim');
verify.memberListCount(20);
verify.memberListCount(21);