public SetPrototype ( Scriptable prototype ) : void | ||
prototype | Scriptable | |
return | void |
internal static void Init(Scriptable scope, bool @sealed) { Rhino.NativeWith obj = new Rhino.NativeWith(); obj.SetParentScope(scope); obj.SetPrototype(ScriptableObject.GetObjectPrototype(scope)); IdFunctionObject ctor = new IdFunctionObject(obj, FTAG, Id_constructor, "With", 0, scope); ctor.MarkAsConstructor(obj); if (@sealed) { ctor.SealObject(); } ctor.ExportAsScopeProperty(); }
internal static object NewWithSpecial(Context cx, Scriptable scope, object[] args) { ScriptRuntime.CheckDeprecated(cx, "With"); scope = ScriptableObject.GetTopLevelScope(scope); Rhino.NativeWith thisObj = new Rhino.NativeWith(); thisObj.SetPrototype(args.Length == 0 ? ScriptableObject.GetObjectPrototype(scope) : ScriptRuntime.ToObject(cx, scope, args[0])); thisObj.SetParentScope(scope); return thisObj; }