Skip to content

Commit

Permalink
Merge branch 'release-3.9' into pick/38653/release-3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Jun 15, 2020
2 parents 9816f15 + c388222 commit 07faad8
Show file tree
Hide file tree
Showing 104 changed files with 1,140 additions and 1,400 deletions.
19 changes: 9 additions & 10 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
var ts;
(function (ts) {
ts.versionMajorMinor = "3.9";
ts.version = "3.9.3";
ts.version = "3.9.5";
function tryGetNativeMap() {
return typeof Map !== "undefined" && "entries" in Map.prototype ? Map : undefined;
}
Expand Down Expand Up @@ -65536,6 +65536,8 @@ var ts;
facts |= 32;
else if (isNamedExternalModuleExport(node))
facts |= 16;
if (languageVersion <= 1 && (facts & 7))
facts |= 128;
return facts;
}
function hasTypeScriptClassSyntax(node) {
Expand All @@ -65553,7 +65555,7 @@ var ts;
}
var staticProperties = ts.getProperties(node, true, true);
var facts = getClassFacts(node, staticProperties);
if (facts & 7) {
if (facts & 128) {
context.startLexicalEnvironment();
}
var name = node.name || (facts & 5 ? ts.getGeneratedNameForNode(node) : undefined);
Expand All @@ -65564,7 +65566,7 @@ var ts;
addClassElementDecorationStatements(statements, node, false);
addClassElementDecorationStatements(statements, node, true);
addConstructorDecorationStatement(statements, node);
if (facts & 7) {
if (facts & 128) {
var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentSourceFile.text, node.members.end), 19);
var localName = ts.getInternalName(node);
var outer = ts.createPartiallyEmittedExpression(localName);
Expand All @@ -65577,12 +65579,9 @@ var ts;
ts.insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment());
var iife = ts.createImmediatelyInvokedArrowFunction(statements);
ts.setEmitFlags(iife, 33554432);
if (languageVersion > 1) {
ts.addSyntheticLeadingComment(iife, 3, "* @class ");
}
var varStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
ts.createVariableDeclaration(ts.getLocalName(node, false, false), undefined, iife)
], languageVersion > 1 ? 1 : undefined));
]));
ts.setOriginalNode(varStatement, node);
ts.setCommentRange(varStatement, node);
ts.setSourceMapRange(varStatement, ts.moveRangePastDecorators(node));
Expand All @@ -65592,7 +65591,7 @@ var ts;
if (facts & 8) {
addExportMemberAssignment(statements, node);
}
else if (facts & 7 || facts & 2) {
else if (facts & 128 || facts & 2) {
if (facts & 32) {
statements.push(ts.createExportDefault(ts.getLocalName(node, false, true)));
}
Expand All @@ -65607,7 +65606,7 @@ var ts;
return ts.singleOrMany(statements);
}
function createClassDeclarationHeadWithoutDecorators(node, name, facts) {
var modifiers = !(facts & 7)
var modifiers = !(facts & 128)
? ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier)
: undefined;
var classDeclaration = ts.createClassDeclaration(undefined, modifiers, name, undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node));
Expand Down Expand Up @@ -74083,7 +74082,7 @@ var ts;
scoped: false,
dependencies: [ts.createBindingHelper, ts.setModuleDefaultHelper],
priority: 2,
text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};"
text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};"
};
ts.importDefaultHelper = {
name: "typescript:commonjsimportdefault",
Expand Down
24 changes: 11 additions & 13 deletions lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var ts;
// If changing the text in this section, be sure to test `configurePrerelease` too.
ts.versionMajorMinor = "3.9";
/** The version of the TypeScript compiler release */
ts.version = "3.9.3";
ts.version = "3.9.5";
/**
* Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
*/
Expand Down Expand Up @@ -77269,9 +77269,10 @@ var ts;
ClassFacts[ClassFacts["IsNamedExternalExport"] = 16] = "IsNamedExternalExport";
ClassFacts[ClassFacts["IsDefaultExternalExport"] = 32] = "IsDefaultExternalExport";
ClassFacts[ClassFacts["IsDerivedClass"] = 64] = "IsDerivedClass";
ClassFacts[ClassFacts["UseImmediatelyInvokedFunctionExpression"] = 128] = "UseImmediatelyInvokedFunctionExpression";
ClassFacts[ClassFacts["HasAnyDecorators"] = 6] = "HasAnyDecorators";
ClassFacts[ClassFacts["NeedsName"] = 5] = "NeedsName";
ClassFacts[ClassFacts["UseImmediatelyInvokedFunctionExpression"] = 7] = "UseImmediatelyInvokedFunctionExpression";
ClassFacts[ClassFacts["MayNeedImmediatelyInvokedFunctionExpression"] = 7] = "MayNeedImmediatelyInvokedFunctionExpression";
ClassFacts[ClassFacts["IsExported"] = 56] = "IsExported";
})(ClassFacts || (ClassFacts = {}));
function transformTypeScript(context) {
Expand Down Expand Up @@ -77758,6 +77759,8 @@ var ts;
facts |= 32 /* IsDefaultExternalExport */;
else if (isNamedExternalModuleExport(node))
facts |= 16 /* IsNamedExternalExport */;
if (languageVersion <= 1 /* ES5 */ && (facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */))
facts |= 128 /* UseImmediatelyInvokedFunctionExpression */;
return facts;
}
function hasTypeScriptClassSyntax(node) {
Expand All @@ -77775,7 +77778,7 @@ var ts;
}
var staticProperties = ts.getProperties(node, /*requireInitializer*/ true, /*isStatic*/ true);
var facts = getClassFacts(node, staticProperties);
if (facts & 7 /* UseImmediatelyInvokedFunctionExpression */) {
if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) {
context.startLexicalEnvironment();
}
var name = node.name || (facts & 5 /* NeedsName */ ? ts.getGeneratedNameForNode(node) : undefined);
Expand All @@ -77787,7 +77790,7 @@ var ts;
addClassElementDecorationStatements(statements, node, /*isStatic*/ false);
addClassElementDecorationStatements(statements, node, /*isStatic*/ true);
addConstructorDecorationStatement(statements, node);
if (facts & 7 /* UseImmediatelyInvokedFunctionExpression */) {
if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) {
// When we emit a TypeScript class down to ES5, we must wrap it in an IIFE so that the
// 'es2015' transformer can properly nest static initializers and decorators. The result
// looks something like:
Expand All @@ -77813,16 +77816,11 @@ var ts;
ts.insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment());
var iife = ts.createImmediatelyInvokedArrowFunction(statements);
ts.setEmitFlags(iife, 33554432 /* TypeScriptClassWrapper */);
// Class comment is already added by the ES2015 transform when targeting ES5 or below.
// Only add if targetting ES2015+ to prevent duplicates
if (languageVersion > 1 /* ES5 */) {
ts.addSyntheticLeadingComment(iife, 3 /* MultiLineCommentTrivia */, "* @class ");
}
var varStatement = ts.createVariableStatement(
/*modifiers*/ undefined, ts.createVariableDeclarationList([
ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ false),
/*type*/ undefined, iife)
], languageVersion > 1 /* ES5 */ ? 1 /* Let */ : undefined));
]));
ts.setOriginalNode(varStatement, node);
ts.setCommentRange(varStatement, node);
ts.setSourceMapRange(varStatement, ts.moveRangePastDecorators(node));
Expand All @@ -77835,7 +77833,7 @@ var ts;
if (facts & 8 /* IsExportOfNamespace */) {
addExportMemberAssignment(statements, node);
}
else if (facts & 7 /* UseImmediatelyInvokedFunctionExpression */ || facts & 2 /* HasConstructorDecorators */) {
else if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */ || facts & 2 /* HasConstructorDecorators */) {
if (facts & 32 /* IsDefaultExternalExport */) {
statements.push(ts.createExportDefault(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)));
}
Expand All @@ -77862,7 +77860,7 @@ var ts;
// ${members}
// }
// we do not emit modifiers on the declaration if we are emitting an IIFE
var modifiers = !(facts & 7 /* UseImmediatelyInvokedFunctionExpression */)
var modifiers = !(facts & 128 /* UseImmediatelyInvokedFunctionExpression */)
? ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier)
: undefined;
var classDeclaration = ts.createClassDeclaration(
Expand Down Expand Up @@ -90382,7 +90380,7 @@ var ts;
scoped: false,
dependencies: [ts.createBindingHelper, ts.setModuleDefaultHelper],
priority: 2,
text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};"
text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};"
};
// emit helper for `import Name from "foo"`
ts.importDefaultHelper = {
Expand Down
24 changes: 11 additions & 13 deletions lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ var ts;
// If changing the text in this section, be sure to test `configurePrerelease` too.
ts.versionMajorMinor = "3.9";
/** The version of the TypeScript compiler release */
ts.version = "3.9.3";
ts.version = "3.9.5";
/**
* Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
*/
Expand Down Expand Up @@ -77419,9 +77419,10 @@ var ts;
ClassFacts[ClassFacts["IsNamedExternalExport"] = 16] = "IsNamedExternalExport";
ClassFacts[ClassFacts["IsDefaultExternalExport"] = 32] = "IsDefaultExternalExport";
ClassFacts[ClassFacts["IsDerivedClass"] = 64] = "IsDerivedClass";
ClassFacts[ClassFacts["UseImmediatelyInvokedFunctionExpression"] = 128] = "UseImmediatelyInvokedFunctionExpression";
ClassFacts[ClassFacts["HasAnyDecorators"] = 6] = "HasAnyDecorators";
ClassFacts[ClassFacts["NeedsName"] = 5] = "NeedsName";
ClassFacts[ClassFacts["UseImmediatelyInvokedFunctionExpression"] = 7] = "UseImmediatelyInvokedFunctionExpression";
ClassFacts[ClassFacts["MayNeedImmediatelyInvokedFunctionExpression"] = 7] = "MayNeedImmediatelyInvokedFunctionExpression";
ClassFacts[ClassFacts["IsExported"] = 56] = "IsExported";
})(ClassFacts || (ClassFacts = {}));
function transformTypeScript(context) {
Expand Down Expand Up @@ -77908,6 +77909,8 @@ var ts;
facts |= 32 /* IsDefaultExternalExport */;
else if (isNamedExternalModuleExport(node))
facts |= 16 /* IsNamedExternalExport */;
if (languageVersion <= 1 /* ES5 */ && (facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */))
facts |= 128 /* UseImmediatelyInvokedFunctionExpression */;
return facts;
}
function hasTypeScriptClassSyntax(node) {
Expand All @@ -77925,7 +77928,7 @@ var ts;
}
var staticProperties = ts.getProperties(node, /*requireInitializer*/ true, /*isStatic*/ true);
var facts = getClassFacts(node, staticProperties);
if (facts & 7 /* UseImmediatelyInvokedFunctionExpression */) {
if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) {
context.startLexicalEnvironment();
}
var name = node.name || (facts & 5 /* NeedsName */ ? ts.getGeneratedNameForNode(node) : undefined);
Expand All @@ -77937,7 +77940,7 @@ var ts;
addClassElementDecorationStatements(statements, node, /*isStatic*/ false);
addClassElementDecorationStatements(statements, node, /*isStatic*/ true);
addConstructorDecorationStatement(statements, node);
if (facts & 7 /* UseImmediatelyInvokedFunctionExpression */) {
if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) {
// When we emit a TypeScript class down to ES5, we must wrap it in an IIFE so that the
// 'es2015' transformer can properly nest static initializers and decorators. The result
// looks something like:
Expand All @@ -77963,16 +77966,11 @@ var ts;
ts.insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment());
var iife = ts.createImmediatelyInvokedArrowFunction(statements);
ts.setEmitFlags(iife, 33554432 /* TypeScriptClassWrapper */);
// Class comment is already added by the ES2015 transform when targeting ES5 or below.
// Only add if targetting ES2015+ to prevent duplicates
if (languageVersion > 1 /* ES5 */) {
ts.addSyntheticLeadingComment(iife, 3 /* MultiLineCommentTrivia */, "* @class ");
}
var varStatement = ts.createVariableStatement(
/*modifiers*/ undefined, ts.createVariableDeclarationList([
ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ false),
/*type*/ undefined, iife)
], languageVersion > 1 /* ES5 */ ? 1 /* Let */ : undefined));
]));
ts.setOriginalNode(varStatement, node);
ts.setCommentRange(varStatement, node);
ts.setSourceMapRange(varStatement, ts.moveRangePastDecorators(node));
Expand All @@ -77985,7 +77983,7 @@ var ts;
if (facts & 8 /* IsExportOfNamespace */) {
addExportMemberAssignment(statements, node);
}
else if (facts & 7 /* UseImmediatelyInvokedFunctionExpression */ || facts & 2 /* HasConstructorDecorators */) {
else if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */ || facts & 2 /* HasConstructorDecorators */) {
if (facts & 32 /* IsDefaultExternalExport */) {
statements.push(ts.createExportDefault(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)));
}
Expand All @@ -78012,7 +78010,7 @@ var ts;
// ${members}
// }
// we do not emit modifiers on the declaration if we are emitting an IIFE
var modifiers = !(facts & 7 /* UseImmediatelyInvokedFunctionExpression */)
var modifiers = !(facts & 128 /* UseImmediatelyInvokedFunctionExpression */)
? ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier)
: undefined;
var classDeclaration = ts.createClassDeclaration(
Expand Down Expand Up @@ -90532,7 +90530,7 @@ var ts;
scoped: false,
dependencies: [ts.createBindingHelper, ts.setModuleDefaultHelper],
priority: 2,
text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};"
text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};"
};
// emit helper for `import Name from "foo"`
ts.importDefaultHelper = {
Expand Down
Loading

0 comments on commit 07faad8

Please sign in to comment.