use JS in createDeclarationScriptlet