Skip to content

Commit 4df53c1

Browse files
author
Andy Hanson
committed
Allow NoSubstitutionTemplateLiteral as argument to createLiteral
1 parent 051c9c8 commit 4df53c1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/compiler/factory.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ namespace ts {
7171
// Literals
7272

7373
/** If a node is passed, creates a string literal whose source text is read from a source node during emit. */
74-
export function createLiteral(value: string | StringLiteral | NumericLiteral | Identifier): StringLiteral;
74+
export function createLiteral(value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral;
7575
export function createLiteral(value: number): NumericLiteral;
7676
export function createLiteral(value: boolean): BooleanLiteral;
7777
export function createLiteral(value: string | number | boolean): PrimaryExpression;
78-
export function createLiteral(value: string | number | boolean | StringLiteral | NumericLiteral | Identifier): PrimaryExpression {
78+
export function createLiteral(value: string | number | boolean | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): PrimaryExpression {
7979
if (typeof value === "number") {
8080
return createNumericLiteral(value + "");
8181
}

tests/baselines/reference/api/tsserverlibrary.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3289,7 +3289,7 @@ declare namespace ts {
32893289
declare namespace ts {
32903290
function createNodeArray<T extends Node>(elements?: ReadonlyArray<T>, hasTrailingComma?: boolean): NodeArray<T>;
32913291
/** If a node is passed, creates a string literal whose source text is read from a source node during emit. */
3292-
function createLiteral(value: string | StringLiteral | NumericLiteral | Identifier): StringLiteral;
3292+
function createLiteral(value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral;
32933293
function createLiteral(value: number): NumericLiteral;
32943294
function createLiteral(value: boolean): BooleanLiteral;
32953295
function createLiteral(value: string | number | boolean): PrimaryExpression;

tests/baselines/reference/api/typescript.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3236,7 +3236,7 @@ declare namespace ts {
32363236
declare namespace ts {
32373237
function createNodeArray<T extends Node>(elements?: ReadonlyArray<T>, hasTrailingComma?: boolean): NodeArray<T>;
32383238
/** If a node is passed, creates a string literal whose source text is read from a source node during emit. */
3239-
function createLiteral(value: string | StringLiteral | NumericLiteral | Identifier): StringLiteral;
3239+
function createLiteral(value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral;
32403240
function createLiteral(value: number): NumericLiteral;
32413241
function createLiteral(value: boolean): BooleanLiteral;
32423242
function createLiteral(value: string | number | boolean): PrimaryExpression;

0 commit comments

Comments
 (0)