@@ -460,6 +460,7 @@ protected JSExpression Translate_MethodReplacement (
460460 return JSInvocationExpression . InvokeStatic (
461461 JS . eval , arguments
462462 ) ;
463+
463464 case "System.Object JSIL.Verbatim::Expression(System.String)" : {
464465 var expression = arguments [ 0 ] as JSStringLiteral ;
465466 if ( expression == null )
@@ -469,6 +470,7 @@ protected JSExpression Translate_MethodReplacement (
469470 method . Reference , expression . Value , null , null
470471 ) ;
471472 }
473+
472474 case "System.Object JSIL.JSGlobal::get_Item(System.String)" : {
473475 var expression = arguments [ 0 ] as JSStringLiteral ;
474476 if ( expression != null )
@@ -480,6 +482,7 @@ protected JSExpression Translate_MethodReplacement (
480482 JSIL . GlobalNamespace , arguments [ 0 ] , TypeSystem . Object
481483 ) ;
482484 }
485+
483486 case "System.Object JSIL.JSLocal::get_Item(System.String)" : {
484487 var expression = arguments [ 0 ] as JSStringLiteral ;
485488 if ( expression == null )
@@ -493,6 +496,22 @@ protected JSExpression Translate_MethodReplacement (
493496
494497 case "System.Boolean JSIL.Builtins::get_IsJavascript()" :
495498 return new JSBooleanLiteral ( true ) ;
499+
500+ case "System.Object JSIL.Services::Get(System.String,System.Boolean)" : {
501+ if ( arguments . Length != 2 )
502+ throw new InvalidOperationException ( "JSIL.Services.Get must receive two arguments" ) ;
503+
504+ var serviceName = arguments [ 0 ] ;
505+ var shouldThrow = arguments [ 1 ] ;
506+
507+ return JSInvocationExpression . InvokeStatic (
508+ new JSRawOutputIdentifier ( ( f ) => f . WriteRaw ( "JSIL.Host.getService" ) , TypeSystem . Object ) ,
509+ new [ ] {
510+ serviceName ,
511+ new JSUnaryOperatorExpression ( JSOperator . LogicalNot , shouldThrow , TypeSystem . Boolean )
512+ } , true
513+ ) ;
514+ }
496515 }
497516
498517 JSExpression result = Translate_PropertyCall ( thisExpression , method , arguments , @virtual , @static ) ;
0 commit comments