NumberPrototype.h 2.01 KB
Newer Older
1 2
/*
 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
3
 *  Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
mjs's avatar
mjs committed
17
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18
 *
19 20
 */

weinig@apple.com's avatar
weinig@apple.com committed
21 22
#ifndef NumberPrototype_h
#define NumberPrototype_h
23

weinig@apple.com's avatar
weinig@apple.com committed
24
#include "NumberObject.h"
25

26
namespace JSC {
27

weinig@apple.com's avatar
weinig@apple.com committed
28
    class NumberPrototype : public NumberObject {
29
    public:
30 31
        typedef NumberObject Base;

32
        static NumberPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
33
        {
34
            NumberPrototype* prototype = new (NotNull, allocateCell<NumberPrototype>(vm.heap)) NumberPrototype(vm, structure);
35
            prototype->finishCreation(vm, globalObject);
36
            return prototype;
37 38
        }
        
39
        DECLARE_INFO;
40

41
        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
42
        {
43
            return Structure::create(vm, globalObject, prototype, TypeInfo(NumberObjectType, StructureFlags), info());
44 45 46
        }

    protected:
47
        void finishCreation(VM&, JSGlobalObject*);
48 49 50
        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NumberObject::StructureFlags;

    private:
51
        NumberPrototype(VM&, Structure*);
52
        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
weinig@apple.com's avatar
weinig@apple.com committed
53 54
    };

55
} // namespace JSC
weinig@apple.com's avatar
weinig@apple.com committed
56

weinig@apple.com's avatar
weinig@apple.com committed
57
#endif // NumberPrototype_h