@@ -67,13 +67,13 @@ class Compiler extends Obj {
67
67
lines . forEach ( ( line ) => this . _emitLine ( line ) ) ;
68
68
}
69
69
70
- _emitFuncBegin ( name ) {
70
+ _emitFuncBegin ( node , name ) {
71
71
this . buffer = 'output' ;
72
72
this . _scopeClosers = '' ;
73
- this . _emitLine ( ' function ' + name + ' (env, context, frame, runtime, cb) {' ) ;
74
- this . _emitLine ( ' var lineno = null;' ) ;
75
- this . _emitLine ( ' var colno = null;' ) ;
76
- this . _emitLine ( ' var ' + this . buffer + ' = "";' ) ;
73
+ this . _emitLine ( ` function ${ name } (env, context, frame, runtime, cb) {` ) ;
74
+ this . _emitLine ( ` var lineno = ${ node . lineno } ;` ) ;
75
+ this . _emitLine ( ` var colno = ${ node . colno } ;` ) ;
76
+ this . _emitLine ( ` var ${ this . buffer } = "";` ) ;
77
77
this . _emitLine ( 'try {' ) ;
78
78
}
79
79
@@ -1123,7 +1123,7 @@ class Compiler extends Obj {
1123
1123
1124
1124
frame = new Frame ( ) ;
1125
1125
1126
- this . _emitFuncBegin ( 'root' ) ;
1126
+ this . _emitFuncBegin ( node , 'root' ) ;
1127
1127
this . _emitLine ( 'var parentTemplate = null;' ) ;
1128
1128
this . _compileChildren ( node , frame ) ;
1129
1129
this . _emitLine ( 'if(parentTemplate) {' ) ;
@@ -1147,7 +1147,7 @@ class Compiler extends Obj {
1147
1147
}
1148
1148
blockNames . push ( name ) ;
1149
1149
1150
- this . _emitFuncBegin ( `b_${ name } ` ) ;
1150
+ this . _emitFuncBegin ( block , `b_${ name } ` ) ;
1151
1151
1152
1152
const tmpFrame = new Frame ( ) ;
1153
1153
this . _emitLine ( 'var frame = frame.push(true);' ) ;
0 commit comments