]> git.saurik.com Git - apple/javascriptcore.git/blame - kjs/number_object.h
JavaScriptCore-466.1.tar.gz
[apple/javascriptcore.git] / kjs / number_object.h
CommitLineData
b37bf2e1
A
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22#ifndef NUMBER_OBJECT_H_
23#define NUMBER_OBJECT_H_
24
25#include "function_object.h"
26#include "JSWrapperObject.h"
27
28namespace KJS {
29
30 class NumberInstance : public JSWrapperObject {
31 public:
32 NumberInstance(JSObject* prototype);
33
34 virtual const ClassInfo* classInfo() const { return &info; }
35 static const ClassInfo info;
36 };
37
38 /**
39 * @internal
40 *
41 * The initial value of Number.prototype (and thus all objects created
42 * with the Number constructor
43 */
44 class NumberPrototype : public NumberInstance {
45 public:
46 NumberPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
47 };
48
49 /**
50 * @internal
51 *
52 * The initial value of the the global variable's "Number" property
53 */
54 class NumberObjectImp : public InternalFunctionImp {
55 public:
56 NumberObjectImp(ExecState*, FunctionPrototype*, NumberPrototype*);
57
58 virtual bool implementsConstruct() const;
59 virtual JSObject* construct(ExecState*, const List&);
60
61 virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
62
63 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
64 JSValue* getValueProperty(ExecState*, int token) const;
65
66 virtual const ClassInfo* classInfo() const { return &info; }
67 static const ClassInfo info;
68
69 enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
70
71 JSObject* construct(const List&);
72 };
73
74} // namespace KJS
75
76#endif // NUMBER_OBJECT_H_