]>
git.saurik.com Git - apple/javascriptcore.git/blob - kjs/number_object.h
1 // -*- c-basic-offset: 2 -*-
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
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.
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.
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
22 #ifndef NUMBER_OBJECT_H_
23 #define NUMBER_OBJECT_H_
25 #include "function_object.h"
26 #include "JSWrapperObject.h"
30 class NumberInstance
: public JSWrapperObject
{
32 NumberInstance(JSObject
* prototype
);
34 virtual const ClassInfo
* classInfo() const { return &info
; }
35 static const ClassInfo info
;
41 * The initial value of Number.prototype (and thus all objects created
42 * with the Number constructor
44 class NumberPrototype
: public NumberInstance
{
46 NumberPrototype(ExecState
*, ObjectPrototype
*, FunctionPrototype
*);
52 * The initial value of the the global variable's "Number" property
54 class NumberObjectImp
: public InternalFunctionImp
{
56 NumberObjectImp(ExecState
*, FunctionPrototype
*, NumberPrototype
*);
58 virtual bool implementsConstruct() const;
59 virtual JSObject
* construct(ExecState
*, const List
&);
61 virtual JSValue
* callAsFunction(ExecState
*, JSObject
*, const List
&);
63 bool getOwnPropertySlot(ExecState
*, const Identifier
&, PropertySlot
&);
64 JSValue
* getValueProperty(ExecState
*, int token
) const;
66 virtual const ClassInfo
* classInfo() const { return &info
; }
67 static const ClassInfo info
;
69 enum { NaNValue
, NegInfinity
, PosInfinity
, MaxValue
, MinValue
};
71 JSObject
* construct(const List
&);
76 #endif // NUMBER_OBJECT_H_