mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Update LKG
This commit is contained in:
@@ -352,9 +352,8 @@ var ts;
|
||||
SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 294] = "PartiallyEmittedExpression";
|
||||
SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 295] = "MergeDeclarationMarker";
|
||||
SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 296] = "EndOfDeclarationMarker";
|
||||
SyntaxKind[SyntaxKind["RawExpression"] = 297] = "RawExpression";
|
||||
// Enum value count
|
||||
SyntaxKind[SyntaxKind["Count"] = 298] = "Count";
|
||||
SyntaxKind[SyntaxKind["Count"] = 297] = "Count";
|
||||
// Markers
|
||||
SyntaxKind[SyntaxKind["FirstAssignment"] = 57] = "FirstAssignment";
|
||||
SyntaxKind[SyntaxKind["LastAssignment"] = 69] = "LastAssignment";
|
||||
@@ -8412,7 +8411,6 @@ var ts;
|
||||
case 194 /* TemplateExpression */:
|
||||
case 183 /* ParenthesizedExpression */:
|
||||
case 198 /* OmittedExpression */:
|
||||
case 297 /* RawExpression */:
|
||||
return 19;
|
||||
case 181 /* TaggedTemplateExpression */:
|
||||
case 177 /* PropertyAccessExpression */:
|
||||
@@ -8596,13 +8594,12 @@ var ts;
|
||||
* Note that this doesn't actually wrap the input in double quotes.
|
||||
*/
|
||||
function escapeString(s) {
|
||||
s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s;
|
||||
return s;
|
||||
function getReplacement(c) {
|
||||
return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0));
|
||||
}
|
||||
return s.replace(escapedCharsRegExp, getReplacement);
|
||||
}
|
||||
ts.escapeString = escapeString;
|
||||
function getReplacement(c) {
|
||||
return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0));
|
||||
}
|
||||
function isIntrinsicJsxName(name) {
|
||||
var ch = name.substr(0, 1);
|
||||
return ch.toLowerCase() === ch;
|
||||
@@ -10000,8 +9997,7 @@ var ts;
|
||||
|| kind === 98 /* ThisKeyword */
|
||||
|| kind === 100 /* TrueKeyword */
|
||||
|| kind === 96 /* SuperKeyword */
|
||||
|| kind === 201 /* NonNullExpression */
|
||||
|| kind === 297 /* RawExpression */;
|
||||
|| kind === 201 /* NonNullExpression */;
|
||||
}
|
||||
function isLeftHandSideExpression(node) {
|
||||
return isLeftHandSideExpressionKind(ts.skipPartiallyEmittedExpressions(node).kind);
|
||||
@@ -10029,7 +10025,6 @@ var ts;
|
||||
|| kind === 196 /* SpreadElement */
|
||||
|| kind === 200 /* AsExpression */
|
||||
|| kind === 198 /* OmittedExpression */
|
||||
|| kind === 297 /* RawExpression */
|
||||
|| isUnaryExpressionKind(kind);
|
||||
}
|
||||
function isExpression(node) {
|
||||
@@ -12160,19 +12155,6 @@ var ts;
|
||||
return node;
|
||||
}
|
||||
ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression;
|
||||
/**
|
||||
* Creates a node that emits a string of raw text in an expression position. Raw text is never
|
||||
* transformed, should be ES3 compliant, and should have the same precedence as
|
||||
* PrimaryExpression.
|
||||
*
|
||||
* @param text The raw text of the node.
|
||||
*/
|
||||
function createRawExpression(text) {
|
||||
var node = createNode(297 /* RawExpression */);
|
||||
node.text = text;
|
||||
return node;
|
||||
}
|
||||
ts.createRawExpression = createRawExpression;
|
||||
// Compound nodes
|
||||
function createComma(left, right) {
|
||||
return createBinary(left, 25 /* CommaToken */, right);
|
||||
@@ -39964,7 +39946,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
if (node.kind === 174 /* BindingElement */) {
|
||||
if (node.parent.kind === 172 /* ObjectBindingPattern */ && languageVersion < 5 /* ESNext */) {
|
||||
if (node.parent.kind === 172 /* ObjectBindingPattern */ && languageVersion < 5 /* ESNext */ && !ts.isInAmbientContext(node)) {
|
||||
checkExternalEmitHelpers(node, 4 /* Rest */);
|
||||
}
|
||||
// check computed properties inside property names of binding elements
|
||||
@@ -45055,7 +45037,7 @@ var ts;
|
||||
function aggregateTransformFlagsForSubtree(node) {
|
||||
// We do not transform ambient declarations or types, so there is no need to
|
||||
// recursively aggregate transform flags.
|
||||
if (ts.hasModifier(node, 2 /* Ambient */) || ts.isTypeNode(node)) {
|
||||
if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 199 /* ExpressionWithTypeArguments */)) {
|
||||
return 0 /* None */;
|
||||
}
|
||||
// Aggregate the transform flags of each child.
|
||||
@@ -52782,7 +52764,7 @@ var ts;
|
||||
emitYield(expression, /*location*/ node);
|
||||
}
|
||||
markLabel(resumeLabel);
|
||||
return createGeneratorResume();
|
||||
return createGeneratorResume(/*location*/ node);
|
||||
}
|
||||
/**
|
||||
* Visits an ArrayLiteralExpression that contains a YieldExpression.
|
||||
@@ -53014,7 +52996,9 @@ var ts;
|
||||
function transformAndEmitVariableDeclarationList(node) {
|
||||
for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) {
|
||||
var variable = _a[_i];
|
||||
hoistVariableDeclaration(variable.name);
|
||||
var name_37 = ts.getSynthesizedClone(variable.name);
|
||||
ts.setCommentRange(name_37, variable.name);
|
||||
hoistVariableDeclaration(name_37);
|
||||
}
|
||||
var variables = ts.getInitializedVariables(node);
|
||||
var numVariables = variables.length;
|
||||
@@ -53057,7 +53041,7 @@ var ts;
|
||||
if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) {
|
||||
var endLabel = defineLabel();
|
||||
var elseLabel = node.elseStatement ? defineLabel() : undefined;
|
||||
emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression));
|
||||
emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node.expression);
|
||||
transformAndEmitEmbeddedStatement(node.thenStatement);
|
||||
if (node.elseStatement) {
|
||||
emitBreak(endLabel);
|
||||
@@ -53588,9 +53572,9 @@ var ts;
|
||||
if (ts.isIdentifier(original) && original.parent) {
|
||||
var declaration = resolver.getReferencedValueDeclaration(original);
|
||||
if (declaration) {
|
||||
var name_37 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration)));
|
||||
if (name_37) {
|
||||
var clone_6 = ts.getMutableClone(name_37);
|
||||
var name_38 = ts.getProperty(renamedCatchVariableDeclarations, String(ts.getOriginalNodeId(declaration)));
|
||||
if (name_38) {
|
||||
var clone_6 = ts.getMutableClone(name_38);
|
||||
ts.setSourceMapRange(clone_6, node);
|
||||
ts.setCommentRange(clone_6, node);
|
||||
return clone_6;
|
||||
@@ -54478,9 +54462,9 @@ var ts;
|
||||
function writeReturn(expression, operationLocation) {
|
||||
lastOperationWasAbrupt = true;
|
||||
lastOperationWasCompletion = true;
|
||||
writeStatement(ts.createReturn(ts.createArrayLiteral(expression
|
||||
writeStatement(ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral(expression
|
||||
? [createInstruction(2 /* Return */), expression]
|
||||
: [createInstruction(2 /* Return */)]), operationLocation));
|
||||
: [createInstruction(2 /* Return */)]), operationLocation), 384 /* NoTokenSourceMaps */));
|
||||
}
|
||||
/**
|
||||
* Writes a Break operation to the current label's statement list.
|
||||
@@ -54490,10 +54474,10 @@ var ts;
|
||||
*/
|
||||
function writeBreak(label, operationLocation) {
|
||||
lastOperationWasAbrupt = true;
|
||||
writeStatement(ts.createReturn(ts.createArrayLiteral([
|
||||
writeStatement(ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral([
|
||||
createInstruction(3 /* Break */),
|
||||
createLabel(label)
|
||||
]), operationLocation));
|
||||
]), operationLocation), 384 /* NoTokenSourceMaps */));
|
||||
}
|
||||
/**
|
||||
* Writes a BreakWhenTrue operation to the current label's statement list.
|
||||
@@ -54503,10 +54487,10 @@ var ts;
|
||||
* @param operationLocation The source map location for the operation.
|
||||
*/
|
||||
function writeBreakWhenTrue(label, condition, operationLocation) {
|
||||
writeStatement(ts.createIf(condition, ts.createReturn(ts.createArrayLiteral([
|
||||
writeStatement(ts.setEmitFlags(ts.createIf(condition, ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral([
|
||||
createInstruction(3 /* Break */),
|
||||
createLabel(label)
|
||||
]), operationLocation)));
|
||||
]), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */));
|
||||
}
|
||||
/**
|
||||
* Writes a BreakWhenFalse operation to the current label's statement list.
|
||||
@@ -54516,10 +54500,10 @@ var ts;
|
||||
* @param operationLocation The source map location for the operation.
|
||||
*/
|
||||
function writeBreakWhenFalse(label, condition, operationLocation) {
|
||||
writeStatement(ts.createIf(ts.createLogicalNot(condition), ts.createReturn(ts.createArrayLiteral([
|
||||
writeStatement(ts.setEmitFlags(ts.createIf(ts.createLogicalNot(condition), ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral([
|
||||
createInstruction(3 /* Break */),
|
||||
createLabel(label)
|
||||
]), operationLocation)));
|
||||
]), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */));
|
||||
}
|
||||
/**
|
||||
* Writes a Yield operation to the current label's statement list.
|
||||
@@ -54529,9 +54513,9 @@ var ts;
|
||||
*/
|
||||
function writeYield(expression, operationLocation) {
|
||||
lastOperationWasAbrupt = true;
|
||||
writeStatement(ts.createReturn(ts.createArrayLiteral(expression
|
||||
writeStatement(ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral(expression
|
||||
? [createInstruction(4 /* Yield */), expression]
|
||||
: [createInstruction(4 /* Yield */)]), operationLocation));
|
||||
: [createInstruction(4 /* Yield */)]), operationLocation), 384 /* NoTokenSourceMaps */));
|
||||
}
|
||||
/**
|
||||
* Writes a YieldStar instruction to the current label's statement list.
|
||||
@@ -54541,10 +54525,10 @@ var ts;
|
||||
*/
|
||||
function writeYieldStar(expression, operationLocation) {
|
||||
lastOperationWasAbrupt = true;
|
||||
writeStatement(ts.createReturn(ts.createArrayLiteral([
|
||||
writeStatement(ts.setEmitFlags(ts.createReturn(ts.createArrayLiteral([
|
||||
createInstruction(5 /* YieldStar */),
|
||||
expression
|
||||
]), operationLocation));
|
||||
]), operationLocation), 384 /* NoTokenSourceMaps */));
|
||||
}
|
||||
/**
|
||||
* Writes an Endfinally instruction to the current label's statement list.
|
||||
@@ -56312,26 +56296,6 @@ var ts;
|
||||
function transformAMDModule(node) {
|
||||
var define = ts.createIdentifier("define");
|
||||
var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions);
|
||||
return transformAsynchronousModule(node, define, moduleName, /*includeNonAmdDependencies*/ true);
|
||||
}
|
||||
/**
|
||||
* Transforms a SourceFile into a UMD module.
|
||||
*
|
||||
* @param node The SourceFile node.
|
||||
*/
|
||||
function transformUMDModule(node) {
|
||||
var define = ts.createRawExpression(umdHelper);
|
||||
return transformAsynchronousModule(node, define, /*moduleName*/ undefined, /*includeNonAmdDependencies*/ false);
|
||||
}
|
||||
/**
|
||||
* Transforms a SourceFile into an AMD or UMD module.
|
||||
*
|
||||
* @param node The SourceFile node.
|
||||
* @param define The expression used to define the module.
|
||||
* @param moduleName An expression for the module name, if available.
|
||||
* @param includeNonAmdDependencies A value indicating whether to incldue any non-AMD dependencies.
|
||||
*/
|
||||
function transformAsynchronousModule(node, define, moduleName, includeNonAmdDependencies) {
|
||||
// An AMD define function has the following shape:
|
||||
//
|
||||
// define(id?, dependencies?, factory);
|
||||
@@ -56352,7 +56316,7 @@ var ts;
|
||||
// /// <amd-dependency path= "a.css" />
|
||||
//
|
||||
// we need to add modules without alias names to the end of the dependencies list
|
||||
var _a = collectAsynchronousDependencies(node, includeNonAmdDependencies), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;
|
||||
var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;
|
||||
// Create an updated SourceFile:
|
||||
//
|
||||
// define(moduleName?, ["module1", "module2"], function ...
|
||||
@@ -56382,6 +56346,73 @@ var ts;
|
||||
],
|
||||
/*location*/ node.statements));
|
||||
}
|
||||
/**
|
||||
* Transforms a SourceFile into a UMD module.
|
||||
*
|
||||
* @param node The SourceFile node.
|
||||
*/
|
||||
function transformUMDModule(node) {
|
||||
var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;
|
||||
var umdHeader = ts.createFunctionExpression(
|
||||
/*modifiers*/ undefined,
|
||||
/*asteriskToken*/ undefined,
|
||||
/*name*/ undefined,
|
||||
/*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "factory")],
|
||||
/*type*/ undefined, ts.createBlock([
|
||||
ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("module"), "object"), ts.createTypeCheck(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), "object")), ts.createBlock([
|
||||
ts.createVariableStatement(
|
||||
/*modifiers*/ undefined, [
|
||||
ts.createVariableDeclaration("v",
|
||||
/*type*/ undefined, ts.createCall(ts.createIdentifier("factory"),
|
||||
/*typeArguments*/ undefined, [
|
||||
ts.createIdentifier("require"),
|
||||
ts.createIdentifier("exports")
|
||||
]))
|
||||
]),
|
||||
ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier("v"), ts.createIdentifier("undefined")), ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier("module"), "exports"), ts.createIdentifier("v")))), 1 /* SingleLine */)
|
||||
]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier("define"), "function"), ts.createPropertyAccess(ts.createIdentifier("define"), "amd")), ts.createBlock([
|
||||
ts.createStatement(ts.createCall(ts.createIdentifier("define"),
|
||||
/*typeArguments*/ undefined, [
|
||||
ts.createArrayLiteral([
|
||||
ts.createLiteral("require"),
|
||||
ts.createLiteral("exports")
|
||||
].concat(aliasedModuleNames, unaliasedModuleNames)),
|
||||
ts.createIdentifier("factory")
|
||||
]))
|
||||
])))
|
||||
],
|
||||
/*location*/ undefined,
|
||||
/*multiLine*/ true));
|
||||
// Create an updated SourceFile:
|
||||
//
|
||||
// (function (factory) {
|
||||
// if (typeof module === "object" && typeof module.exports === "object") {
|
||||
// var v = factory(require, exports);
|
||||
// if (v !== undefined) module.exports = v;
|
||||
// }
|
||||
// else if (typeof define === 'function' && define.amd) {
|
||||
// define(["require", "exports"], factory);
|
||||
// }
|
||||
// })(function ...)
|
||||
return ts.updateSourceFileNode(node, ts.createNodeArray([
|
||||
ts.createStatement(ts.createCall(umdHeader,
|
||||
/*typeArguments*/ undefined, [
|
||||
// Add the module body function argument:
|
||||
//
|
||||
// function (require, exports) ...
|
||||
ts.createFunctionExpression(
|
||||
/*modifiers*/ undefined,
|
||||
/*asteriskToken*/ undefined,
|
||||
/*name*/ undefined,
|
||||
/*typeParameters*/ undefined, [
|
||||
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "require"),
|
||||
ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, "exports")
|
||||
].concat(importAliasNames),
|
||||
/*type*/ undefined, transformAsynchronousModuleBody(node))
|
||||
]))
|
||||
],
|
||||
/*location*/ node.statements));
|
||||
}
|
||||
/**
|
||||
* Collect the additional asynchronous dependencies for the module.
|
||||
*
|
||||
@@ -57170,8 +57201,8 @@ var ts;
|
||||
/*location*/ node);
|
||||
}
|
||||
else if (ts.isImportSpecifier(importDeclaration)) {
|
||||
var name_38 = importDeclaration.propertyName || importDeclaration.name;
|
||||
return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name_38),
|
||||
var name_39 = importDeclaration.propertyName || importDeclaration.name;
|
||||
return ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(name_39),
|
||||
/*location*/ node);
|
||||
}
|
||||
}
|
||||
@@ -57273,8 +57304,6 @@ var ts;
|
||||
scoped: true,
|
||||
text: "\n function __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }"
|
||||
};
|
||||
// emit output for the UMD helper function.
|
||||
var umdHelper = "\n (function (dependencies, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(dependencies, factory);\n }\n })";
|
||||
})(ts || (ts = {}));
|
||||
/// <reference path="visitor.ts" />
|
||||
/// <reference path="transformers/ts.ts" />
|
||||
@@ -57344,7 +57373,7 @@ var ts;
|
||||
* @param transforms An array of Transformers.
|
||||
*/
|
||||
function transformFiles(resolver, host, sourceFiles, transformers) {
|
||||
var enabledSyntaxKindFeatures = new Array(298 /* Count */);
|
||||
var enabledSyntaxKindFeatures = new Array(297 /* Count */);
|
||||
var lexicalEnvironmentDisabled = false;
|
||||
var lexicalEnvironmentVariableDeclarations;
|
||||
var lexicalEnvironmentFunctionDeclarations;
|
||||
@@ -58716,9 +58745,9 @@ var ts;
|
||||
var count = 0;
|
||||
while (true) {
|
||||
count++;
|
||||
var name_39 = baseName + "_" + count;
|
||||
if (!(name_39 in currentIdentifiers)) {
|
||||
return name_39;
|
||||
var name_40 = baseName + "_" + count;
|
||||
if (!(name_40 in currentIdentifiers)) {
|
||||
return name_40;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60459,8 +60488,6 @@ var ts;
|
||||
// Transformation nodes
|
||||
case 294 /* PartiallyEmittedExpression */:
|
||||
return emitPartiallyEmittedExpression(node);
|
||||
case 297 /* RawExpression */:
|
||||
return writeLines(node.text);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -61001,27 +61028,27 @@ var ts;
|
||||
writeToken(18 /* OpenParenToken */, openParenPos, node);
|
||||
emitExpression(node.expression);
|
||||
writeToken(19 /* CloseParenToken */, node.expression.end, node);
|
||||
emitEmbeddedStatement(node.thenStatement);
|
||||
emitEmbeddedStatement(node, node.thenStatement);
|
||||
if (node.elseStatement) {
|
||||
writeLine();
|
||||
writeLineOrSpace(node);
|
||||
writeToken(81 /* ElseKeyword */, node.thenStatement.end, node);
|
||||
if (node.elseStatement.kind === 208 /* IfStatement */) {
|
||||
write(" ");
|
||||
emit(node.elseStatement);
|
||||
}
|
||||
else {
|
||||
emitEmbeddedStatement(node.elseStatement);
|
||||
emitEmbeddedStatement(node, node.elseStatement);
|
||||
}
|
||||
}
|
||||
}
|
||||
function emitDoStatement(node) {
|
||||
write("do");
|
||||
emitEmbeddedStatement(node.statement);
|
||||
emitEmbeddedStatement(node, node.statement);
|
||||
if (ts.isBlock(node.statement)) {
|
||||
write(" ");
|
||||
}
|
||||
else {
|
||||
writeLine();
|
||||
writeLineOrSpace(node);
|
||||
}
|
||||
write("while (");
|
||||
emitExpression(node.expression);
|
||||
@@ -61031,7 +61058,7 @@ var ts;
|
||||
write("while (");
|
||||
emitExpression(node.expression);
|
||||
write(")");
|
||||
emitEmbeddedStatement(node.statement);
|
||||
emitEmbeddedStatement(node, node.statement);
|
||||
}
|
||||
function emitForStatement(node) {
|
||||
var openParenPos = writeToken(87 /* ForKeyword */, node.pos);
|
||||
@@ -61043,7 +61070,7 @@ var ts;
|
||||
write(";");
|
||||
emitExpressionWithPrefix(" ", node.incrementor);
|
||||
write(")");
|
||||
emitEmbeddedStatement(node.statement);
|
||||
emitEmbeddedStatement(node, node.statement);
|
||||
}
|
||||
function emitForInStatement(node) {
|
||||
var openParenPos = writeToken(87 /* ForKeyword */, node.pos);
|
||||
@@ -61053,7 +61080,7 @@ var ts;
|
||||
write(" in ");
|
||||
emitExpression(node.expression);
|
||||
writeToken(19 /* CloseParenToken */, node.expression.end);
|
||||
emitEmbeddedStatement(node.statement);
|
||||
emitEmbeddedStatement(node, node.statement);
|
||||
}
|
||||
function emitForOfStatement(node) {
|
||||
var openParenPos = writeToken(87 /* ForKeyword */, node.pos);
|
||||
@@ -61063,7 +61090,7 @@ var ts;
|
||||
write(" of ");
|
||||
emitExpression(node.expression);
|
||||
writeToken(19 /* CloseParenToken */, node.expression.end);
|
||||
emitEmbeddedStatement(node.statement);
|
||||
emitEmbeddedStatement(node, node.statement);
|
||||
}
|
||||
function emitForBinding(node) {
|
||||
if (node !== undefined) {
|
||||
@@ -61094,7 +61121,7 @@ var ts;
|
||||
write("with (");
|
||||
emitExpression(node.expression);
|
||||
write(")");
|
||||
emitEmbeddedStatement(node.statement);
|
||||
emitEmbeddedStatement(node, node.statement);
|
||||
}
|
||||
function emitSwitchStatement(node) {
|
||||
var openParenPos = writeToken(97 /* SwitchKeyword */, node.pos);
|
||||
@@ -61118,9 +61145,12 @@ var ts;
|
||||
function emitTryStatement(node) {
|
||||
write("try ");
|
||||
emit(node.tryBlock);
|
||||
emit(node.catchClause);
|
||||
if (node.catchClause) {
|
||||
writeLineOrSpace(node);
|
||||
emit(node.catchClause);
|
||||
}
|
||||
if (node.finallyBlock) {
|
||||
writeLine();
|
||||
writeLineOrSpace(node);
|
||||
write("finally ");
|
||||
emit(node.finallyBlock);
|
||||
}
|
||||
@@ -61698,8 +61728,8 @@ var ts;
|
||||
write(suffix);
|
||||
}
|
||||
}
|
||||
function emitEmbeddedStatement(node) {
|
||||
if (ts.isBlock(node)) {
|
||||
function emitEmbeddedStatement(parent, node) {
|
||||
if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1 /* SingleLine */) {
|
||||
write(" ");
|
||||
emit(node);
|
||||
}
|
||||
@@ -61840,6 +61870,14 @@ var ts;
|
||||
write(getClosingBracket(format));
|
||||
}
|
||||
}
|
||||
function writeLineOrSpace(node) {
|
||||
if (ts.getEmitFlags(node) & 1 /* SingleLine */) {
|
||||
write(" ");
|
||||
}
|
||||
else {
|
||||
writeLine();
|
||||
}
|
||||
}
|
||||
function writeIfAny(nodes, text) {
|
||||
if (nodes && nodes.length > 0) {
|
||||
write(text);
|
||||
@@ -62031,10 +62069,10 @@ var ts;
|
||||
*/
|
||||
function makeTempVariableName(flags) {
|
||||
if (flags && !(tempFlags & flags)) {
|
||||
var name_40 = flags === 268435456 /* _i */ ? "_i" : "_n";
|
||||
if (isUniqueName(name_40)) {
|
||||
var name_41 = flags === 268435456 /* _i */ ? "_i" : "_n";
|
||||
if (isUniqueName(name_41)) {
|
||||
tempFlags |= flags;
|
||||
return name_40;
|
||||
return name_41;
|
||||
}
|
||||
}
|
||||
while (true) {
|
||||
@@ -62042,11 +62080,11 @@ var ts;
|
||||
tempFlags++;
|
||||
// Skip over 'i' and 'n'
|
||||
if (count !== 8 && count !== 13) {
|
||||
var name_41 = count < 26
|
||||
var name_42 = count < 26
|
||||
? "_" + String.fromCharCode(97 /* a */ + count)
|
||||
: "_" + (count - 26);
|
||||
if (isUniqueName(name_41)) {
|
||||
return name_41;
|
||||
if (isUniqueName(name_42)) {
|
||||
return name_42;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62497,10 +62535,10 @@ var ts;
|
||||
var resolutions = [];
|
||||
var cache = ts.createMap();
|
||||
for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {
|
||||
var name_42 = names_1[_i];
|
||||
var result = name_42 in cache
|
||||
? cache[name_42]
|
||||
: cache[name_42] = loader(name_42, containingFile);
|
||||
var name_43 = names_1[_i];
|
||||
var result = name_43 in cache
|
||||
? cache[name_43]
|
||||
: cache[name_43] = loader(name_43, containingFile);
|
||||
resolutions.push(result);
|
||||
}
|
||||
return resolutions;
|
||||
@@ -64545,11 +64583,11 @@ var ts;
|
||||
function serializeCompilerOptions(options) {
|
||||
var result = ts.createMap();
|
||||
var optionsNameMap = getOptionNameMap().optionNameMap;
|
||||
for (var name_43 in options) {
|
||||
if (ts.hasProperty(options, name_43)) {
|
||||
for (var name_44 in options) {
|
||||
if (ts.hasProperty(options, name_44)) {
|
||||
// tsconfig only options cannot be specified via command line,
|
||||
// so we can assume that only types that can appear here string | number | boolean
|
||||
switch (name_43) {
|
||||
switch (name_44) {
|
||||
case "init":
|
||||
case "watch":
|
||||
case "version":
|
||||
@@ -64557,14 +64595,14 @@ var ts;
|
||||
case "project":
|
||||
break;
|
||||
default:
|
||||
var value = options[name_43];
|
||||
var optionDefinition = optionsNameMap[name_43.toLowerCase()];
|
||||
var value = options[name_44];
|
||||
var optionDefinition = optionsNameMap[name_44.toLowerCase()];
|
||||
if (optionDefinition) {
|
||||
var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition);
|
||||
if (!customTypeMap) {
|
||||
// There is no map associated with this compiler option then use the value as-is
|
||||
// This is the case if the value is expect to be string, number, boolean or list of string
|
||||
result[name_43] = value;
|
||||
result[name_44] = value;
|
||||
}
|
||||
else {
|
||||
if (optionDefinition.type === "list") {
|
||||
@@ -64573,11 +64611,11 @@ var ts;
|
||||
var element = _a[_i];
|
||||
convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap));
|
||||
}
|
||||
result[name_43] = convertedValue;
|
||||
result[name_44] = convertedValue;
|
||||
}
|
||||
else {
|
||||
// There is a typeMap associated with this command-line option so use it to map value back to its name
|
||||
result[name_43] = getNameOfCompilerOptionValue(value, customTypeMap);
|
||||
result[name_44] = getNameOfCompilerOptionValue(value, customTypeMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67614,14 +67652,14 @@ var ts;
|
||||
function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames) {
|
||||
var entries = [];
|
||||
var nameTable = ts.getNameTable(sourceFile);
|
||||
for (var name_44 in nameTable) {
|
||||
for (var name_45 in nameTable) {
|
||||
// Skip identifiers produced only from the current location
|
||||
if (nameTable[name_44] === position) {
|
||||
if (nameTable[name_45] === position) {
|
||||
continue;
|
||||
}
|
||||
if (!uniqueNames[name_44]) {
|
||||
uniqueNames[name_44] = name_44;
|
||||
var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_44), compilerOptions.target, /*performCharacterChecks*/ true);
|
||||
if (!uniqueNames[name_45]) {
|
||||
uniqueNames[name_45] = name_45;
|
||||
var displayName = getCompletionEntryDisplayName(ts.unescapeIdentifier(name_45), compilerOptions.target, /*performCharacterChecks*/ true);
|
||||
if (displayName) {
|
||||
var entry = {
|
||||
name: displayName,
|
||||
@@ -68928,8 +68966,8 @@ var ts;
|
||||
if (element.getStart() <= position && position <= element.getEnd()) {
|
||||
continue;
|
||||
}
|
||||
var name_45 = element.propertyName || element.name;
|
||||
existingImportsOrExports[name_45.text] = true;
|
||||
var name_46 = element.propertyName || element.name;
|
||||
existingImportsOrExports[name_46.text] = true;
|
||||
}
|
||||
if (!ts.someProperties(existingImportsOrExports)) {
|
||||
return ts.filter(exportsOfModule, function (e) { return e.name !== "default"; });
|
||||
@@ -71577,9 +71615,9 @@ var ts;
|
||||
}
|
||||
}
|
||||
// Add the cached typing locations for inferred typings that are already installed
|
||||
for (var name_46 in packageNameToTypingLocation) {
|
||||
if (name_46 in inferredTypings && !inferredTypings[name_46]) {
|
||||
inferredTypings[name_46] = packageNameToTypingLocation[name_46];
|
||||
for (var name_47 in packageNameToTypingLocation) {
|
||||
if (name_47 in inferredTypings && !inferredTypings[name_47]) {
|
||||
inferredTypings[name_47] = packageNameToTypingLocation[name_47];
|
||||
}
|
||||
}
|
||||
// Remove typings that the user has added to the exclude list
|
||||
@@ -71717,12 +71755,12 @@ var ts;
|
||||
return;
|
||||
}
|
||||
var nameToDeclarations = sourceFile.getNamedDeclarations();
|
||||
for (var name_47 in nameToDeclarations) {
|
||||
var declarations = nameToDeclarations[name_47];
|
||||
for (var name_48 in nameToDeclarations) {
|
||||
var declarations = nameToDeclarations[name_48];
|
||||
if (declarations) {
|
||||
// First do a quick check to see if the name of the declaration matches the
|
||||
// last portion of the (possibly) dotted name they're searching for.
|
||||
var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_47);
|
||||
var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_48);
|
||||
if (!matches) {
|
||||
continue;
|
||||
}
|
||||
@@ -71735,14 +71773,14 @@ var ts;
|
||||
if (!containers) {
|
||||
return undefined;
|
||||
}
|
||||
matches = patternMatcher.getMatches(containers, name_47);
|
||||
matches = patternMatcher.getMatches(containers, name_48);
|
||||
if (!matches) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
var fileName = sourceFile.fileName;
|
||||
var matchKind = bestMatchKind(matches);
|
||||
rawItems.push({ name: name_47, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration });
|
||||
rawItems.push({ name: name_48, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72031,9 +72069,9 @@ var ts;
|
||||
case 174 /* BindingElement */:
|
||||
case 223 /* VariableDeclaration */:
|
||||
var decl = node;
|
||||
var name_48 = decl.name;
|
||||
if (ts.isBindingPattern(name_48)) {
|
||||
addChildrenRecursively(name_48);
|
||||
var name_49 = decl.name;
|
||||
if (ts.isBindingPattern(name_49)) {
|
||||
addChildrenRecursively(name_49);
|
||||
}
|
||||
else if (decl.initializer && isFunctionOrClassExpression(decl.initializer)) {
|
||||
// For `const x = function() {}`, just use the function node, not the const.
|
||||
@@ -75538,9 +75576,9 @@ var ts;
|
||||
}
|
||||
Rules.prototype.getRuleName = function (rule) {
|
||||
var o = this;
|
||||
for (var name_49 in o) {
|
||||
if (o[name_49] === rule) {
|
||||
return name_49;
|
||||
for (var name_50 in o) {
|
||||
if (o[name_50] === rule) {
|
||||
return name_50;
|
||||
}
|
||||
}
|
||||
throw new Error("Unknown rule");
|
||||
|
||||
Reference in New Issue
Block a user