Remember user-provided strings

master
Vitaliy Filippov 2021-08-28 16:07:16 +03:00
parent 554a60abf5
commit 429a3c1a58
1 changed files with 6 additions and 0 deletions

View File

@ -173,6 +173,12 @@ module.exports = function(babel)
{
if (path.node.callee.type === 'Identifier' && path.node.callee.name === 'L')
{
if (t.isStringLiteral(path.node.arguments[0]))
{
// Remember the user-provided string
addString(path, path.node.arguments[0].value);
addImport(path);
}
// Skip the first argument
arg0.add(path.node.arguments[0]);
}