/// <summary> /// https://tc39.es/ecma262/#sec-stringcreate /// </summary> private StringInstance StringCreate(JsString value, ObjectInstance prototype) { var instance = new StringInstance(Engine) { _prototype = prototype, StringData = value, _length = PropertyDescriptor.AllForbiddenDescriptor.ForNumber(value.Length) }; return(instance); }
public StringInstance Construct(string value) { var instance = new StringInstance(Engine); instance.Prototype = PrototypeObject; instance.PrimitiveValue = value; instance.Extensible = true; instance.FastAddProperty("length", value.Length, false, false, false); return instance; }
public StringInstance Construct(JsString value) { var instance = new StringInstance(Engine) { _prototype = PrototypeObject, PrimitiveValue = value, _length = PropertyDescriptor.AllForbiddenDescriptor.ForNumber(value.Length) }; return(instance); }
public StringInstance Construct(JsString value) { var instance = new StringInstance(Engine) { Prototype = PrototypeObject, PrimitiveValue = value, Extensible = true, _length = new PropertyDescriptor(value.Length, PropertyFlag.AllForbidden) }; return(instance); }
public StringInstance Construct(string value) { var instance = new StringInstance(Engine); instance.Prototype = PrototypeObject; instance.PrimitiveValue = value; instance.Extensible = true; instance.FastAddProperty("length", value.Length, false, false, false); return(instance); }