public JsInstance ToStringImpl(JsArray target, JsInstance[] parameters) { JsArray jsArray = this.Global.ArrayClass.New(); for (int index = 0; index < target.Length; ++index) { JsDictionaryObject _this = (JsDictionaryObject)target[index.ToString()]; if (ExecutionVisitor.IsNullOrUndefined((JsInstance)_this)) { jsArray[index.ToString()] = (JsInstance)this.Global.StringClass.New(); } else { JsFunction function = _this["toString"] as JsFunction; if (function != null) { this.Global.Visitor.ExecuteFunction(function, _this, parameters); jsArray[index.ToString()] = this.Global.Visitor.Returned; } else { jsArray[index.ToString()] = (JsInstance)this.Global.StringClass.New(); } } } return((JsInstance)this.Global.StringClass.New(jsArray.ToString())); }
/// <summary> /// 15.4.4.2 /// </summary> /// <param name="target"></param> /// <param name="parameters"></param> /// <returns></returns> public JsInstance ToStringImpl(JsArray target, JsInstance[] parameters) { JsArray result = Global.ArrayClass.New(); for (int i = 0; i < target.Length; i++) { var obj = (JsDictionaryObject)target[i.ToString()]; if (ExecutionVisitor.IsNullOrUndefined(obj)) { result[i.ToString()] = Global.StringClass.New(); } else { var function = obj["toString"] as JsFunction; if (function != null) { Global.Visitor.ExecuteFunction(function, obj, parameters); result[i.ToString()] = Global.Visitor.Returned; } else { result[i.ToString()] = Global.StringClass.New(); } } } return(Global.StringClass.New(result.ToString())); }
public JsInstance ToLocaleStringImpl(JsArray target, JsInstance[] parameters) { JsArray jsArray = this.Global.ArrayClass.New(); for (int index = 0; index < target.Length; ++index) { JsDictionaryObject _this = (JsDictionaryObject)target[index.ToString()]; this.Global.Visitor.ExecuteFunction((JsFunction)_this["toLocaleString"], _this, parameters); jsArray[index.ToString()] = this.Global.Visitor.Returned; } return((JsInstance)this.Global.StringClass.New(jsArray.ToString())); }
/// <summary> /// 15.4.4.3 /// </summary> /// <param name="target"></param> /// <param name="parameters"></param> /// <returns></returns> public JsInstance ToLocaleStringImpl(JsArray target, JsInstance[] parameters) { JsArray result = Global.ArrayClass.New(); for (int i = 0; i < target.Length; i++) { var obj = (JsDictionaryObject)target[i.ToString()]; Global.Visitor.ExecuteFunction((JsFunction)obj["toLocaleString"], obj, parameters); result[i.ToString()] = Global.Visitor.Returned; } return(Global.StringClass.New(result.ToString())); }