Represents an instance of the Symbol object.
Inheritance: ObjectInstance
Ejemplo n.º 1
0
        //     INITIALIZATION
        //_________________________________________________________________________________________

        /// <summary>
        /// Creates a new Symbol object.
        /// </summary>
        /// <param name="prototype"> The next object in the prototype chain. </param>
        /// <param name="instancePrototype"> The prototype for instances created by this function. </param>
        internal SymbolConstructor(ObjectInstance prototype, ObjectInstance instancePrototype)
            : base(prototype, __STUB__Construct, __STUB__Call)
        {
            Iterator    = new SymbolInstance(instancePrototype, "Symbol.iterator");
            Species     = new SymbolInstance(instancePrototype, "Symbol.Species");
            ToPrimitive = new SymbolInstance(instancePrototype, "Symbol.toPrimitive");
            ToStringTag = new SymbolInstance(instancePrototype, "Symbol.toStringTag");

            // Initialize the constructor properties.
            var properties = new List <PropertyNameAndValue>(3);

            InitializeConstructorProperties(properties, "Symbol", 0, instancePrototype);
            //properties.Add(new PropertyNameAndValue("hasInstance", null, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("isConcatSpreadable", null, PropertyAttributes.Sealed));
            properties.Add(new PropertyNameAndValue("iterator", Iterator, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("match", null, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("replace", null, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("search", null, PropertyAttributes.Sealed));
            properties.Add(new PropertyNameAndValue("species", Species, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("split", null, PropertyAttributes.Sealed));
            properties.Add(new PropertyNameAndValue("toPrimitive", ToPrimitive, PropertyAttributes.Sealed));
            properties.Add(new PropertyNameAndValue("toStringTag", ToStringTag, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("unscopables", null, PropertyAttributes.Sealed));
            FastSetProperties(properties);
        }
Ejemplo n.º 2
0
        //     INITIALIZATION
        //_________________________________________________________________________________________
        /// <summary>
        /// Creates a new Symbol object.
        /// </summary>
        /// <param name="prototype"> The next object in the prototype chain. </param>
        /// <param name="instancePrototype"> The prototype for instances created by this function. </param>
        internal SymbolConstructor(ObjectInstance prototype, ObjectInstance instancePrototype)
            : base(prototype, __STUB__Construct, __STUB__Call)
        {
            Iterator = new SymbolInstance(instancePrototype, "Symbol.iterator");
            Species = new SymbolInstance(instancePrototype, "Symbol.Species");
            ToPrimitive = new SymbolInstance(instancePrototype, "Symbol.toPrimitive");
            ToStringTag = new SymbolInstance(instancePrototype, "Symbol.toStringTag");

            // Initialize the constructor properties.
            var properties = new List<PropertyNameAndValue>(3);
            InitializeConstructorProperties(properties, "Symbol", 0, instancePrototype);
            //properties.Add(new PropertyNameAndValue("hasInstance", null, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("isConcatSpreadable", null, PropertyAttributes.Sealed));
            properties.Add(new PropertyNameAndValue("iterator", Iterator, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("match", null, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("replace", null, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("search", null, PropertyAttributes.Sealed));
            properties.Add(new PropertyNameAndValue("species", Species, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("split", null, PropertyAttributes.Sealed));
            properties.Add(new PropertyNameAndValue("toPrimitive", ToPrimitive, PropertyAttributes.Sealed));
            properties.Add(new PropertyNameAndValue("toStringTag", ToStringTag, PropertyAttributes.Sealed));
            //properties.Add(new PropertyNameAndValue("unscopables", null, PropertyAttributes.Sealed));
            FastSetProperties(properties);
        }
Ejemplo n.º 3
0
 public string KeyFor(SymbolInstance symbol)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 public string KeyFor(SymbolInstance symbol)
 {
     throw new NotImplementedException();
 }