File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -578,6 +578,8 @@ Template.prototype = {
578
578
var escapeFn = opts . escapeFunction ;
579
579
/** @type {FunctionConstructor } */
580
580
var ctor ;
581
+ /** @type {string } */
582
+ var sanitizedFilename = opts . filename ? JSON . stringify ( opts . filename ) : 'undefined' ;
581
583
582
584
if ( ! this . source ) {
583
585
this . generateSource ( ) ;
@@ -609,8 +611,7 @@ Template.prototype = {
609
611
if ( opts . compileDebug ) {
610
612
src = 'var __line = 1' + '\n'
611
613
+ ' , __lines = ' + JSON . stringify ( this . templateText ) + '\n'
612
- + ' , __filename = ' + ( opts . filename ?
613
- JSON . stringify ( opts . filename ) : 'undefined' ) + ';' + '\n'
614
+ + ' , __filename = ' + sanitizedFilename + ';' + '\n'
614
615
+ 'try {' + '\n'
615
616
+ this . source
616
617
+ '} catch (e) {' + '\n'
@@ -636,7 +637,7 @@ Template.prototype = {
636
637
}
637
638
if ( opts . compileDebug && opts . filename ) {
638
639
src = src + '\n'
639
- + '//# sourceURL=' + opts . filename + '\n' ;
640
+ + '//# sourceURL=' + sanitizedFilename + '\n' ;
640
641
}
641
642
642
643
try {
You can’t perform that action at this time.
0 commit comments