mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-22 07:25:55 -06:00
Ensure that the import helper is checked for tagged templates, and update its name.
This commit is contained in:
parent
886a29b512
commit
1841afeaa2
4
src/compiler/checker.ts
Normal file → Executable file
4
src/compiler/checker.ts
Normal file → Executable file
@ -16665,7 +16665,7 @@ namespace ts {
|
||||
|
||||
function checkTaggedTemplateExpression(node: TaggedTemplateExpression): Type {
|
||||
if (languageVersion < ScriptTarget.ES2015) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.GetTemplateObject);
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.MakeTemplateObject);
|
||||
}
|
||||
return getReturnTypeOfSignature(getResolvedSignature(node));
|
||||
}
|
||||
@ -24032,7 +24032,7 @@ namespace ts {
|
||||
case ExternalEmitHelpers.AsyncDelegator: return "__asyncDelegator";
|
||||
case ExternalEmitHelpers.AsyncValues: return "__asyncValues";
|
||||
case ExternalEmitHelpers.ExportStar: return "__exportStar";
|
||||
case ExternalEmitHelpers.GetTemplateObject: return "__getTemplateObject";
|
||||
case ExternalEmitHelpers.MakeTemplateObject: return "__makeTemplateObject";
|
||||
default: Debug.fail("Unrecognized helper");
|
||||
}
|
||||
}
|
||||
|
||||
5
src/compiler/types.ts
Normal file → Executable file
5
src/compiler/types.ts
Normal file → Executable file
@ -4287,7 +4287,8 @@ namespace ts {
|
||||
AsyncDelegator = 1 << 13, // __asyncDelegator (used by ES2017 async generator yield* transformation)
|
||||
AsyncValues = 1 << 14, // __asyncValues (used by ES2017 for..await..of transformation)
|
||||
ExportStar = 1 << 15, // __exportStar (used by CommonJS/AMD/UMD module transformation)
|
||||
GetTemplateObject = 1 << 16, // __getTemplateObject (used for constructing template string array objects)
|
||||
MakeTemplateObject = 1 << 16, // __makeTemplateObject (used for constructing template string array objects)
|
||||
" LastPlusOne",
|
||||
|
||||
// Helpers included by ES2015 for..of
|
||||
ForOfIncludes = Values,
|
||||
@ -4305,7 +4306,7 @@ namespace ts {
|
||||
SpreadIncludes = Read | Spread,
|
||||
|
||||
FirstEmitHelper = Extends,
|
||||
LastEmitHelper = ExportStar
|
||||
LastEmitHelper = ExternalEmitHelpers[" LastPlusOne"] - 1
|
||||
}
|
||||
|
||||
export const enum EmitHint {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user