mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update LKG
This commit is contained in:
Vendored
+30
-2
@@ -3928,6 +3928,7 @@ declare module Intl {
|
||||
timeZoneName?: string;
|
||||
formatMatcher?: string;
|
||||
hour12?: boolean;
|
||||
timeZone?: string;
|
||||
}
|
||||
|
||||
interface ResolvedDateTimeFormatOptions {
|
||||
@@ -3997,18 +3998,45 @@ interface Number {
|
||||
|
||||
interface Date {
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* Converts a date and time to a string by using the current or specified locale.
|
||||
* @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleDateString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleTimeString(locale?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a date and time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
toLocaleDateString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleTimeString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+30
-2
@@ -104,6 +104,7 @@ declare module Intl {
|
||||
timeZoneName?: string;
|
||||
formatMatcher?: string;
|
||||
hour12?: boolean;
|
||||
timeZone?: string;
|
||||
}
|
||||
|
||||
interface ResolvedDateTimeFormatOptions {
|
||||
@@ -173,18 +174,45 @@ interface Number {
|
||||
|
||||
interface Date {
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* Converts a date and time to a string by using the current or specified locale.
|
||||
* @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleDateString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleTimeString(locale?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a date and time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
toLocaleDateString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleTimeString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+30
-2
@@ -5216,6 +5216,7 @@ declare module Intl {
|
||||
timeZoneName?: string;
|
||||
formatMatcher?: string;
|
||||
hour12?: boolean;
|
||||
timeZone?: string;
|
||||
}
|
||||
|
||||
interface ResolvedDateTimeFormatOptions {
|
||||
@@ -5285,18 +5286,45 @@ interface Number {
|
||||
|
||||
interface Date {
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* Converts a date and time to a string by using the current or specified locale.
|
||||
* @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleDateString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleTimeString(locale?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a date and time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
toLocaleDateString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleTimeString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+30
-2
@@ -104,6 +104,7 @@ declare module Intl {
|
||||
timeZoneName?: string;
|
||||
formatMatcher?: string;
|
||||
hour12?: boolean;
|
||||
timeZone?: string;
|
||||
}
|
||||
|
||||
interface ResolvedDateTimeFormatOptions {
|
||||
@@ -173,18 +174,45 @@ interface Number {
|
||||
|
||||
interface Date {
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* Converts a date and time to a string by using the current or specified locale.
|
||||
* @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleDateString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleTimeString(locale?: string[], options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a date and time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a date to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
toLocaleDateString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
|
||||
/**
|
||||
* Converts a time to a string by using the current or specified locale.
|
||||
* @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
||||
* @param options An object that contains one or more properties that specify comparison options.
|
||||
*/
|
||||
toLocaleTimeString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+75
-68
@@ -1564,13 +1564,14 @@ var ts;
|
||||
Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." },
|
||||
NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" },
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
Argument_for_moduleResolution_option_must_be_node_or_classic: { code: 6063, category: ts.DiagnosticCategory.Error, key: "Argument for '--moduleResolution' option must be 'node' or 'classic'." },
|
||||
Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify JSX code generation: 'preserve' or 'react'" },
|
||||
Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument for '--jsx' must be 'preserve' or 'react'." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Option_experimentalAsyncFunctions_cannot_be_specified_when_targeting_ES5_or_lower: { code: 6067, category: ts.DiagnosticCategory.Message, key: "Option 'experimentalAsyncFunctions' cannot be specified when targeting ES5 or lower." },
|
||||
Enables_experimental_support_for_ES7_async_functions: { code: 6068, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 async functions." },
|
||||
Specifies_module_resolution_strategy_Colon_node_Node_or_classic_TypeScript_pre_1_6: { code: 6069, category: ts.DiagnosticCategory.Message, key: "Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6) ." },
|
||||
Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: { code: 6069, category: ts.DiagnosticCategory.Message, key: "Specifies module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)." },
|
||||
Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes a TypeScript project and creates a tsconfig.json file." },
|
||||
Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully created a tsconfig.json file." },
|
||||
Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress excess property checks for object literals." },
|
||||
@@ -14049,6 +14050,7 @@ var ts;
|
||||
var prop = _a[_i];
|
||||
if (!isKnownProperty(target, prop.name)) {
|
||||
if (reportErrors) {
|
||||
errorNode = prop.valueDeclaration;
|
||||
reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target));
|
||||
}
|
||||
return true;
|
||||
@@ -20970,7 +20972,10 @@ var ts;
|
||||
var symbols = [];
|
||||
var name_15 = symbol.name;
|
||||
ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) {
|
||||
symbols.push(getPropertyOfType(t, name_15));
|
||||
var symbol = getPropertyOfType(t, name_15);
|
||||
if (symbol) {
|
||||
symbols.push(symbol);
|
||||
}
|
||||
});
|
||||
return symbols;
|
||||
}
|
||||
@@ -24505,8 +24510,10 @@ var ts;
|
||||
function jsxEmitPreserve(node) {
|
||||
function emitJsxAttribute(node) {
|
||||
emit(node.name);
|
||||
write("=");
|
||||
emit(node.initializer);
|
||||
if (node.initializer) {
|
||||
write("=");
|
||||
emit(node.initializer);
|
||||
}
|
||||
}
|
||||
function emitJsxSpreadAttribute(node) {
|
||||
write("{...");
|
||||
@@ -26029,19 +26036,19 @@ var ts;
|
||||
write(")");
|
||||
}
|
||||
}
|
||||
function ensureIdentifier(expr) {
|
||||
if (expr.kind !== 67) {
|
||||
var identifier = createTempVariable(0);
|
||||
if (!canDefineTempVariablesInPlace) {
|
||||
recordTempDeclaration(identifier);
|
||||
}
|
||||
emitAssignment(identifier, expr);
|
||||
expr = identifier;
|
||||
function ensureIdentifier(expr, reuseIdentifierExpressions) {
|
||||
if (expr.kind === 67 && reuseIdentifierExpressions) {
|
||||
return expr;
|
||||
}
|
||||
return expr;
|
||||
var identifier = createTempVariable(0);
|
||||
if (!canDefineTempVariablesInPlace) {
|
||||
recordTempDeclaration(identifier);
|
||||
}
|
||||
emitAssignment(identifier, expr);
|
||||
return identifier;
|
||||
}
|
||||
function createDefaultValueCheck(value, defaultValue) {
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, true);
|
||||
var equals = ts.createSynthesizedNode(179);
|
||||
equals.left = value;
|
||||
equals.operatorToken = ts.createSynthesizedNode(32);
|
||||
@@ -26082,7 +26089,7 @@ var ts;
|
||||
function emitObjectLiteralAssignment(target, value) {
|
||||
var properties = target.properties;
|
||||
if (properties.length !== 1) {
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, true);
|
||||
}
|
||||
for (var _a = 0; _a < properties.length; _a++) {
|
||||
var p = properties[_a];
|
||||
@@ -26095,7 +26102,7 @@ var ts;
|
||||
function emitArrayLiteralAssignment(target, value) {
|
||||
var elements = target.elements;
|
||||
if (elements.length !== 1) {
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, true);
|
||||
}
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var e = elements[i];
|
||||
@@ -26137,7 +26144,7 @@ var ts;
|
||||
if (root.parent.kind !== 170) {
|
||||
write("(");
|
||||
}
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, true);
|
||||
emitDestructuringAssignment(target, value);
|
||||
write(", ");
|
||||
emit(value);
|
||||
@@ -26156,10 +26163,11 @@ var ts;
|
||||
if (ts.isBindingPattern(target.name)) {
|
||||
var pattern = target.name;
|
||||
var elements = pattern.elements;
|
||||
if (elements.length !== 1) {
|
||||
value = ensureIdentifier(value);
|
||||
var numElements = elements.length;
|
||||
if (numElements !== 1) {
|
||||
value = ensureIdentifier(value, numElements !== 0);
|
||||
}
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
for (var i = 0; i < numElements; i++) {
|
||||
var element = elements[i];
|
||||
if (pattern.kind === 159) {
|
||||
var propName = element.propertyName || element.name;
|
||||
@@ -26169,7 +26177,7 @@ var ts;
|
||||
if (!element.dotDotDotToken) {
|
||||
emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i)));
|
||||
}
|
||||
else if (i === elements.length - 1) {
|
||||
else if (i === numElements - 1) {
|
||||
emitBindingElement(element, createSliceCall(value, i));
|
||||
}
|
||||
}
|
||||
@@ -27289,50 +27297,49 @@ var ts;
|
||||
write("void 0");
|
||||
}
|
||||
function emitSerializedTypeNode(node) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
switch (node.kind) {
|
||||
case 101:
|
||||
write("void 0");
|
||||
return;
|
||||
case 158:
|
||||
emitSerializedTypeNode(node.type);
|
||||
return;
|
||||
case 150:
|
||||
case 151:
|
||||
write("Function");
|
||||
return;
|
||||
case 154:
|
||||
case 155:
|
||||
write("Array");
|
||||
return;
|
||||
case 148:
|
||||
case 118:
|
||||
write("Boolean");
|
||||
return;
|
||||
case 128:
|
||||
case 9:
|
||||
write("String");
|
||||
return;
|
||||
case 126:
|
||||
write("Number");
|
||||
return;
|
||||
case 129:
|
||||
write("Symbol");
|
||||
return;
|
||||
case 149:
|
||||
emitSerializedTypeReferenceNode(node);
|
||||
return;
|
||||
case 152:
|
||||
case 153:
|
||||
case 156:
|
||||
case 157:
|
||||
case 115:
|
||||
break;
|
||||
default:
|
||||
ts.Debug.fail("Cannot serialize unexpected type node.");
|
||||
break;
|
||||
if (node) {
|
||||
switch (node.kind) {
|
||||
case 101:
|
||||
write("void 0");
|
||||
return;
|
||||
case 158:
|
||||
emitSerializedTypeNode(node.type);
|
||||
return;
|
||||
case 150:
|
||||
case 151:
|
||||
write("Function");
|
||||
return;
|
||||
case 154:
|
||||
case 155:
|
||||
write("Array");
|
||||
return;
|
||||
case 148:
|
||||
case 118:
|
||||
write("Boolean");
|
||||
return;
|
||||
case 128:
|
||||
case 9:
|
||||
write("String");
|
||||
return;
|
||||
case 126:
|
||||
write("Number");
|
||||
return;
|
||||
case 129:
|
||||
write("Symbol");
|
||||
return;
|
||||
case 149:
|
||||
emitSerializedTypeReferenceNode(node);
|
||||
return;
|
||||
case 152:
|
||||
case 153:
|
||||
case 156:
|
||||
case 157:
|
||||
case 115:
|
||||
break;
|
||||
default:
|
||||
ts.Debug.fail("Cannot serialize unexpected type node.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
write("Object");
|
||||
}
|
||||
@@ -29332,7 +29339,7 @@ var ts;
|
||||
ts.ioReadTime = 0;
|
||||
ts.ioWriteTime = 0;
|
||||
var emptyArray = [];
|
||||
ts.version = "1.6.0";
|
||||
ts.version = "1.6.2";
|
||||
function findConfigFile(searchPath) {
|
||||
var fileName = "tsconfig.json";
|
||||
while (true) {
|
||||
@@ -30397,8 +30404,8 @@ var ts;
|
||||
"node": 2,
|
||||
"classic": 1
|
||||
},
|
||||
experimental: true,
|
||||
description: ts.Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_or_classic_TypeScript_pre_1_6
|
||||
description: ts.Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
|
||||
error: ts.Diagnostics.Argument_for_moduleResolution_option_must_be_node_or_classic
|
||||
}
|
||||
];
|
||||
var optionNameMapCache;
|
||||
|
||||
+132
-83
@@ -1564,13 +1564,14 @@ var ts;
|
||||
Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." },
|
||||
NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" },
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
Argument_for_moduleResolution_option_must_be_node_or_classic: { code: 6063, category: ts.DiagnosticCategory.Error, key: "Argument for '--moduleResolution' option must be 'node' or 'classic'." },
|
||||
Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify JSX code generation: 'preserve' or 'react'" },
|
||||
Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument for '--jsx' must be 'preserve' or 'react'." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Option_experimentalAsyncFunctions_cannot_be_specified_when_targeting_ES5_or_lower: { code: 6067, category: ts.DiagnosticCategory.Message, key: "Option 'experimentalAsyncFunctions' cannot be specified when targeting ES5 or lower." },
|
||||
Enables_experimental_support_for_ES7_async_functions: { code: 6068, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 async functions." },
|
||||
Specifies_module_resolution_strategy_Colon_node_Node_or_classic_TypeScript_pre_1_6: { code: 6069, category: ts.DiagnosticCategory.Message, key: "Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6) ." },
|
||||
Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: { code: 6069, category: ts.DiagnosticCategory.Message, key: "Specifies module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)." },
|
||||
Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes a TypeScript project and creates a tsconfig.json file." },
|
||||
Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully created a tsconfig.json file." },
|
||||
Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress excess property checks for object literals." },
|
||||
@@ -3223,8 +3224,8 @@ var ts;
|
||||
"node": 2,
|
||||
"classic": 1
|
||||
},
|
||||
experimental: true,
|
||||
description: ts.Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_or_classic_TypeScript_pre_1_6
|
||||
description: ts.Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
|
||||
error: ts.Diagnostics.Argument_for_moduleResolution_option_must_be_node_or_classic
|
||||
}
|
||||
];
|
||||
var optionNameMapCache;
|
||||
@@ -14511,6 +14512,7 @@ var ts;
|
||||
var prop = _a[_i];
|
||||
if (!isKnownProperty(target, prop.name)) {
|
||||
if (reportErrors) {
|
||||
errorNode = prop.valueDeclaration;
|
||||
reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target));
|
||||
}
|
||||
return true;
|
||||
@@ -21432,7 +21434,10 @@ var ts;
|
||||
var symbols = [];
|
||||
var name_16 = symbol.name;
|
||||
ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) {
|
||||
symbols.push(getPropertyOfType(t, name_16));
|
||||
var symbol = getPropertyOfType(t, name_16);
|
||||
if (symbol) {
|
||||
symbols.push(symbol);
|
||||
}
|
||||
});
|
||||
return symbols;
|
||||
}
|
||||
@@ -24967,8 +24972,10 @@ var ts;
|
||||
function jsxEmitPreserve(node) {
|
||||
function emitJsxAttribute(node) {
|
||||
emit(node.name);
|
||||
write("=");
|
||||
emit(node.initializer);
|
||||
if (node.initializer) {
|
||||
write("=");
|
||||
emit(node.initializer);
|
||||
}
|
||||
}
|
||||
function emitJsxSpreadAttribute(node) {
|
||||
write("{...");
|
||||
@@ -26491,19 +26498,19 @@ var ts;
|
||||
write(")");
|
||||
}
|
||||
}
|
||||
function ensureIdentifier(expr) {
|
||||
if (expr.kind !== 67) {
|
||||
var identifier = createTempVariable(0);
|
||||
if (!canDefineTempVariablesInPlace) {
|
||||
recordTempDeclaration(identifier);
|
||||
}
|
||||
emitAssignment(identifier, expr);
|
||||
expr = identifier;
|
||||
function ensureIdentifier(expr, reuseIdentifierExpressions) {
|
||||
if (expr.kind === 67 && reuseIdentifierExpressions) {
|
||||
return expr;
|
||||
}
|
||||
return expr;
|
||||
var identifier = createTempVariable(0);
|
||||
if (!canDefineTempVariablesInPlace) {
|
||||
recordTempDeclaration(identifier);
|
||||
}
|
||||
emitAssignment(identifier, expr);
|
||||
return identifier;
|
||||
}
|
||||
function createDefaultValueCheck(value, defaultValue) {
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, true);
|
||||
var equals = ts.createSynthesizedNode(179);
|
||||
equals.left = value;
|
||||
equals.operatorToken = ts.createSynthesizedNode(32);
|
||||
@@ -26544,7 +26551,7 @@ var ts;
|
||||
function emitObjectLiteralAssignment(target, value) {
|
||||
var properties = target.properties;
|
||||
if (properties.length !== 1) {
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, true);
|
||||
}
|
||||
for (var _a = 0; _a < properties.length; _a++) {
|
||||
var p = properties[_a];
|
||||
@@ -26557,7 +26564,7 @@ var ts;
|
||||
function emitArrayLiteralAssignment(target, value) {
|
||||
var elements = target.elements;
|
||||
if (elements.length !== 1) {
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, true);
|
||||
}
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var e = elements[i];
|
||||
@@ -26599,7 +26606,7 @@ var ts;
|
||||
if (root.parent.kind !== 170) {
|
||||
write("(");
|
||||
}
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, true);
|
||||
emitDestructuringAssignment(target, value);
|
||||
write(", ");
|
||||
emit(value);
|
||||
@@ -26618,10 +26625,11 @@ var ts;
|
||||
if (ts.isBindingPattern(target.name)) {
|
||||
var pattern = target.name;
|
||||
var elements = pattern.elements;
|
||||
if (elements.length !== 1) {
|
||||
value = ensureIdentifier(value);
|
||||
var numElements = elements.length;
|
||||
if (numElements !== 1) {
|
||||
value = ensureIdentifier(value, numElements !== 0);
|
||||
}
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
for (var i = 0; i < numElements; i++) {
|
||||
var element = elements[i];
|
||||
if (pattern.kind === 159) {
|
||||
var propName = element.propertyName || element.name;
|
||||
@@ -26631,7 +26639,7 @@ var ts;
|
||||
if (!element.dotDotDotToken) {
|
||||
emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i)));
|
||||
}
|
||||
else if (i === elements.length - 1) {
|
||||
else if (i === numElements - 1) {
|
||||
emitBindingElement(element, createSliceCall(value, i));
|
||||
}
|
||||
}
|
||||
@@ -27751,50 +27759,49 @@ var ts;
|
||||
write("void 0");
|
||||
}
|
||||
function emitSerializedTypeNode(node) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
switch (node.kind) {
|
||||
case 101:
|
||||
write("void 0");
|
||||
return;
|
||||
case 158:
|
||||
emitSerializedTypeNode(node.type);
|
||||
return;
|
||||
case 150:
|
||||
case 151:
|
||||
write("Function");
|
||||
return;
|
||||
case 154:
|
||||
case 155:
|
||||
write("Array");
|
||||
return;
|
||||
case 148:
|
||||
case 118:
|
||||
write("Boolean");
|
||||
return;
|
||||
case 128:
|
||||
case 9:
|
||||
write("String");
|
||||
return;
|
||||
case 126:
|
||||
write("Number");
|
||||
return;
|
||||
case 129:
|
||||
write("Symbol");
|
||||
return;
|
||||
case 149:
|
||||
emitSerializedTypeReferenceNode(node);
|
||||
return;
|
||||
case 152:
|
||||
case 153:
|
||||
case 156:
|
||||
case 157:
|
||||
case 115:
|
||||
break;
|
||||
default:
|
||||
ts.Debug.fail("Cannot serialize unexpected type node.");
|
||||
break;
|
||||
if (node) {
|
||||
switch (node.kind) {
|
||||
case 101:
|
||||
write("void 0");
|
||||
return;
|
||||
case 158:
|
||||
emitSerializedTypeNode(node.type);
|
||||
return;
|
||||
case 150:
|
||||
case 151:
|
||||
write("Function");
|
||||
return;
|
||||
case 154:
|
||||
case 155:
|
||||
write("Array");
|
||||
return;
|
||||
case 148:
|
||||
case 118:
|
||||
write("Boolean");
|
||||
return;
|
||||
case 128:
|
||||
case 9:
|
||||
write("String");
|
||||
return;
|
||||
case 126:
|
||||
write("Number");
|
||||
return;
|
||||
case 129:
|
||||
write("Symbol");
|
||||
return;
|
||||
case 149:
|
||||
emitSerializedTypeReferenceNode(node);
|
||||
return;
|
||||
case 152:
|
||||
case 153:
|
||||
case 156:
|
||||
case 157:
|
||||
case 115:
|
||||
break;
|
||||
default:
|
||||
ts.Debug.fail("Cannot serialize unexpected type node.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
write("Object");
|
||||
}
|
||||
@@ -29794,7 +29801,7 @@ var ts;
|
||||
ts.ioReadTime = 0;
|
||||
ts.ioWriteTime = 0;
|
||||
var emptyArray = [];
|
||||
ts.version = "1.6.0";
|
||||
ts.version = "1.6.2";
|
||||
function findConfigFile(searchPath) {
|
||||
var fileName = "tsconfig.json";
|
||||
while (true) {
|
||||
@@ -32681,7 +32688,7 @@ var ts;
|
||||
function findPrecedingToken(position, sourceFile, startNode) {
|
||||
return find(startNode || sourceFile);
|
||||
function findRightmostToken(n) {
|
||||
if (isToken(n)) {
|
||||
if (isToken(n) || n.kind === 234) {
|
||||
return n;
|
||||
}
|
||||
var children = n.getChildren();
|
||||
@@ -32689,21 +32696,22 @@ var ts;
|
||||
return candidate && findRightmostToken(candidate);
|
||||
}
|
||||
function find(n) {
|
||||
if (isToken(n)) {
|
||||
if (isToken(n) || n.kind === 234) {
|
||||
return n;
|
||||
}
|
||||
var children = n.getChildren();
|
||||
for (var i = 0, len = children.length; i < len; i++) {
|
||||
var child = children[i];
|
||||
if (nodeHasTokens(child)) {
|
||||
if (position <= child.end) {
|
||||
if (child.getStart(sourceFile) >= position) {
|
||||
var candidate = findRightmostChildNodeWithTokens(children, i);
|
||||
return candidate && findRightmostToken(candidate);
|
||||
}
|
||||
else {
|
||||
return find(child);
|
||||
}
|
||||
if (position < child.end && (nodeHasTokens(child) || child.kind === 234)) {
|
||||
var start = child.getStart(sourceFile);
|
||||
var lookInPreviousChild = (start >= position) ||
|
||||
(child.kind === 234 && start === child.end);
|
||||
if (lookInPreviousChild) {
|
||||
var candidate = findRightmostChildNodeWithTokens(children, i);
|
||||
return candidate && findRightmostToken(candidate);
|
||||
}
|
||||
else {
|
||||
return find(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33143,6 +33151,18 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function shouldRescanJsxIdentifier(node) {
|
||||
if (node.parent) {
|
||||
switch (node.parent.kind) {
|
||||
case 236:
|
||||
case 233:
|
||||
case 235:
|
||||
case 232:
|
||||
return node.kind === 67;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function shouldRescanSlashToken(container) {
|
||||
return container.kind === 10;
|
||||
}
|
||||
@@ -33167,7 +33187,9 @@ var ts;
|
||||
? 2
|
||||
: shouldRescanTemplateToken(n)
|
||||
? 3
|
||||
: 0;
|
||||
: shouldRescanJsxIdentifier(n)
|
||||
? 4
|
||||
: 0;
|
||||
if (lastTokenInfo && expectedScanAction === lastScanAction) {
|
||||
return fixTokenKind(lastTokenInfo, n);
|
||||
}
|
||||
@@ -33191,6 +33213,10 @@ var ts;
|
||||
currentToken = scanner.reScanTemplateToken();
|
||||
lastScanAction = 3;
|
||||
}
|
||||
else if (expectedScanAction === 4 && currentToken === 67) {
|
||||
currentToken = scanner.scanJsxIdentifier();
|
||||
lastScanAction = 4;
|
||||
}
|
||||
else {
|
||||
lastScanAction = 0;
|
||||
}
|
||||
@@ -33469,7 +33495,7 @@ var ts;
|
||||
this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBeforeBlockInFunctionDeclarationContext), 8));
|
||||
this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments;
|
||||
this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
|
||||
this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([67, 3]);
|
||||
this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([67, 3, 71]);
|
||||
this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
|
||||
this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([18, 3, 77, 98, 83, 78]);
|
||||
this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1);
|
||||
@@ -33536,6 +33562,8 @@ var ts;
|
||||
this.NoSpaceBeforeBar = new formatting.Rule(formatting.RuleDescriptor.create3(46, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8));
|
||||
this.SpaceAfterBar = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 46), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
|
||||
this.NoSpaceAfterBar = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 46), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8));
|
||||
this.SpaceBeforeAmpersand = new formatting.Rule(formatting.RuleDescriptor.create3(45, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
|
||||
this.SpaceAfterAmpersand = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 45), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
|
||||
this.HighPriorityCommonRules =
|
||||
[
|
||||
this.IgnoreBeforeComment, this.IgnoreAfterLineComment,
|
||||
@@ -33566,6 +33594,7 @@ var ts;
|
||||
this.SpaceAfterTypeKeyword, this.NoSpaceAfterTypeKeyword,
|
||||
this.SpaceBetweenTagAndTemplateString, this.NoSpaceBetweenTagAndTemplateString,
|
||||
this.SpaceBeforeBar, this.NoSpaceBeforeBar, this.SpaceAfterBar, this.NoSpaceAfterBar,
|
||||
this.SpaceBeforeAmpersand, this.SpaceAfterAmpersand,
|
||||
this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport,
|
||||
this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords,
|
||||
this.SpaceAfterModuleName,
|
||||
@@ -33736,6 +33765,7 @@ var ts;
|
||||
Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) {
|
||||
switch (node.kind) {
|
||||
case 212:
|
||||
case 184:
|
||||
case 213:
|
||||
case 215:
|
||||
case 153:
|
||||
@@ -35266,6 +35296,7 @@ var ts;
|
||||
function nodeContentIsAlwaysIndented(kind) {
|
||||
switch (kind) {
|
||||
case 212:
|
||||
case 184:
|
||||
case 213:
|
||||
case 215:
|
||||
case 214:
|
||||
@@ -35290,13 +35321,13 @@ var ts;
|
||||
case 160:
|
||||
case 159:
|
||||
case 231:
|
||||
case 232:
|
||||
case 140:
|
||||
case 145:
|
||||
case 146:
|
||||
case 136:
|
||||
case 150:
|
||||
case 151:
|
||||
case 156:
|
||||
case 158:
|
||||
case 168:
|
||||
case 176:
|
||||
@@ -36267,7 +36298,7 @@ var ts;
|
||||
var outputText;
|
||||
var sourceMapText;
|
||||
var compilerHost = {
|
||||
getSourceFile: function (fileName, target) { return fileName === inputFileName ? sourceFile : undefined; },
|
||||
getSourceFile: function (fileName, target) { return fileName === ts.normalizeSlashes(inputFileName) ? sourceFile : undefined; },
|
||||
writeFile: function (name, text, writeByteOrderMark) {
|
||||
if (ts.fileExtensionIs(name, ".map")) {
|
||||
ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'");
|
||||
@@ -36581,6 +36612,24 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (token === 87) {
|
||||
token = scanner.scan();
|
||||
if (token === 67 || ts.isKeyword(token)) {
|
||||
token = scanner.scan();
|
||||
if (token === 55) {
|
||||
token = scanner.scan();
|
||||
if (token === 125) {
|
||||
token = scanner.scan();
|
||||
if (token === 17) {
|
||||
token = scanner.scan();
|
||||
if (token === 9) {
|
||||
recordModuleName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
token = scanner.scan();
|
||||
}
|
||||
|
||||
+163
-89
@@ -2433,13 +2433,14 @@ var ts;
|
||||
Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." },
|
||||
NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" },
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
Argument_for_moduleResolution_option_must_be_node_or_classic: { code: 6063, category: ts.DiagnosticCategory.Error, key: "Argument for '--moduleResolution' option must be 'node' or 'classic'." },
|
||||
Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify JSX code generation: 'preserve' or 'react'" },
|
||||
Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument for '--jsx' must be 'preserve' or 'react'." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Option_experimentalAsyncFunctions_cannot_be_specified_when_targeting_ES5_or_lower: { code: 6067, category: ts.DiagnosticCategory.Message, key: "Option 'experimentalAsyncFunctions' cannot be specified when targeting ES5 or lower." },
|
||||
Enables_experimental_support_for_ES7_async_functions: { code: 6068, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 async functions." },
|
||||
Specifies_module_resolution_strategy_Colon_node_Node_or_classic_TypeScript_pre_1_6: { code: 6069, category: ts.DiagnosticCategory.Message, key: "Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6) ." },
|
||||
Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: { code: 6069, category: ts.DiagnosticCategory.Message, key: "Specifies module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)." },
|
||||
Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes a TypeScript project and creates a tsconfig.json file." },
|
||||
Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully created a tsconfig.json file." },
|
||||
Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress excess property checks for object literals." },
|
||||
@@ -17021,7 +17022,7 @@ var ts;
|
||||
* @param target The right-hand-side of the relation.
|
||||
* @param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
|
||||
* Used as both to determine which checks are performed and as a cache of previously computed results.
|
||||
* @param errorNode The node upon which all errors will be reported, if defined.
|
||||
* @param errorNode The suggested node upon which all errors will be reported, if defined. This may or may not be the actual node used.
|
||||
* @param headMessage If the error chain should be prepended by a head message, then headMessage will be used.
|
||||
* @param containingMessageChain A chain of errors to prepend any new errors found.
|
||||
*/
|
||||
@@ -17228,6 +17229,10 @@ var ts;
|
||||
var prop = _a[_i];
|
||||
if (!isKnownProperty(target, prop.name)) {
|
||||
if (reportErrors) {
|
||||
// We know *exactly* where things went wrong when comparing the types.
|
||||
// Use this property as the error node as this will be more helpful in
|
||||
// reasoning about what went wrong.
|
||||
errorNode = prop.valueDeclaration;
|
||||
reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target));
|
||||
}
|
||||
return true;
|
||||
@@ -25637,7 +25642,10 @@ var ts;
|
||||
var symbols = [];
|
||||
var name_15 = symbol.name;
|
||||
ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) {
|
||||
symbols.push(getPropertyOfType(t, name_15));
|
||||
var symbol = getPropertyOfType(t, name_15);
|
||||
if (symbol) {
|
||||
symbols.push(symbol);
|
||||
}
|
||||
});
|
||||
return symbols;
|
||||
}
|
||||
@@ -29561,8 +29569,10 @@ var ts;
|
||||
function jsxEmitPreserve(node) {
|
||||
function emitJsxAttribute(node) {
|
||||
emit(node.name);
|
||||
write("=");
|
||||
emit(node.initializer);
|
||||
if (node.initializer) {
|
||||
write("=");
|
||||
emit(node.initializer);
|
||||
}
|
||||
}
|
||||
function emitJsxSpreadAttribute(node) {
|
||||
write("{...");
|
||||
@@ -31270,21 +31280,30 @@ var ts;
|
||||
write(")");
|
||||
}
|
||||
}
|
||||
function ensureIdentifier(expr) {
|
||||
if (expr.kind !== 67 /* Identifier */) {
|
||||
var identifier = createTempVariable(0 /* Auto */);
|
||||
if (!canDefineTempVariablesInPlace) {
|
||||
recordTempDeclaration(identifier);
|
||||
}
|
||||
emitAssignment(identifier, expr);
|
||||
expr = identifier;
|
||||
/**
|
||||
* Ensures that there exists a declared identifier whose value holds the given expression.
|
||||
* This function is useful to ensure that the expression's value can be read from in subsequent expressions.
|
||||
* Unless 'reuseIdentifierExpressions' is false, 'expr' will be returned if it is just an identifier.
|
||||
*
|
||||
* @param expr the expression whose value needs to be bound.
|
||||
* @param reuseIdentifierExpressions true if identifier expressions can simply be returned;
|
||||
* false if it is necessary to always emit an identifier.
|
||||
*/
|
||||
function ensureIdentifier(expr, reuseIdentifierExpressions) {
|
||||
if (expr.kind === 67 /* Identifier */ && reuseIdentifierExpressions) {
|
||||
return expr;
|
||||
}
|
||||
return expr;
|
||||
var identifier = createTempVariable(0 /* Auto */);
|
||||
if (!canDefineTempVariablesInPlace) {
|
||||
recordTempDeclaration(identifier);
|
||||
}
|
||||
emitAssignment(identifier, expr);
|
||||
return identifier;
|
||||
}
|
||||
function createDefaultValueCheck(value, defaultValue) {
|
||||
// The value expression will be evaluated twice, so for anything but a simple identifier
|
||||
// we need to generate a temporary variable
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true);
|
||||
// Return the expression 'value === void 0 ? defaultValue : value'
|
||||
var equals = ts.createSynthesizedNode(179 /* BinaryExpression */);
|
||||
equals.left = value;
|
||||
@@ -31330,7 +31349,7 @@ var ts;
|
||||
if (properties.length !== 1) {
|
||||
// For anything but a single element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once.
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true);
|
||||
}
|
||||
for (var _a = 0; _a < properties.length; _a++) {
|
||||
var p = properties[_a];
|
||||
@@ -31345,7 +31364,7 @@ var ts;
|
||||
if (elements.length !== 1) {
|
||||
// For anything but a single element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once.
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true);
|
||||
}
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var e = elements[i];
|
||||
@@ -31387,7 +31406,7 @@ var ts;
|
||||
if (root.parent.kind !== 170 /* ParenthesizedExpression */) {
|
||||
write("(");
|
||||
}
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true);
|
||||
emitDestructuringAssignment(target, value);
|
||||
write(", ");
|
||||
emit(value);
|
||||
@@ -31408,12 +31427,15 @@ var ts;
|
||||
if (ts.isBindingPattern(target.name)) {
|
||||
var pattern = target.name;
|
||||
var elements = pattern.elements;
|
||||
if (elements.length !== 1) {
|
||||
// For anything but a single element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once.
|
||||
value = ensureIdentifier(value);
|
||||
var numElements = elements.length;
|
||||
if (numElements !== 1) {
|
||||
// For anything other than a single-element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once. Additionally, if we have zero elements
|
||||
// we need to emit *something* to ensure that in case a 'var' keyword was already emitted,
|
||||
// so in that case, we'll intentionally create that temporary.
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0);
|
||||
}
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
for (var i = 0; i < numElements; i++) {
|
||||
var element = elements[i];
|
||||
if (pattern.kind === 159 /* ObjectBindingPattern */) {
|
||||
// Rewrite element to a declaration with an initializer that fetches property
|
||||
@@ -31425,7 +31447,7 @@ var ts;
|
||||
// Rewrite element to a declaration that accesses array element at index i
|
||||
emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i)));
|
||||
}
|
||||
else if (i === elements.length - 1) {
|
||||
else if (i === numElements - 1) {
|
||||
emitBindingElement(element, createSliceCall(value, i));
|
||||
}
|
||||
}
|
||||
@@ -32840,50 +32862,49 @@ var ts;
|
||||
write("void 0");
|
||||
}
|
||||
function emitSerializedTypeNode(node) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
switch (node.kind) {
|
||||
case 101 /* VoidKeyword */:
|
||||
write("void 0");
|
||||
return;
|
||||
case 158 /* ParenthesizedType */:
|
||||
emitSerializedTypeNode(node.type);
|
||||
return;
|
||||
case 150 /* FunctionType */:
|
||||
case 151 /* ConstructorType */:
|
||||
write("Function");
|
||||
return;
|
||||
case 154 /* ArrayType */:
|
||||
case 155 /* TupleType */:
|
||||
write("Array");
|
||||
return;
|
||||
case 148 /* TypePredicate */:
|
||||
case 118 /* BooleanKeyword */:
|
||||
write("Boolean");
|
||||
return;
|
||||
case 128 /* StringKeyword */:
|
||||
case 9 /* StringLiteral */:
|
||||
write("String");
|
||||
return;
|
||||
case 126 /* NumberKeyword */:
|
||||
write("Number");
|
||||
return;
|
||||
case 129 /* SymbolKeyword */:
|
||||
write("Symbol");
|
||||
return;
|
||||
case 149 /* TypeReference */:
|
||||
emitSerializedTypeReferenceNode(node);
|
||||
return;
|
||||
case 152 /* TypeQuery */:
|
||||
case 153 /* TypeLiteral */:
|
||||
case 156 /* UnionType */:
|
||||
case 157 /* IntersectionType */:
|
||||
case 115 /* AnyKeyword */:
|
||||
break;
|
||||
default:
|
||||
ts.Debug.fail("Cannot serialize unexpected type node.");
|
||||
break;
|
||||
if (node) {
|
||||
switch (node.kind) {
|
||||
case 101 /* VoidKeyword */:
|
||||
write("void 0");
|
||||
return;
|
||||
case 158 /* ParenthesizedType */:
|
||||
emitSerializedTypeNode(node.type);
|
||||
return;
|
||||
case 150 /* FunctionType */:
|
||||
case 151 /* ConstructorType */:
|
||||
write("Function");
|
||||
return;
|
||||
case 154 /* ArrayType */:
|
||||
case 155 /* TupleType */:
|
||||
write("Array");
|
||||
return;
|
||||
case 148 /* TypePredicate */:
|
||||
case 118 /* BooleanKeyword */:
|
||||
write("Boolean");
|
||||
return;
|
||||
case 128 /* StringKeyword */:
|
||||
case 9 /* StringLiteral */:
|
||||
write("String");
|
||||
return;
|
||||
case 126 /* NumberKeyword */:
|
||||
write("Number");
|
||||
return;
|
||||
case 129 /* SymbolKeyword */:
|
||||
write("Symbol");
|
||||
return;
|
||||
case 149 /* TypeReference */:
|
||||
emitSerializedTypeReferenceNode(node);
|
||||
return;
|
||||
case 152 /* TypeQuery */:
|
||||
case 153 /* TypeLiteral */:
|
||||
case 156 /* UnionType */:
|
||||
case 157 /* IntersectionType */:
|
||||
case 115 /* AnyKeyword */:
|
||||
break;
|
||||
default:
|
||||
ts.Debug.fail("Cannot serialize unexpected type node.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
write("Object");
|
||||
}
|
||||
@@ -35103,7 +35124,7 @@ var ts;
|
||||
/* @internal */ ts.ioWriteTime = 0;
|
||||
/** The version of the TypeScript compiler release */
|
||||
var emptyArray = [];
|
||||
ts.version = "1.6.0";
|
||||
ts.version = "1.6.2";
|
||||
function findConfigFile(searchPath) {
|
||||
var fileName = "tsconfig.json";
|
||||
while (true) {
|
||||
@@ -36251,8 +36272,8 @@ var ts;
|
||||
"node": 2 /* NodeJs */,
|
||||
"classic": 1 /* Classic */
|
||||
},
|
||||
experimental: true,
|
||||
description: ts.Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_or_classic_TypeScript_pre_1_6
|
||||
description: ts.Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
|
||||
error: ts.Diagnostics.Argument_for_moduleResolution_option_must_be_node_or_classic
|
||||
}
|
||||
];
|
||||
var optionNameMapCache;
|
||||
@@ -38721,7 +38742,7 @@ var ts;
|
||||
function findPrecedingToken(position, sourceFile, startNode) {
|
||||
return find(startNode || sourceFile);
|
||||
function findRightmostToken(n) {
|
||||
if (isToken(n)) {
|
||||
if (isToken(n) || n.kind === 234 /* JsxText */) {
|
||||
return n;
|
||||
}
|
||||
var children = n.getChildren();
|
||||
@@ -38729,23 +38750,32 @@ var ts;
|
||||
return candidate && findRightmostToken(candidate);
|
||||
}
|
||||
function find(n) {
|
||||
if (isToken(n)) {
|
||||
if (isToken(n) || n.kind === 234 /* JsxText */) {
|
||||
return n;
|
||||
}
|
||||
var children = n.getChildren();
|
||||
for (var i = 0, len = children.length; i < len; i++) {
|
||||
var child = children[i];
|
||||
if (nodeHasTokens(child)) {
|
||||
if (position <= child.end) {
|
||||
if (child.getStart(sourceFile) >= position) {
|
||||
// actual start of the node is past the position - previous token should be at the end of previous child
|
||||
var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i);
|
||||
return candidate && findRightmostToken(candidate);
|
||||
}
|
||||
else {
|
||||
// candidate should be in this node
|
||||
return find(child);
|
||||
}
|
||||
// condition 'position < child.end' checks if child node end after the position
|
||||
// in the example below this condition will be false for 'aaaa' and 'bbbb' and true for 'ccc'
|
||||
// aaaa___bbbb___$__ccc
|
||||
// after we found child node with end after the position we check if start of the node is after the position.
|
||||
// if yes - then position is in the trivia and we need to look into the previous child to find the token in question.
|
||||
// if no - position is in the node itself so we should recurse in it.
|
||||
// NOTE: JsxText is a weird kind of node that can contain only whitespaces (since they are not counted as trivia).
|
||||
// if this is the case - then we should assume that token in question is located in previous child.
|
||||
if (position < child.end && (nodeHasTokens(child) || child.kind === 234 /* JsxText */)) {
|
||||
var start = child.getStart(sourceFile);
|
||||
var lookInPreviousChild = (start >= position) ||
|
||||
(child.kind === 234 /* JsxText */ && start === child.end); // whitespace only JsxText
|
||||
if (lookInPreviousChild) {
|
||||
// actual start of the node is past the position - previous token should be at the end of previous child
|
||||
var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i);
|
||||
return candidate && findRightmostToken(candidate);
|
||||
}
|
||||
else {
|
||||
// candidate should be in this node
|
||||
return find(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39162,6 +39192,7 @@ var ts;
|
||||
ScanAction[ScanAction["RescanGreaterThanToken"] = 1] = "RescanGreaterThanToken";
|
||||
ScanAction[ScanAction["RescanSlashToken"] = 2] = "RescanSlashToken";
|
||||
ScanAction[ScanAction["RescanTemplateToken"] = 3] = "RescanTemplateToken";
|
||||
ScanAction[ScanAction["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier";
|
||||
})(ScanAction || (ScanAction = {}));
|
||||
function getFormattingScanner(sourceFile, startPos, endPos) {
|
||||
scanner.setText(sourceFile.text);
|
||||
@@ -39235,6 +39266,18 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function shouldRescanJsxIdentifier(node) {
|
||||
if (node.parent) {
|
||||
switch (node.parent.kind) {
|
||||
case 236 /* JsxAttribute */:
|
||||
case 233 /* JsxOpeningElement */:
|
||||
case 235 /* JsxClosingElement */:
|
||||
case 232 /* JsxSelfClosingElement */:
|
||||
return node.kind === 67 /* Identifier */;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function shouldRescanSlashToken(container) {
|
||||
return container.kind === 10 /* RegularExpressionLiteral */;
|
||||
}
|
||||
@@ -39262,7 +39305,9 @@ var ts;
|
||||
? 2 /* RescanSlashToken */
|
||||
: shouldRescanTemplateToken(n)
|
||||
? 3 /* RescanTemplateToken */
|
||||
: 0 /* Scan */;
|
||||
: shouldRescanJsxIdentifier(n)
|
||||
? 4 /* RescanJsxIdentifier */
|
||||
: 0 /* Scan */;
|
||||
if (lastTokenInfo && expectedScanAction === lastScanAction) {
|
||||
// readTokenInfo was called before with the same expected scan action.
|
||||
// No need to re-scan text, return existing 'lastTokenInfo'
|
||||
@@ -39293,6 +39338,10 @@ var ts;
|
||||
currentToken = scanner.reScanTemplateToken();
|
||||
lastScanAction = 3 /* RescanTemplateToken */;
|
||||
}
|
||||
else if (expectedScanAction === 4 /* RescanJsxIdentifier */ && currentToken === 67 /* Identifier */) {
|
||||
currentToken = scanner.scanJsxIdentifier();
|
||||
lastScanAction = 4 /* RescanJsxIdentifier */;
|
||||
}
|
||||
else {
|
||||
lastScanAction = 0 /* Scan */;
|
||||
}
|
||||
@@ -39633,7 +39682,7 @@ var ts;
|
||||
this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments;
|
||||
this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 15 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */);
|
||||
// Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc)
|
||||
this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([67 /* Identifier */, 3 /* MultiLineCommentTrivia */]);
|
||||
this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([67 /* Identifier */, 3 /* MultiLineCommentTrivia */, 71 /* ClassKeyword */]);
|
||||
this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 15 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */);
|
||||
// Place a space before open brace in a control flow construct
|
||||
this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([18 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 77 /* DoKeyword */, 98 /* TryKeyword */, 83 /* FinallyKeyword */, 78 /* ElseKeyword */]);
|
||||
@@ -39727,11 +39776,13 @@ var ts;
|
||||
// template string
|
||||
this.SpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(67 /* Identifier */, formatting.Shared.TokenRange.FromTokens([11 /* NoSubstitutionTemplateLiteral */, 12 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(67 /* Identifier */, formatting.Shared.TokenRange.FromTokens([11 /* NoSubstitutionTemplateLiteral */, 12 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
|
||||
// union type
|
||||
// type operation
|
||||
this.SpaceBeforeBar = new formatting.Rule(formatting.RuleDescriptor.create3(46 /* BarToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
this.NoSpaceBeforeBar = new formatting.Rule(formatting.RuleDescriptor.create3(46 /* BarToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
|
||||
this.SpaceAfterBar = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 46 /* BarToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
this.NoSpaceAfterBar = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 46 /* BarToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
|
||||
this.SpaceBeforeAmpersand = new formatting.Rule(formatting.RuleDescriptor.create3(45 /* AmpersandToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
this.SpaceAfterAmpersand = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 45 /* AmpersandToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
// These rules are higher in priority than user-configurable rules.
|
||||
this.HighPriorityCommonRules =
|
||||
[
|
||||
@@ -39763,6 +39814,7 @@ var ts;
|
||||
this.SpaceAfterTypeKeyword, this.NoSpaceAfterTypeKeyword,
|
||||
this.SpaceBetweenTagAndTemplateString, this.NoSpaceBetweenTagAndTemplateString,
|
||||
this.SpaceBeforeBar, this.NoSpaceBeforeBar, this.SpaceAfterBar, this.NoSpaceAfterBar,
|
||||
this.SpaceBeforeAmpersand, this.SpaceAfterAmpersand,
|
||||
// TypeScript-specific rules
|
||||
this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport,
|
||||
this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords,
|
||||
@@ -39967,6 +40019,7 @@ var ts;
|
||||
Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) {
|
||||
switch (node.kind) {
|
||||
case 212 /* ClassDeclaration */:
|
||||
case 184 /* ClassExpression */:
|
||||
case 213 /* InterfaceDeclaration */:
|
||||
case 215 /* EnumDeclaration */:
|
||||
case 153 /* TypeLiteral */:
|
||||
@@ -41704,6 +41757,7 @@ var ts;
|
||||
function nodeContentIsAlwaysIndented(kind) {
|
||||
switch (kind) {
|
||||
case 212 /* ClassDeclaration */:
|
||||
case 184 /* ClassExpression */:
|
||||
case 213 /* InterfaceDeclaration */:
|
||||
case 215 /* EnumDeclaration */:
|
||||
case 214 /* TypeAliasDeclaration */:
|
||||
@@ -41728,13 +41782,13 @@ var ts;
|
||||
case 160 /* ArrayBindingPattern */:
|
||||
case 159 /* ObjectBindingPattern */:
|
||||
case 231 /* JsxElement */:
|
||||
case 232 /* JsxSelfClosingElement */:
|
||||
case 140 /* MethodSignature */:
|
||||
case 145 /* CallSignature */:
|
||||
case 146 /* ConstructSignature */:
|
||||
case 136 /* Parameter */:
|
||||
case 150 /* FunctionType */:
|
||||
case 151 /* ConstructorType */:
|
||||
case 156 /* UnionType */:
|
||||
case 158 /* ParenthesizedType */:
|
||||
case 168 /* TaggedTemplateExpression */:
|
||||
case 176 /* AwaitExpression */:
|
||||
@@ -42858,7 +42912,7 @@ var ts;
|
||||
var sourceMapText;
|
||||
// Create a compilerHost object to allow the compiler to read and write files
|
||||
var compilerHost = {
|
||||
getSourceFile: function (fileName, target) { return fileName === inputFileName ? sourceFile : undefined; },
|
||||
getSourceFile: function (fileName, target) { return fileName === ts.normalizeSlashes(inputFileName) ? sourceFile : undefined; },
|
||||
writeFile: function (name, text, writeByteOrderMark) {
|
||||
if (ts.fileExtensionIs(name, ".map")) {
|
||||
ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'");
|
||||
@@ -43106,6 +43160,7 @@ var ts;
|
||||
//
|
||||
// export * from "mod"
|
||||
// export {a as b} from "mod"
|
||||
// export import i = require("mod")
|
||||
while (token !== 1 /* EndOfFileToken */) {
|
||||
if (token === 120 /* DeclareKeyword */) {
|
||||
// declare module "mod"
|
||||
@@ -43226,6 +43281,25 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (token === 87 /* ImportKeyword */) {
|
||||
token = scanner.scan();
|
||||
if (token === 67 /* Identifier */ || ts.isKeyword(token)) {
|
||||
token = scanner.scan();
|
||||
if (token === 55 /* EqualsToken */) {
|
||||
token = scanner.scan();
|
||||
if (token === 125 /* RequireKeyword */) {
|
||||
token = scanner.scan();
|
||||
if (token === 17 /* OpenParenToken */) {
|
||||
token = scanner.scan();
|
||||
if (token === 9 /* StringLiteral */) {
|
||||
// export import i = require("mod");
|
||||
recordModuleName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
token = scanner.scan();
|
||||
}
|
||||
|
||||
+163
-89
@@ -2433,13 +2433,14 @@ var ts;
|
||||
Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." },
|
||||
NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" },
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
Argument_for_moduleResolution_option_must_be_node_or_classic: { code: 6063, category: ts.DiagnosticCategory.Error, key: "Argument for '--moduleResolution' option must be 'node' or 'classic'." },
|
||||
Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: ts.DiagnosticCategory.Message, key: "Specify JSX code generation: 'preserve' or 'react'" },
|
||||
Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: ts.DiagnosticCategory.Message, key: "Argument for '--jsx' must be 'preserve' or 'react'." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Option_experimentalAsyncFunctions_cannot_be_specified_when_targeting_ES5_or_lower: { code: 6067, category: ts.DiagnosticCategory.Message, key: "Option 'experimentalAsyncFunctions' cannot be specified when targeting ES5 or lower." },
|
||||
Enables_experimental_support_for_ES7_async_functions: { code: 6068, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 async functions." },
|
||||
Specifies_module_resolution_strategy_Colon_node_Node_or_classic_TypeScript_pre_1_6: { code: 6069, category: ts.DiagnosticCategory.Message, key: "Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6) ." },
|
||||
Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: { code: 6069, category: ts.DiagnosticCategory.Message, key: "Specifies module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)." },
|
||||
Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: ts.DiagnosticCategory.Message, key: "Initializes a TypeScript project and creates a tsconfig.json file." },
|
||||
Successfully_created_a_tsconfig_json_file: { code: 6071, category: ts.DiagnosticCategory.Message, key: "Successfully created a tsconfig.json file." },
|
||||
Suppress_excess_property_checks_for_object_literals: { code: 6072, category: ts.DiagnosticCategory.Message, key: "Suppress excess property checks for object literals." },
|
||||
@@ -17021,7 +17022,7 @@ var ts;
|
||||
* @param target The right-hand-side of the relation.
|
||||
* @param relation The relation considered. One of 'identityRelation', 'assignableRelation', or 'subTypeRelation'.
|
||||
* Used as both to determine which checks are performed and as a cache of previously computed results.
|
||||
* @param errorNode The node upon which all errors will be reported, if defined.
|
||||
* @param errorNode The suggested node upon which all errors will be reported, if defined. This may or may not be the actual node used.
|
||||
* @param headMessage If the error chain should be prepended by a head message, then headMessage will be used.
|
||||
* @param containingMessageChain A chain of errors to prepend any new errors found.
|
||||
*/
|
||||
@@ -17228,6 +17229,10 @@ var ts;
|
||||
var prop = _a[_i];
|
||||
if (!isKnownProperty(target, prop.name)) {
|
||||
if (reportErrors) {
|
||||
// We know *exactly* where things went wrong when comparing the types.
|
||||
// Use this property as the error node as this will be more helpful in
|
||||
// reasoning about what went wrong.
|
||||
errorNode = prop.valueDeclaration;
|
||||
reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target));
|
||||
}
|
||||
return true;
|
||||
@@ -25637,7 +25642,10 @@ var ts;
|
||||
var symbols = [];
|
||||
var name_15 = symbol.name;
|
||||
ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) {
|
||||
symbols.push(getPropertyOfType(t, name_15));
|
||||
var symbol = getPropertyOfType(t, name_15);
|
||||
if (symbol) {
|
||||
symbols.push(symbol);
|
||||
}
|
||||
});
|
||||
return symbols;
|
||||
}
|
||||
@@ -29561,8 +29569,10 @@ var ts;
|
||||
function jsxEmitPreserve(node) {
|
||||
function emitJsxAttribute(node) {
|
||||
emit(node.name);
|
||||
write("=");
|
||||
emit(node.initializer);
|
||||
if (node.initializer) {
|
||||
write("=");
|
||||
emit(node.initializer);
|
||||
}
|
||||
}
|
||||
function emitJsxSpreadAttribute(node) {
|
||||
write("{...");
|
||||
@@ -31270,21 +31280,30 @@ var ts;
|
||||
write(")");
|
||||
}
|
||||
}
|
||||
function ensureIdentifier(expr) {
|
||||
if (expr.kind !== 67 /* Identifier */) {
|
||||
var identifier = createTempVariable(0 /* Auto */);
|
||||
if (!canDefineTempVariablesInPlace) {
|
||||
recordTempDeclaration(identifier);
|
||||
}
|
||||
emitAssignment(identifier, expr);
|
||||
expr = identifier;
|
||||
/**
|
||||
* Ensures that there exists a declared identifier whose value holds the given expression.
|
||||
* This function is useful to ensure that the expression's value can be read from in subsequent expressions.
|
||||
* Unless 'reuseIdentifierExpressions' is false, 'expr' will be returned if it is just an identifier.
|
||||
*
|
||||
* @param expr the expression whose value needs to be bound.
|
||||
* @param reuseIdentifierExpressions true if identifier expressions can simply be returned;
|
||||
* false if it is necessary to always emit an identifier.
|
||||
*/
|
||||
function ensureIdentifier(expr, reuseIdentifierExpressions) {
|
||||
if (expr.kind === 67 /* Identifier */ && reuseIdentifierExpressions) {
|
||||
return expr;
|
||||
}
|
||||
return expr;
|
||||
var identifier = createTempVariable(0 /* Auto */);
|
||||
if (!canDefineTempVariablesInPlace) {
|
||||
recordTempDeclaration(identifier);
|
||||
}
|
||||
emitAssignment(identifier, expr);
|
||||
return identifier;
|
||||
}
|
||||
function createDefaultValueCheck(value, defaultValue) {
|
||||
// The value expression will be evaluated twice, so for anything but a simple identifier
|
||||
// we need to generate a temporary variable
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true);
|
||||
// Return the expression 'value === void 0 ? defaultValue : value'
|
||||
var equals = ts.createSynthesizedNode(179 /* BinaryExpression */);
|
||||
equals.left = value;
|
||||
@@ -31330,7 +31349,7 @@ var ts;
|
||||
if (properties.length !== 1) {
|
||||
// For anything but a single element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once.
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true);
|
||||
}
|
||||
for (var _a = 0; _a < properties.length; _a++) {
|
||||
var p = properties[_a];
|
||||
@@ -31345,7 +31364,7 @@ var ts;
|
||||
if (elements.length !== 1) {
|
||||
// For anything but a single element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once.
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true);
|
||||
}
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var e = elements[i];
|
||||
@@ -31387,7 +31406,7 @@ var ts;
|
||||
if (root.parent.kind !== 170 /* ParenthesizedExpression */) {
|
||||
write("(");
|
||||
}
|
||||
value = ensureIdentifier(value);
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true);
|
||||
emitDestructuringAssignment(target, value);
|
||||
write(", ");
|
||||
emit(value);
|
||||
@@ -31408,12 +31427,15 @@ var ts;
|
||||
if (ts.isBindingPattern(target.name)) {
|
||||
var pattern = target.name;
|
||||
var elements = pattern.elements;
|
||||
if (elements.length !== 1) {
|
||||
// For anything but a single element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once.
|
||||
value = ensureIdentifier(value);
|
||||
var numElements = elements.length;
|
||||
if (numElements !== 1) {
|
||||
// For anything other than a single-element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once. Additionally, if we have zero elements
|
||||
// we need to emit *something* to ensure that in case a 'var' keyword was already emitted,
|
||||
// so in that case, we'll intentionally create that temporary.
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0);
|
||||
}
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
for (var i = 0; i < numElements; i++) {
|
||||
var element = elements[i];
|
||||
if (pattern.kind === 159 /* ObjectBindingPattern */) {
|
||||
// Rewrite element to a declaration with an initializer that fetches property
|
||||
@@ -31425,7 +31447,7 @@ var ts;
|
||||
// Rewrite element to a declaration that accesses array element at index i
|
||||
emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i)));
|
||||
}
|
||||
else if (i === elements.length - 1) {
|
||||
else if (i === numElements - 1) {
|
||||
emitBindingElement(element, createSliceCall(value, i));
|
||||
}
|
||||
}
|
||||
@@ -32840,50 +32862,49 @@ var ts;
|
||||
write("void 0");
|
||||
}
|
||||
function emitSerializedTypeNode(node) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
switch (node.kind) {
|
||||
case 101 /* VoidKeyword */:
|
||||
write("void 0");
|
||||
return;
|
||||
case 158 /* ParenthesizedType */:
|
||||
emitSerializedTypeNode(node.type);
|
||||
return;
|
||||
case 150 /* FunctionType */:
|
||||
case 151 /* ConstructorType */:
|
||||
write("Function");
|
||||
return;
|
||||
case 154 /* ArrayType */:
|
||||
case 155 /* TupleType */:
|
||||
write("Array");
|
||||
return;
|
||||
case 148 /* TypePredicate */:
|
||||
case 118 /* BooleanKeyword */:
|
||||
write("Boolean");
|
||||
return;
|
||||
case 128 /* StringKeyword */:
|
||||
case 9 /* StringLiteral */:
|
||||
write("String");
|
||||
return;
|
||||
case 126 /* NumberKeyword */:
|
||||
write("Number");
|
||||
return;
|
||||
case 129 /* SymbolKeyword */:
|
||||
write("Symbol");
|
||||
return;
|
||||
case 149 /* TypeReference */:
|
||||
emitSerializedTypeReferenceNode(node);
|
||||
return;
|
||||
case 152 /* TypeQuery */:
|
||||
case 153 /* TypeLiteral */:
|
||||
case 156 /* UnionType */:
|
||||
case 157 /* IntersectionType */:
|
||||
case 115 /* AnyKeyword */:
|
||||
break;
|
||||
default:
|
||||
ts.Debug.fail("Cannot serialize unexpected type node.");
|
||||
break;
|
||||
if (node) {
|
||||
switch (node.kind) {
|
||||
case 101 /* VoidKeyword */:
|
||||
write("void 0");
|
||||
return;
|
||||
case 158 /* ParenthesizedType */:
|
||||
emitSerializedTypeNode(node.type);
|
||||
return;
|
||||
case 150 /* FunctionType */:
|
||||
case 151 /* ConstructorType */:
|
||||
write("Function");
|
||||
return;
|
||||
case 154 /* ArrayType */:
|
||||
case 155 /* TupleType */:
|
||||
write("Array");
|
||||
return;
|
||||
case 148 /* TypePredicate */:
|
||||
case 118 /* BooleanKeyword */:
|
||||
write("Boolean");
|
||||
return;
|
||||
case 128 /* StringKeyword */:
|
||||
case 9 /* StringLiteral */:
|
||||
write("String");
|
||||
return;
|
||||
case 126 /* NumberKeyword */:
|
||||
write("Number");
|
||||
return;
|
||||
case 129 /* SymbolKeyword */:
|
||||
write("Symbol");
|
||||
return;
|
||||
case 149 /* TypeReference */:
|
||||
emitSerializedTypeReferenceNode(node);
|
||||
return;
|
||||
case 152 /* TypeQuery */:
|
||||
case 153 /* TypeLiteral */:
|
||||
case 156 /* UnionType */:
|
||||
case 157 /* IntersectionType */:
|
||||
case 115 /* AnyKeyword */:
|
||||
break;
|
||||
default:
|
||||
ts.Debug.fail("Cannot serialize unexpected type node.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
write("Object");
|
||||
}
|
||||
@@ -35103,7 +35124,7 @@ var ts;
|
||||
/* @internal */ ts.ioWriteTime = 0;
|
||||
/** The version of the TypeScript compiler release */
|
||||
var emptyArray = [];
|
||||
ts.version = "1.6.0";
|
||||
ts.version = "1.6.2";
|
||||
function findConfigFile(searchPath) {
|
||||
var fileName = "tsconfig.json";
|
||||
while (true) {
|
||||
@@ -36251,8 +36272,8 @@ var ts;
|
||||
"node": 2 /* NodeJs */,
|
||||
"classic": 1 /* Classic */
|
||||
},
|
||||
experimental: true,
|
||||
description: ts.Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_or_classic_TypeScript_pre_1_6
|
||||
description: ts.Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
|
||||
error: ts.Diagnostics.Argument_for_moduleResolution_option_must_be_node_or_classic
|
||||
}
|
||||
];
|
||||
var optionNameMapCache;
|
||||
@@ -38721,7 +38742,7 @@ var ts;
|
||||
function findPrecedingToken(position, sourceFile, startNode) {
|
||||
return find(startNode || sourceFile);
|
||||
function findRightmostToken(n) {
|
||||
if (isToken(n)) {
|
||||
if (isToken(n) || n.kind === 234 /* JsxText */) {
|
||||
return n;
|
||||
}
|
||||
var children = n.getChildren();
|
||||
@@ -38729,23 +38750,32 @@ var ts;
|
||||
return candidate && findRightmostToken(candidate);
|
||||
}
|
||||
function find(n) {
|
||||
if (isToken(n)) {
|
||||
if (isToken(n) || n.kind === 234 /* JsxText */) {
|
||||
return n;
|
||||
}
|
||||
var children = n.getChildren();
|
||||
for (var i = 0, len = children.length; i < len; i++) {
|
||||
var child = children[i];
|
||||
if (nodeHasTokens(child)) {
|
||||
if (position <= child.end) {
|
||||
if (child.getStart(sourceFile) >= position) {
|
||||
// actual start of the node is past the position - previous token should be at the end of previous child
|
||||
var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i);
|
||||
return candidate && findRightmostToken(candidate);
|
||||
}
|
||||
else {
|
||||
// candidate should be in this node
|
||||
return find(child);
|
||||
}
|
||||
// condition 'position < child.end' checks if child node end after the position
|
||||
// in the example below this condition will be false for 'aaaa' and 'bbbb' and true for 'ccc'
|
||||
// aaaa___bbbb___$__ccc
|
||||
// after we found child node with end after the position we check if start of the node is after the position.
|
||||
// if yes - then position is in the trivia and we need to look into the previous child to find the token in question.
|
||||
// if no - position is in the node itself so we should recurse in it.
|
||||
// NOTE: JsxText is a weird kind of node that can contain only whitespaces (since they are not counted as trivia).
|
||||
// if this is the case - then we should assume that token in question is located in previous child.
|
||||
if (position < child.end && (nodeHasTokens(child) || child.kind === 234 /* JsxText */)) {
|
||||
var start = child.getStart(sourceFile);
|
||||
var lookInPreviousChild = (start >= position) ||
|
||||
(child.kind === 234 /* JsxText */ && start === child.end); // whitespace only JsxText
|
||||
if (lookInPreviousChild) {
|
||||
// actual start of the node is past the position - previous token should be at the end of previous child
|
||||
var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i);
|
||||
return candidate && findRightmostToken(candidate);
|
||||
}
|
||||
else {
|
||||
// candidate should be in this node
|
||||
return find(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39162,6 +39192,7 @@ var ts;
|
||||
ScanAction[ScanAction["RescanGreaterThanToken"] = 1] = "RescanGreaterThanToken";
|
||||
ScanAction[ScanAction["RescanSlashToken"] = 2] = "RescanSlashToken";
|
||||
ScanAction[ScanAction["RescanTemplateToken"] = 3] = "RescanTemplateToken";
|
||||
ScanAction[ScanAction["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier";
|
||||
})(ScanAction || (ScanAction = {}));
|
||||
function getFormattingScanner(sourceFile, startPos, endPos) {
|
||||
scanner.setText(sourceFile.text);
|
||||
@@ -39235,6 +39266,18 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function shouldRescanJsxIdentifier(node) {
|
||||
if (node.parent) {
|
||||
switch (node.parent.kind) {
|
||||
case 236 /* JsxAttribute */:
|
||||
case 233 /* JsxOpeningElement */:
|
||||
case 235 /* JsxClosingElement */:
|
||||
case 232 /* JsxSelfClosingElement */:
|
||||
return node.kind === 67 /* Identifier */;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function shouldRescanSlashToken(container) {
|
||||
return container.kind === 10 /* RegularExpressionLiteral */;
|
||||
}
|
||||
@@ -39262,7 +39305,9 @@ var ts;
|
||||
? 2 /* RescanSlashToken */
|
||||
: shouldRescanTemplateToken(n)
|
||||
? 3 /* RescanTemplateToken */
|
||||
: 0 /* Scan */;
|
||||
: shouldRescanJsxIdentifier(n)
|
||||
? 4 /* RescanJsxIdentifier */
|
||||
: 0 /* Scan */;
|
||||
if (lastTokenInfo && expectedScanAction === lastScanAction) {
|
||||
// readTokenInfo was called before with the same expected scan action.
|
||||
// No need to re-scan text, return existing 'lastTokenInfo'
|
||||
@@ -39293,6 +39338,10 @@ var ts;
|
||||
currentToken = scanner.reScanTemplateToken();
|
||||
lastScanAction = 3 /* RescanTemplateToken */;
|
||||
}
|
||||
else if (expectedScanAction === 4 /* RescanJsxIdentifier */ && currentToken === 67 /* Identifier */) {
|
||||
currentToken = scanner.scanJsxIdentifier();
|
||||
lastScanAction = 4 /* RescanJsxIdentifier */;
|
||||
}
|
||||
else {
|
||||
lastScanAction = 0 /* Scan */;
|
||||
}
|
||||
@@ -39633,7 +39682,7 @@ var ts;
|
||||
this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments;
|
||||
this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 15 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */);
|
||||
// Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc)
|
||||
this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([67 /* Identifier */, 3 /* MultiLineCommentTrivia */]);
|
||||
this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([67 /* Identifier */, 3 /* MultiLineCommentTrivia */, 71 /* ClassKeyword */]);
|
||||
this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 15 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */);
|
||||
// Place a space before open brace in a control flow construct
|
||||
this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([18 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 77 /* DoKeyword */, 98 /* TryKeyword */, 83 /* FinallyKeyword */, 78 /* ElseKeyword */]);
|
||||
@@ -39727,11 +39776,13 @@ var ts;
|
||||
// template string
|
||||
this.SpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(67 /* Identifier */, formatting.Shared.TokenRange.FromTokens([11 /* NoSubstitutionTemplateLiteral */, 12 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
this.NoSpaceBetweenTagAndTemplateString = new formatting.Rule(formatting.RuleDescriptor.create3(67 /* Identifier */, formatting.Shared.TokenRange.FromTokens([11 /* NoSubstitutionTemplateLiteral */, 12 /* TemplateHead */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
|
||||
// union type
|
||||
// type operation
|
||||
this.SpaceBeforeBar = new formatting.Rule(formatting.RuleDescriptor.create3(46 /* BarToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
this.NoSpaceBeforeBar = new formatting.Rule(formatting.RuleDescriptor.create3(46 /* BarToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
|
||||
this.SpaceAfterBar = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 46 /* BarToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
this.NoSpaceAfterBar = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 46 /* BarToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
|
||||
this.SpaceBeforeAmpersand = new formatting.Rule(formatting.RuleDescriptor.create3(45 /* AmpersandToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
this.SpaceAfterAmpersand = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 45 /* AmpersandToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
|
||||
// These rules are higher in priority than user-configurable rules.
|
||||
this.HighPriorityCommonRules =
|
||||
[
|
||||
@@ -39763,6 +39814,7 @@ var ts;
|
||||
this.SpaceAfterTypeKeyword, this.NoSpaceAfterTypeKeyword,
|
||||
this.SpaceBetweenTagAndTemplateString, this.NoSpaceBetweenTagAndTemplateString,
|
||||
this.SpaceBeforeBar, this.NoSpaceBeforeBar, this.SpaceAfterBar, this.NoSpaceAfterBar,
|
||||
this.SpaceBeforeAmpersand, this.SpaceAfterAmpersand,
|
||||
// TypeScript-specific rules
|
||||
this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport,
|
||||
this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords,
|
||||
@@ -39967,6 +40019,7 @@ var ts;
|
||||
Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) {
|
||||
switch (node.kind) {
|
||||
case 212 /* ClassDeclaration */:
|
||||
case 184 /* ClassExpression */:
|
||||
case 213 /* InterfaceDeclaration */:
|
||||
case 215 /* EnumDeclaration */:
|
||||
case 153 /* TypeLiteral */:
|
||||
@@ -41704,6 +41757,7 @@ var ts;
|
||||
function nodeContentIsAlwaysIndented(kind) {
|
||||
switch (kind) {
|
||||
case 212 /* ClassDeclaration */:
|
||||
case 184 /* ClassExpression */:
|
||||
case 213 /* InterfaceDeclaration */:
|
||||
case 215 /* EnumDeclaration */:
|
||||
case 214 /* TypeAliasDeclaration */:
|
||||
@@ -41728,13 +41782,13 @@ var ts;
|
||||
case 160 /* ArrayBindingPattern */:
|
||||
case 159 /* ObjectBindingPattern */:
|
||||
case 231 /* JsxElement */:
|
||||
case 232 /* JsxSelfClosingElement */:
|
||||
case 140 /* MethodSignature */:
|
||||
case 145 /* CallSignature */:
|
||||
case 146 /* ConstructSignature */:
|
||||
case 136 /* Parameter */:
|
||||
case 150 /* FunctionType */:
|
||||
case 151 /* ConstructorType */:
|
||||
case 156 /* UnionType */:
|
||||
case 158 /* ParenthesizedType */:
|
||||
case 168 /* TaggedTemplateExpression */:
|
||||
case 176 /* AwaitExpression */:
|
||||
@@ -42858,7 +42912,7 @@ var ts;
|
||||
var sourceMapText;
|
||||
// Create a compilerHost object to allow the compiler to read and write files
|
||||
var compilerHost = {
|
||||
getSourceFile: function (fileName, target) { return fileName === inputFileName ? sourceFile : undefined; },
|
||||
getSourceFile: function (fileName, target) { return fileName === ts.normalizeSlashes(inputFileName) ? sourceFile : undefined; },
|
||||
writeFile: function (name, text, writeByteOrderMark) {
|
||||
if (ts.fileExtensionIs(name, ".map")) {
|
||||
ts.Debug.assert(sourceMapText === undefined, "Unexpected multiple source map outputs for the file '" + name + "'");
|
||||
@@ -43106,6 +43160,7 @@ var ts;
|
||||
//
|
||||
// export * from "mod"
|
||||
// export {a as b} from "mod"
|
||||
// export import i = require("mod")
|
||||
while (token !== 1 /* EndOfFileToken */) {
|
||||
if (token === 120 /* DeclareKeyword */) {
|
||||
// declare module "mod"
|
||||
@@ -43226,6 +43281,25 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (token === 87 /* ImportKeyword */) {
|
||||
token = scanner.scan();
|
||||
if (token === 67 /* Identifier */ || ts.isKeyword(token)) {
|
||||
token = scanner.scan();
|
||||
if (token === 55 /* EqualsToken */) {
|
||||
token = scanner.scan();
|
||||
if (token === 125 /* RequireKeyword */) {
|
||||
token = scanner.scan();
|
||||
if (token === 17 /* OpenParenToken */) {
|
||||
token = scanner.scan();
|
||||
if (token === 9 /* StringLiteral */) {
|
||||
// export import i = require("mod");
|
||||
recordModuleName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
token = scanner.scan();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user