private CreateBool ( bool value ) : |
||
value | bool | |
return |
public static SObject IsFinite(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters) { if (parameters.Length == 0) { return(processor.Undefined); } double dbl; if (parameters[0] is SNumber) { dbl = ((SNumber)parameters[0]).Value; } else { dbl = parameters[0].ToNumber(processor).Value; } return(processor.CreateBool(!(double.IsNaN(dbl) || double.IsInfinity(dbl)))); }
public static SObject ToPrimitive(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters) { if (parameters.Length == 0) { return(processor.Undefined); } if (parameters[0] is SString) { return(processor.CreateString(((SString)parameters[0]).Value)); } else if (parameters[0] is SNumber) { return(processor.CreateNumber(((SNumber)parameters[0]).Value)); } else if (parameters[0] is SBool) { return(processor.CreateBool(((SBool)parameters[0]).Value)); } else { return(parameters[0]); // returns the input object, if no conversion was conducted. } }
public static SObject ToPrimitive(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters) { if (parameters.Length == 0) return processor.Undefined; if (parameters[0] is SString) return processor.CreateString(((SString)parameters[0]).Value); else if (parameters[0] is SNumber) return processor.CreateNumber(((SNumber)parameters[0]).Value); else if (parameters[0] is SBool) return processor.CreateBool(((SBool)parameters[0]).Value); else return parameters[0]; // returns the input object, if no conversion was conducted. }
public static SObject IsFinite(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters) { if (parameters.Length == 0) return processor.Undefined; double dbl; if (parameters[0] is SNumber) dbl = ((SNumber)parameters[0]).Value; else dbl = parameters[0].ToNumber(processor).Value; return processor.CreateBool(!(double.IsNaN(dbl) || double.IsInfinity(dbl))); }