protected function getClosureScopedVariablesScript()
{
$js = [];
foreach ($this->getClosureScopedVariables() as $name => $value) {
if ($value !== null) {
if (!$value instanceof JsExpression && strpos('{', $value) !== false) {
$value = is_string($value) ? "'{$value}'" : $value;
}
$value = " = {$value}";
}
$js[] = "var {$name}{$value};";
}
return implode("\n", $js);
}