Skip to content

3.9.1-rc regression: Unable to specify rawText when programmatically creating tagged template literals #38485

@petebacondarwin

Description

@petebacondarwin

TypeScript Version: 3.9.1-rc
Search Terms: tagged template literal rawText raw ES5

Code

The problem occurs when synthesising tagged template literals programmatically, and then trying to render them in ES5.

The API provides a method for specifying the "raw" parts of the template:

const template = ts.createNoSubstitutionTemplateLiteral('text', 'text');

But due to this regression this raw value is no longer being used.
An empty string is there, instead.

Here is a link to a reproduction: https://github.com/petebacondarwin/ts-3.9-rawtext-bug

Expected behavior:

$localize(__makeTemplateObject(["text"], ["text"]));

Actual behavior:

$localize(__makeTemplateObject(["text"], [""]));

Playground Link:
It is not possible to provide a Playground link because it only occurs when programmatically creating a tagged template literal AST node.

See the reproduction at https://github.com/petebacondarwin/ts-3.9-rawtext-bug

Related Issues:

This is a regression due to this commit: 70399e1#r39098346

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: APIRelates to the public API for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions