Esempio n. 1
0
        public static RegExpPrototype CreatePrototypeObject(JSEngine engine, RegExpConstructor regExpConstructor)
        {
            var obj = new RegExpPrototype(engine);

            obj.Prototype  = engine.Object.PrototypeObject;
            obj.Extensible = true;

            obj.FastAddProperty("constructor", regExpConstructor, true, false, true);
            return(obj);
        }
Esempio n. 2
0
        public static RegExpConstructor CreateRegExpConstructor(JSEngine engine)
        {
            var obj = new RegExpConstructor(engine);

            obj.Extensible = true;

            // The value of the [[Prototype]] internal property of the RegExp constructor is the Function prototype object
            obj.Prototype       = engine.Function.PrototypeObject;
            obj.PrototypeObject = RegExpPrototype.CreatePrototypeObject(engine, obj);

            obj.FastAddProperty("length", 2, false, false, false);

            // The initial value of RegExp.prototype is the RegExp prototype object
            obj.FastAddProperty("prototype", obj.PrototypeObject, false, false, false);

            return(obj);
        }