From 407c8beed5b87582cfc5281b3a7db10d3ea20ee5 Mon Sep 17 00:00:00 2001 From: David Souther Date: Tue, 18 Aug 2015 21:17:43 -0400 Subject: [PATCH] Emits safe value for import. --- src/compiler/utilities.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 0847d1d7829..8dee87d29b6 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -240,7 +240,7 @@ namespace ts { // Make an identifier from an external module name by extracting the string after the last "/" and replacing // all non-alphanumeric characters with underscores export function makeIdentifierFromModuleName(moduleName: string): string { - return getBaseFileName(moduleName).replace(/\W/g, "_"); + return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); } export function isBlockOrCatchScoped(declaration: Declaration) {