public static object valueOf(object thisObj) { if (!Convert.IsBoolean(thisObj)) { throw new JScriptException(JSError.BooleanExpected); } if (thisObj is bool) { return(thisObj); } BooleanObject bo = thisObj as BooleanObject; return(bo.value); }
public static string toString(object thisObj) { if (!Convert.IsBoolean(thisObj)) { throw new JScriptException(JSError.BooleanExpected); } if (thisObj is bool) { return((bool)thisObj ? "true" : "false"); } BooleanObject bo = thisObj as BooleanObject; return(bo.value ? "true" : "false"); }