[scriptlet engine] Mind old scriptlet names not using `.js`

Related commit:
- 5552d6717d
This commit is contained in:
Raymond Hill 2019-07-09 11:36:42 -04:00
parent 5c449f59f2
commit b54522caa1
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 8 additions and 1 deletions

View File

@ -205,8 +205,15 @@
token = rawToken.slice(0, pos).trim(); token = rawToken.slice(0, pos).trim();
args = rawToken.slice(pos + 1).trim(); args = rawToken.slice(pos + 1).trim();
} }
// TODO: The alias lookup can be removed once scriptlet resources
// with obsolete name are converted to their new name.
if ( reng.aliases.has(token) ) {
token = reng.aliases.get(token);
} else {
token = `${token}.js`;
}
content = reng.resourceContentFromName( content = reng.resourceContentFromName(
`${token}.js`, token,
'application/javascript' 'application/javascript'
); );
if ( !content ) { return; } if ( !content ) { return; }