Skip to content

Commit d9a9119

Browse files
committed
warn when using deprecated _SCRIPT_NAME
1 parent d58ea4a commit d9a9119

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/processScript/transform.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export function transform(
7070
}
7171

7272
if (program.scope.hasGlobal(`_SCRIPT_NAME`)) {
73+
warnings.push({ message: `Global _SCRIPT_NAME is deprecated and will be removed in the next minor release of HSM, use _SCRIPT_SUBNAME instead` })
74+
7375
for (const referencePath of getReferencePathsToGlobal(`_SCRIPT_NAME`, program))
7476
referencePath.replaceWith(t.stringLiteral(scriptName == true ? `$${uniqueId}$SCRIPT_NAME$` : scriptName))
7577
}

0 commit comments

Comments
 (0)