public IObj Construct(string value) { var obj = new ValueObj(value); obj.Class = ObjClass.String; obj.Prototype = String_prototype; obj.Context = Context; obj.SetOwnProperty("length", (double)value.Length); return obj; }
public IObj Construct(object[] args) { var str = args != null && args.Length > 0 ? JsTypeConverter.ToString(args[0]) : ""; var obj = new ValueObj(str); obj.Class = ObjClass.String; obj.Prototype = String_prototype; obj.Context = Context; obj.SetOwnProperty("length", (double) str.Length); return obj; }