@@ -201,3 +201,42 @@ function testParseWithoutProcessing() {
201
201
202
202
const parsedTemplateWithoutOptions : hbs . AST . Program = Handlebars . parseWithoutProcessing ( '<p>Hello, my name is {{name}}.</p>' ) ;
203
203
}
204
+
205
+ function testExceptionTypings ( ) {
206
+ // Test exception constructor with a single argument - message.
207
+ let exception : Handlebars . Exception = new Handlebars . Exception ( 'message' ) ;
208
+
209
+ // Fields
210
+ let message : string = exception . message ;
211
+ let lineNumber : number = exception . lineNumber ;
212
+ let column : number = exception . column ;
213
+ let endLineNumber : number = exception . endLineNumber ;
214
+ let endColumn : number = exception . endColumn ;
215
+ let description = exception . description ;
216
+ let name : string = exception . name ;
217
+ let fileName : string = exception . fileName ;
218
+ let stack : string | undefined = exception . stack ;
219
+ }
220
+
221
+ function testExceptionWithNodeTypings ( ) {
222
+ // Test exception constructor with both arguments.
223
+ const exception : Handlebars . Exception = new Handlebars . Exception ( 'message' , {
224
+ type : 'MustacheStatement' ,
225
+ loc : {
226
+ source : 'source' ,
227
+ start : { line : 1 , column : 5 } ,
228
+ end : { line : 10 , column : 2 }
229
+ }
230
+ } ) ;
231
+
232
+ // Fields
233
+ let message : string = exception . message ;
234
+ let lineNumber : number = exception . lineNumber ;
235
+ let column : number = exception . column ;
236
+ let endLineNumber : number = exception . endLineNumber ;
237
+ let endColumn : number = exception . endColumn ;
238
+ let description = exception . description ;
239
+ let name : string = exception . name ;
240
+ let fileName : string = exception . fileName ;
241
+ let stack : string | undefined = exception . stack ;
242
+ }
0 commit comments