Smarty auto-escape of javascript not working?-Collection of common programming errors

I am using the below code with smarty V3


    $(function() {
        jwplayer("video-player-{$v->id}").setup( {
            file: "/webfiles/competitions/movies/{$v->file}",
            skin: "/assets/jwplayer/skins/simplicity/simplicity.zip",
            width: 446,
            height: 353,
            stretching: "fill",
            flashplayer: "/assets/jwplayer/player.swf"
        } );
    } );

The manual states:

Note
{literal}{/literal} tags are normally not necessary, as Smarty ignores delimiters that are surrounded by whitespace. Be sure your javascript and CSS curly braces are surrounded by whitespace. This is new behavior to Smarty 3.

and gives the below example:


   // the following braces are ignored by Smarty
   // since they are surrounded by whitespace
   function myFoo {
     alert('Foo!');
   }
   // this one will need literal escapement
   {literal}
     function myBar {alert('Bar!');}
   {/literal}

But I am being hit with the error:

PHP Fatal error: Uncaught exception ‘SmartyCompilerException’ with message ‘Syntax Error in template “application/modules/library/views/results.tpl” on line 31 “jwplayer(“video-player-{$v->id}”).setup( {” unknown function “jwplayer”‘

So, why is the auto escaping not working?