Inheritance: IdScriptableObject
コード例 #1
0
ファイル: Arguments.cs プロジェクト: hazzik/Rhino.Net
		public Arguments(NativeCall activation)
		{
			this.activation = activation;
			Scriptable parent = activation.GetParentScope();
			SetParentScope(parent);
			SetPrototype(ScriptableObject.GetObjectPrototype(parent));
			args = activation.originalArgs;
			lengthObj = Sharpen.Extensions.ValueOf(args.Length);
			NativeFunction f = activation.function;
			calleeObj = f;
			Scriptable topLevel = GetTopLevelScope(parent);
			constructor = GetProperty(topLevel, "Object");
			int version = f.GetLanguageVersion();
			if (version <= Context.VERSION_1_3 && version != Context.VERSION_DEFAULT)
			{
				callerObj = null;
			}
			else
			{
				callerObj = ScriptableConstants.NOT_FOUND;
			}
		}
コード例 #2
0
ファイル: NativeCall.cs プロジェクト: hazzik/Rhino.Net
		internal static void Init(Scriptable scope, bool @sealed)
		{
			Rhino.NativeCall obj = new Rhino.NativeCall();
			obj.ExportAsJSClass(MAX_PROTOTYPE_ID, scope, @sealed);
		}
コード例 #3
0
ファイル: NativeCall.cs プロジェクト: hazzik/Rhino.Net
		public override object ExecIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, object[] args)
		{
			if (!f.HasTag(CALL_TAG))
			{
				return base.ExecIdCall(f, cx, scope, thisObj, args);
			}
			int id = f.MethodId();
			if (id == Id_constructor)
			{
				if (thisObj != null)
				{
					throw Context.ReportRuntimeError1("msg.only.from.new", "Call");
				}
				ScriptRuntime.CheckDeprecated(cx, "Call");
				Rhino.NativeCall result = new Rhino.NativeCall();
				result.SetPrototype(GetObjectPrototype(scope));
				return result;
			}
			throw new ArgumentException(id.ToString());
		}