public static BoxedValue ToPrimitive(ScriptObject o, DefaultValueHint hint) { return o.DefaultValue(hint); }
public static string ToString(ScriptObject o) { var s = o as StringObject; return s != null ? s.Value.Value.String : ToString(o.DefaultValue(DefaultValueHint.String)); }
public static double ToNumber(ScriptObject o) { var n = o as NumberObject; return n != null ? n.Value.Value.Number : ToNumber(o.DefaultValue(DefaultValueHint.Number)); }