// Add a builtin function to the global object. private void AddBuiltin(EngineInstance inst, string name) { MethodInfo method = typeof(GlobalObject).GetMethod(name); globalObject.Put(name, new BuiltinFunction (inst.GetFunctionPrototype(), name, method), PropertyAttributes.None); }
// Add a builtin method to a prototype. internal void AddBuiltin(EngineInstance inst, String name) { MethodInfo method = GetType().GetMethod(name); Put(name, new BuiltinFunction (inst.GetFunctionPrototype(), name, method), PropertyAttributes.None); }