コード例 #1
0
        public IdFunctionObject ExportAsJSClass(int maxPrototypeId, IScriptable scope, bool zealed, int attributes)
        {
            // Set scope and prototype unless this is top level scope itself
            if (scope != this && scope != null)
            {
                ParentScope = scope;
                SetPrototype(GetObjectPrototype(scope));
            }

            ActivatePrototypeMap(maxPrototypeId);
            IdFunctionObject ctor = prototypeValues.createPrecachedConstructor();

            if (zealed)
            {
                SealObject();
            }
            FillConstructorProperties(ctor);
            if (zealed)
            {
                ctor.SealObject();
            }
            ctor.ExportAsScopeProperty(attributes);
            return(ctor);
        }