Exemplo n.º 1
0
 public static void SetHostFunction(this IContext context, string name,
                                    Action<IEnvironment, IJsValue, IList<IJsValue>> action)
 {
     context.Environment.CreateReference(name, context.CreateHostFunction((scope, self, args) =>
                                                                          {
                                                                              action(scope, self, args);
                                                                              return JsUndefined.Value;
                                                                          }));
 }
Exemplo n.º 2
0
 public static void SetHostFunction(this IContext context, string name,
                                    Func<IEnvironment, IJsValue, IList<IJsValue>, IJsValue> function)
 {
     context.Environment.CreateReference(name, context.CreateHostFunction(function));
 }