@@ -95,8 +95,11 @@ export class RubyVM {
95
95
return value ;
96
96
} ,
97
97
rbObjectToJsRbValue : ( rawRbAbiValue ) => {
98
- const abiValue = new ( RbAbi . RbAbiValue as any ) ( rawRbAbiValue , this . guest ) ;
99
- return new RbValue ( abiValue , this , this . privateObject ( ) ) ;
98
+ const abiValue = new ( RbAbi . RbAbiValue as any ) (
99
+ rawRbAbiValue ,
100
+ this . guest
101
+ ) ;
102
+ return new RbValue ( abiValue , this , this . privateObject ( ) ) ;
100
103
} ,
101
104
jsValueToString : ( value ) => {
102
105
return value . toString ( ) ;
@@ -197,7 +200,10 @@ export class RubyVM {
197
200
}
198
201
199
202
private privateObject ( ) : RubyVMPrivate {
200
- return { transport : this . transport , exceptionFormatter : this . exceptionFormatter }
203
+ return {
204
+ transport : this . transport ,
205
+ exceptionFormatter : this . exceptionFormatter ,
206
+ } ;
201
207
}
202
208
}
203
209
@@ -330,11 +336,10 @@ enum ruby_tag_type {
330
336
}
331
337
332
338
type RubyVMPrivate = {
333
- transport : JsValueTransport ,
334
- exceptionFormatter : RbExceptionFormatter ,
339
+ transport : JsValueTransport ;
340
+ exceptionFormatter : RbExceptionFormatter ;
335
341
} ;
336
342
337
-
338
343
class RbExceptionFormatter {
339
344
private literalsCache : [ RbValue , RbValue , RbValue ] | null = null ;
340
345
@@ -344,7 +349,7 @@ class RbExceptionFormatter {
344
349
const zeroOneNewLine : [ RbValue , RbValue , RbValue ] = [
345
350
evalRbCode ( vm , privateObject , "0" ) ,
346
351
evalRbCode ( vm , privateObject , "1" ) ,
347
- evalRbCode ( vm , privateObject , `"\n"` )
352
+ evalRbCode ( vm , privateObject , `"\n"` ) ,
348
353
] ;
349
354
this . literalsCache = zeroOneNewLine ;
350
355
return zeroOneNewLine ;
@@ -355,11 +360,13 @@ class RbExceptionFormatter {
355
360
356
361
const backtrace = error . call ( "backtrace" ) ;
357
362
const firstLine = backtrace . call ( "at" , zeroLiteral ) ;
358
- const restLines = backtrace . call ( "drop" , oneLiteral ) . call ( "join" , newLineLiteral ) ;
363
+ const restLines = backtrace
364
+ . call ( "drop" , oneLiteral )
365
+ . call ( "join" , newLineLiteral ) ;
359
366
return this . formatString ( error . call ( "class" ) . toString ( ) , error . toString ( ) , [
360
367
firstLine . toString ( ) ,
361
368
restLines . toString ( ) ,
362
- ] )
369
+ ] ) ;
363
370
}
364
371
365
372
formatString (
@@ -368,7 +375,7 @@ class RbExceptionFormatter {
368
375
backtrace : [ string , string ]
369
376
) : string {
370
377
return `${ backtrace [ 0 ] } : ${ message } (${ klass } )\n${ backtrace [ 1 ] } ` ;
371
- } ;
378
+ }
372
379
}
373
380
374
381
const checkStatusTag = (
@@ -399,7 +406,9 @@ const checkStatusTag = (
399
406
}
400
407
// clear errinfo if got exception due to no rb_jump_tag
401
408
vm . guest . rbClearErrinfo ( ) ;
402
- throw new RbError ( privateObject . exceptionFormatter . format ( error , vm , privateObject ) ) ;
409
+ throw new RbError (
410
+ privateObject . exceptionFormatter . format ( error , vm , privateObject )
411
+ ) ;
403
412
default :
404
413
throw new RbError ( `unknown error tag: ${ rawTag } ` ) ;
405
414
}
0 commit comments