File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,10 @@ function Exception(message, node) {
31
31
// Work around issue under safari where we can't directly set the column value
32
32
/* istanbul ignore next */
33
33
if ( Object . defineProperty ) {
34
- Object . defineProperty ( this , 'column' , { value : column } ) ;
34
+ Object . defineProperty ( this , 'column' , {
35
+ value : column ,
36
+ enumerable : true
37
+ } ) ;
35
38
} else {
36
39
this . column = column ;
37
40
}
Original file line number Diff line number Diff line change @@ -48,6 +48,15 @@ describe('compiler', function() {
48
48
}
49
49
} ) ;
50
50
51
+ it ( 'should include the location as enumerable property' , function ( ) {
52
+ try {
53
+ Handlebars . compile ( ' \n {{#if}}\n{{/def}}' ) ( ) ;
54
+ equal ( true , false , 'Statement must throw exception. This line should not be executed.' ) ;
55
+ } catch ( err ) {
56
+ equal ( err . propertyIsEnumerable ( 'column' ) , true , 'Checking error column' ) ;
57
+ }
58
+ } ) ;
59
+
51
60
it ( 'can utilize AST instance' , function ( ) {
52
61
equal ( Handlebars . compile ( {
53
62
type : 'Program' ,
You can’t perform that action at this time.
0 commit comments