Ignore:
Timestamp:
Mar 21, 2002, 4:31:57 PM (23 years ago)
Author:
mjs
Message:

Merged changes from LABYRINTH_KDE_3_MERGE branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/number_object.h

    r6 r798  
     1// -*- c-basic-offset: 2 -*-
    12/*
    23 *  This file is part of the KDE libraries
     
    1617 *  License along with this library; if not, write to the Free Software
    1718 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     19 *
     20 *  $Id$
    1821 */
    1922
     
    2124#define _NUMBER_OBJECT_H_
    2225
    23 #include "object.h"
    24 #include "function.h"
     26#include "internal.h"
     27#include "function_object.h"
    2528
    2629namespace KJS {
    2730
    28   class NumberObject : public ConstructorImp {
     31  class NumberInstanceImp : public ObjectImp {
    2932  public:
    30     NumberObject(const Object& funcProto, const Object &numProto);
    31     virtual KJSO get(const UString &p) const;
     33    NumberInstanceImp(const Object &proto);
     34
     35    virtual const ClassInfo *classInfo() const { return &info; }
     36    static const ClassInfo info;
     37  };
     38
     39  /**
     40   * @internal
     41   *
     42   * The initial value of Number.prototype (and thus all objects created
     43   * with the Number constructor
     44   */
     45  class NumberPrototypeImp : public NumberInstanceImp {
     46  public:
     47    NumberPrototypeImp(ExecState *exec,
     48                       ObjectPrototypeImp *objProto,
     49                       FunctionPrototypeImp *funcProto);
     50  };
     51
     52  /**
     53   * @internal
     54   *
     55   * Class to implement all methods that are properties of the
     56   * Number.prototype object
     57   */
     58  class NumberProtoFuncImp : public InternalFunctionImp {
     59  public:
     60    NumberProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto,
     61                       int i, int len);
     62
     63    virtual bool implementsCall() const;
     64    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
     65
     66    enum { ToString, ToLocaleString, ValueOf };
     67  private:
     68    int id;
     69  };
     70
     71  /**
     72   * @internal
     73   *
     74   * The initial value of the the global variable's "Number" property
     75   */
     76  class NumberObjectImp : public InternalFunctionImp {
     77  public:
     78    NumberObjectImp(ExecState *exec,
     79                    FunctionPrototypeImp *funcProto,
     80                    NumberPrototypeImp *numberProto);
     81
     82    virtual bool implementsConstruct() const;
     83    virtual Object construct(ExecState *exec, const List &args);
     84
     85    virtual bool implementsCall() const;
     86    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
     87
     88    Value get(ExecState *exec, const UString &p) const;
     89    Value getValueProperty(ExecState *exec, int token) const;
     90    virtual const ClassInfo *classInfo() const { return &info; }
     91    static const ClassInfo info;
     92    enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
     93
    3294    Completion execute(const List &);
    3395    Object construct(const List &);
    34   };
    35 
    36   class NumberPrototype : public ObjectImp {
    37   public:
    38     NumberPrototype(const Object& proto);
    39     virtual KJSO get(const UString &p) const;
    4096  };
    4197
Note: See TracChangeset for help on using the changeset viewer.