示例#1
0
		}//Prototype
		
		public FunctionFun( Engine engine, IObject baseClass, FunctionObj prototype )
			: base( engine, baseClass, new Props( "prototype", prototype ) )
		{
			_prototype = prototype;
		}//.ctor
示例#2
0
		}//Number
		
		public Root( Engine engine )
			: base( engine, null, new Props(), new Props() )
		{
			BaseProps.Set( "undefined", _undefined = new Value() );
			BaseProps.Set( "null", _null = new Value( Vtype.Object, null ) );
			BaseProps.Set( "nan", _nan = new Value( System.Double.NaN ) );
			BaseProps.Set( "infinity", _infinity = new Value( System.Double.PositiveInfinity ) );
			MoreProps.Set( "inf", _infinity );
			var obj = new Obj( engine );
			var fun = new FunctionObj( engine, obj );
			var str = new StringObj( engine, obj );
			var num = new NumberObj( engine, obj );
			BaseProps.Set( "function", new Value( _function = new FunctionFun( engine, fun, fun ) ) );
			BaseProps.Set( "object", new Value( _object = new ObjectFun( engine, fun, obj, this ) ) );
			BaseProps.Set( "string", new Value( _string = new StringFun( engine, fun, str ) ) );
			BaseProps.Set( "number", new Value( _number = new NumberFun( engine, fun, num ) ) );
		}//.ctor
示例#3
0
		}//.ctor
		
		/// <summary>
		/// create new function object
		/// </summary>
		public FunctionObj( Engine engine, FunctionObj baseClass, byte[] code, int codeAt, int codeSize, int typeAt, Engine.ArgInfo[] args, string @string = null, IObject scope = null )
			: base( engine, baseClass, Stdprops )
		{
			this.Code = code;
			this.CodeAt = codeAt;
			this.CodeSize = codeSize;
			this.TypeAt = typeAt;
			this.Args = args;
			this.Arglist = args == null ? "" : String.Join( ", ", args.Select( x => x.Name ) );
			this.String = @string ?? "function";
			this.Scope = scope;
		}//.ctor