public function isJavaScript()
{
if ($this->getContentType()) {
return 'text/javascript' === strtolower($this->getContentType());
}
if ($this->getPath()) {
$exploded = explode('.', $this->getPath());
return 'js' === strtolower(array_pop($exploded));
}
return false;
}