コード例 #1
0
ファイル: StringConstructor.cs プロジェクト: KurtGokhan/jint
        /// <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);
        }
コード例 #2
0
ファイル: StringConstructor.cs プロジェクト: Rohansi/jint
        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;
        }
コード例 #3
0
        public StringInstance Construct(JsString value)
        {
            var instance = new StringInstance(Engine)
            {
                _prototype     = PrototypeObject,
                PrimitiveValue = value,
                _length        = PropertyDescriptor.AllForbiddenDescriptor.ForNumber(value.Length)
            };

            return(instance);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }