Commit f157abf5 authored by weinig@apple.com's avatar weinig@apple.com

JavaScriptCore:

2008-07-04  Sam Weinig  <sam@webkit.org>

        Rubber-stamped by Dan Bernstein.

        Split Error and GetterSetter out of JSObject.h.

        * API/JSCallbackObjectFunctions.h:
        * GNUmakefile.am:
        * JavaScriptCore.pri:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * JavaScriptCoreSources.bkl:
        * kjs/AllInOneFile.cpp:
        * kjs/ClassInfo.h: Copied from JavaScriptCore/kjs/JSObject.h.
        * kjs/Error.cpp: Copied from JavaScriptCore/kjs/JSObject.cpp.
        * kjs/Error.h: Copied from JavaScriptCore/kjs/JSObject.h.
        * kjs/GetterSetter.cpp:
        * kjs/GetterSetter.h: Copied from JavaScriptCore/kjs/JSObject.h.
        * kjs/JSObject.cpp:
        * kjs/JSObject.h:
        * kjs/nodes.h:

JavaScriptGlue:

2008-07-04  Sam Weinig  <sam@webkit.org>

        Rubber-stamped by Dan Bernstein.

        * JSObject.h: Rename the header guard as it now conflicts with the
        JSObject in JavaScriptCore.

WebCore:

2008-07-04  Sam Weinig  <sam@webkit.org>

        Rubber-stamped by Dan Bernstein.

        Split Error and GetterSetter out of JSObject.h.

        * ForwardingHeaders/kjs/Error.h: Added.
        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
        * bindings/js/JSClipboardCustom.cpp:
        * bindings/js/JSDOMWindowBase.cpp:
        * bindings/js/JSEventTargetBase.cpp:
        * bindings/js/JSHTMLDocumentCustom.cpp:
        * bindings/js/JSXMLHttpRequestCustom.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        * bridge/NP_jsobject.cpp:
        * bridge/jni/jni_instance.cpp:
        * bridge/jni/jni_runtime.cpp:
        * bridge/objc/objc_instance.mm:
        * bridge/objc/objc_runtime.mm:
        * bridge/objc/objc_utility.h:
        * bridge/runtime_array.cpp:
        * bridge/runtime_method.cpp:
        * bridge/runtime_object.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cfd1e55d
......@@ -26,6 +26,7 @@
*/
#include "APICast.h"
#include "Error.h"
#include "JSCallbackFunction.h"
#include "JSClassRef.h"
#include "JSGlobalObject.h"
......
2008-07-04 Sam Weinig <sam@webkit.org>
Rubber-stamped by Dan Bernstein.
Split Error and GetterSetter out of JSObject.h.
* API/JSCallbackObjectFunctions.h:
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/ClassInfo.h: Copied from JavaScriptCore/kjs/JSObject.h.
* kjs/Error.cpp: Copied from JavaScriptCore/kjs/JSObject.cpp.
* kjs/Error.h: Copied from JavaScriptCore/kjs/JSObject.h.
* kjs/GetterSetter.cpp:
* kjs/GetterSetter.h: Copied from JavaScriptCore/kjs/JSObject.h.
* kjs/JSObject.cpp:
* kjs/JSObject.h:
* kjs/nodes.h:
2008-07-04 Simon Hausmann <hausmann@webkit.org>
Fix the Wx build, added TreeProfile.cpp to the build.
......@@ -93,6 +93,7 @@ javascriptcore_sources += \
JavaScriptCore/kjs/DatePrototype.cpp \
JavaScriptCore/kjs/debugger.cpp \
JavaScriptCore/kjs/dtoa.cpp \
JavaScriptCore/kjs/Error.cpp \
JavaScriptCore/kjs/ErrorConstructor.cpp \
JavaScriptCore/kjs/ErrorInstance.cpp \
JavaScriptCore/kjs/ErrorPrototype.cpp \
......
......@@ -77,6 +77,7 @@ SOURCES += \
kjs/DatePrototype.cpp \
kjs/DebuggerCallFrame.cpp \
kjs/dtoa.cpp \
kjs/Error.cpp \
kjs/ErrorConstructor.cpp \
kjs/ErrorInstance.cpp \
kjs/ErrorPrototype.cpp \
......
......@@ -312,6 +312,10 @@
RelativePath="..\..\kjs\BooleanPrototype.h"
>
</File>
<File
RelativePath="..\..\kjs\ClassInfo.h"
>
</File>
<File
RelativePath="..\..\kjs\collector.cpp"
>
......@@ -380,6 +384,14 @@
RelativePath="..\..\kjs\dtoa.h"
>
</File>
<File
RelativePath="..\..\kjs\Error.cpp"
>
</File>
<File
RelativePath="..\..\kjs\Error.h"
>
</File>
<File
RelativePath="..\..\kjs\ErrorConstructor.cpp"
>
......@@ -432,6 +444,10 @@
RelativePath="..\..\kjs\GetterSetter.cpp"
>
</File>
<File
RelativePath="..\..\kjs\GetterSetter.h"
>
</File>
<File
RelativePath="..\..\kjs\identifier.cpp"
>
......
......@@ -642,6 +642,10 @@
BC2680C80E16D4E900A06E92 /* ObjectPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectPrototype.cpp; sourceTree = "<group>"; };
BC2680C90E16D4E900A06E92 /* ObjectPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectPrototype.h; sourceTree = "<group>"; };
BC2680E60E16D52300A06E92 /* NumberConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberConstructor.lut.h; sourceTree = "<group>"; };
BC337BDE0E1AF0B80076918A /* GetterSetter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetterSetter.h; sourceTree = "<group>"; };
BC337BE20E1AF4410076918A /* Error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Error.h; sourceTree = "<group>"; };
BC337BEA0E1B00CB0076918A /* Error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Error.cpp; sourceTree = "<group>"; };
BC337D760E1B6EB90076918A /* ClassInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassInfo.h; sourceTree = "<group>"; };
BC7952060E15E8A800A898AB /* ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArrayConstructor.cpp; sourceTree = "<group>"; };
BC7952070E15E8A800A898AB /* ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayConstructor.h; sourceTree = "<group>"; };
BC7952320E15EB5600A898AB /* BooleanConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BooleanConstructor.cpp; sourceTree = "<group>"; };
......@@ -1054,6 +1058,7 @@
BC7952340E15EB5600A898AB /* BooleanPrototype.cpp */,
BC7952350E15EB5600A898AB /* BooleanPrototype.h */,
145C507F0D9DF63B0088F6B9 /* CallData.h */,
BC337D760E1B6EB90076918A /* ClassInfo.h */,
F692A8520255597D01FF60F7 /* collector.cpp */,
F692A8530255597D01FF60F7 /* collector.h */,
5DBD18A90C54018700C15EAE /* CollectorHeapIntrospector.cpp */,
......@@ -1074,6 +1079,8 @@
D21202290AD4310C00ED79B6 /* DateMath.h */,
651F6412039D5B5F0078395C /* dtoa.cpp */,
651F6413039D5B5F0078395C /* dtoa.h */,
BC337BEA0E1B00CB0076918A /* Error.cpp */,
BC337BE20E1AF4410076918A /* Error.h */,
BC02E9040E1839DB000F9297 /* ErrorConstructor.cpp */,
BC02E9050E1839DB000F9297 /* ErrorConstructor.h */,
BC02E98A0E183E38000F9297 /* ErrorInstance.cpp */,
......@@ -1088,6 +1095,7 @@
F692A85D0255597D01FF60F7 /* FunctionPrototype.h */,
933A3499038AE7C6008635CE /* grammar.y */,
BC02E9B80E184545000F9297 /* GetterSetter.cpp */,
BC337BDE0E1AF0B80076918A /* GetterSetter.h */,
933A349D038AE80F008635CE /* identifier.cpp */,
933A349A038AE7C6008635CE /* identifier.h */,
E178636C0D9BEEC300D74E75 /* InitializeThreading.cpp */,
......
......@@ -58,6 +58,7 @@ Source files for JSCore.
kjs/debugger.cpp
kjs/DebuggerCallFrame.cpp
kjs/dtoa.cpp
kjs/Error.cpp
kjs/ErrorConstructor.cpp
kjs/ErrorInstance.cpp
kjs/ErrorPrototype.cpp
......
......@@ -72,6 +72,7 @@
#include "nodes.cpp"
#include "nodes2string.cpp"
#include "JSObject.cpp"
#include "Error.cpp"
#include "JSGlobalObject.cpp"
#include "ObjectConstructor.cpp"
#include "ObjectPrototype.cpp"
......
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef ClassInfo_h
#define ClassInfo_h
#include "ExecState.h"
namespace KJS {
struct HashEntry;
struct HashTable;
/**
* Class Information
*/
struct ClassInfo {
/**
* A string denoting the class name. Example: "Window".
*/
const char* className;
/**
* Pointer to the class information of the base class.
* 0L if there is none.
*/
const ClassInfo* parentClass;
/**
* Static hash-table of properties.
* For classes that can be used from multiple threads, it is accessed via a getter function that would typically return a pointer to thread-specific value.
*/
const HashTable* propHashTable(ExecState* exec) const
{
if (classPropHashTableGetterFunction)
return classPropHashTableGetterFunction(exec);
return staticPropHashTable;
}
const HashTable* staticPropHashTable;
typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*);
const ClassPropHashTableGetterFunction classPropHashTableGetterFunction;
};
} // namespace KJS
#endif // ClassInfo_h
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
* Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2007 Eric Seidel (eric@webkit.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "config.h"
#include "Error.h"
#include "ConstructData.h"
#include "ErrorConstructor.h"
#include "JSGlobalObject.h"
#include "JSObject.h"
#include "NativeErrorConstructor.h"
namespace KJS {
JSObject* Error::create(ExecState* exec, ErrorType errtype, const UString& message,
int lineno, int sourceId, const UString& sourceURL)
{
JSObject* cons;
const char* name;
switch (errtype) {
case EvalError:
cons = exec->lexicalGlobalObject()->evalErrorConstructor();
name = "Evaluation error";
break;
case RangeError:
cons = exec->lexicalGlobalObject()->rangeErrorConstructor();
name = "Range error";
break;
case ReferenceError:
cons = exec->lexicalGlobalObject()->referenceErrorConstructor();
name = "Reference error";
break;
case SyntaxError:
cons = exec->lexicalGlobalObject()->syntaxErrorConstructor();
name = "Syntax error";
break;
case TypeError:
cons = exec->lexicalGlobalObject()->typeErrorConstructor();
name = "Type error";
break;
case URIError:
cons = exec->lexicalGlobalObject()->URIErrorConstructor();
name = "URI error";
break;
default:
cons = exec->lexicalGlobalObject()->errorConstructor();
name = "Error";
break;
}
ArgList args;
if (message.isEmpty())
args.append(jsString(exec, name));
else
args.append(jsString(exec, message));
ConstructData constructData;
ConstructType constructType = cons->getConstructData(constructData);
JSObject* err = construct(exec, cons, constructType, constructData, args);
if (lineno != -1)
err->put(exec, Identifier(exec, "line"), jsNumber(exec, lineno));
if (sourceId != -1)
err->put(exec, Identifier(exec, "sourceId"), jsNumber(exec, sourceId));
if(!sourceURL.isNull())
err->put(exec, Identifier(exec, "sourceURL"), jsString(exec, sourceURL));
return err;
}
JSObject *Error::create(ExecState *exec, ErrorType type, const char *message)
{
return create(exec, type, message, -1, -1, NULL);
}
JSObject *throwError(ExecState *exec, ErrorType type)
{
JSObject *error = Error::create(exec, type, UString(), -1, -1, NULL);
exec->setException(error);
return error;
}
JSObject *throwError(ExecState *exec, ErrorType type, const UString &message)
{
JSObject *error = Error::create(exec, type, message, -1, -1, NULL);
exec->setException(error);
return error;
}
JSObject *throwError(ExecState *exec, ErrorType type, const char *message)
{
JSObject *error = Error::create(exec, type, message, -1, -1, NULL);
exec->setException(error);
return error;
}
JSObject *throwError(ExecState *exec, ErrorType type, const UString &message, int line, int sourceId, const UString &sourceURL)
{
JSObject *error = Error::create(exec, type, message, line, sourceId, sourceURL);
exec->setException(error);
return error;
}
} // namespace KJS
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef Error_h
#define Error_h
namespace KJS {
class ExecState;
class JSObject;
class UString;
/**
* Types of Native Errors available. For custom errors, GeneralError
* should be used.
*/
enum ErrorType { GeneralError = 0,
EvalError = 1,
RangeError = 2,
ReferenceError = 3,
SyntaxError = 4,
TypeError = 5,
URIError = 6};
/**
* @short Factory methods for error objects.
*/
class Error {
public:
/**
* Factory method for error objects.
*
* @param exec The current execution state
* @param errtype Type of error.
* @param message Optional error message.
* @param lineNumber Optional line number.
* @param sourceId Optional source id.
* @param sourceURL Optional source URL.
*/
static JSObject *create(ExecState *, ErrorType, const UString &message, int lineNumber, int sourceId, const UString &sourceURL);
static JSObject *create(ExecState *, ErrorType, const char *message);
};
JSObject *throwError(ExecState *, ErrorType, const UString &message, int lineNumber, int sourceId, const UString &sourceURL);
JSObject *throwError(ExecState *, ErrorType, const UString &message);
JSObject *throwError(ExecState *, ErrorType, const char *message);
JSObject *throwError(ExecState *, ErrorType);
} // namespace KJS
#endif // Error_h
......@@ -21,7 +21,7 @@
*/
#include "config.h"
#include "JSObject.h"
#include "GetterSetter.h"
#include <wtf/Assertions.h>
......@@ -75,4 +75,4 @@ JSObject* GetterSetter::toObject(ExecState* exec) const
return jsNull()->toObject(exec);
}
}
} // namespace KJS
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef GetterSetter_h
#define GetterSetter_h
#include "JSCell.h"
namespace KJS {
class JSObject;
// This is an internal value object which stores getter and setter functions
// for a property.
class GetterSetter : public JSCell {
public:
JSType type() const { return GetterSetterType; }
GetterSetter() : m_getter(0), m_setter(0) { }
virtual void mark();
JSObject* getter() const { return m_getter; }
void setGetter(JSObject* getter) { m_getter = getter; }
JSObject* setter() const { return m_setter; }
void setSetter(JSObject* setter) { m_setter = setter; }
private:
virtual JSValue* toPrimitive(ExecState*, JSType preferred) const;
virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value);
virtual bool toBoolean(ExecState*) const;
virtual double toNumber(ExecState*) const;
virtual UString toString(ExecState*) const;
virtual JSObject* toObject(ExecState*) const;
JSObject* m_getter;
JSObject* m_setter;
};
} // namespace KJS
#endif // GetterSetter_h
// -*- c-basic-offset: 2 -*-
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
......@@ -27,6 +26,7 @@
#include "DatePrototype.h"
#include "ErrorConstructor.h"
#include "GetterSetter.h"
#include "JSGlobalObject.h"
#include "NativeErrorConstructor.h"
#include "ObjectPrototype.h"
......@@ -42,8 +42,6 @@
namespace KJS {
// ------------------------------ JSObject ------------------------------------
void JSObject::mark()
{
JSCell::mark();
......@@ -479,97 +477,6 @@ void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValue** location)
slot.setUndefined();
}
// ------------------------------ Error ----------------------------------------
JSObject* Error::create(ExecState* exec, ErrorType errtype, const UString& message,
int lineno, int sourceId, const UString& sourceURL)
{
JSObject* cons;
const char* name;
switch (errtype) {
case EvalError:
cons = exec->lexicalGlobalObject()->evalErrorConstructor();
name = "Evaluation error";
break;
case RangeError:
cons = exec->lexicalGlobalObject()->rangeErrorConstructor();
name = "Range error";
break;
case ReferenceError:
cons = exec->lexicalGlobalObject()->referenceErrorConstructor();
name = "Reference error";
break;
case SyntaxError:
cons = exec->lexicalGlobalObject()->syntaxErrorConstructor();
name = "Syntax error";
break;
case TypeError:
cons = exec->lexicalGlobalObject()->typeErrorConstructor();
name = "Type error";
break;
case URIError:
cons = exec->lexicalGlobalObject()->URIErrorConstructor();
name = "URI error";
break;
default:
cons = exec->lexicalGlobalObject()->errorConstructor();
name = "Error";
break;
}
ArgList args;
if (message.isEmpty())
args.append(jsString(exec, name));
else
args.append(jsString(exec, message));
ConstructData constructData;
ConstructType constructType = cons->getConstructData(constructData);
JSObject* err = construct(exec, cons, constructType, constructData, args);
if (lineno != -1)
err->put(exec, Identifier(exec, "line"), jsNumber(exec, lineno));
if (sourceId != -1)
err->put(exec, Identifier(exec, "sourceId"), jsNumber(exec, sourceId));
if(!sourceURL.isNull())
err->put(exec, Identifier(exec, "sourceURL"), jsString(exec, sourceURL));
return err;
}
JSObject *Error::create(ExecState *exec, ErrorType type, const char *message)
{
return create(exec, type, message, -1, -1, NULL);
}
JSObject *throwError(ExecState *exec, ErrorType type)
{
JSObject *error = Error::create(exec, type, UString(), -1, -1, NULL);
exec->setException(error);
return error;
}
JSObject *throwError(ExecState *exec, ErrorType type, const UString &message)
{
JSObject *error = Error::create(exec, type, message, -1, -1, NULL);
exec->setException(error);
return error;
}
JSObject *throwError(ExecState *exec, ErrorType type, const char *message)
{
JSObject *error = Error::create(exec, type, message, -1, -1, NULL);
exec->setException(error);
return error;
}
JSObject *throwError(ExecState *exec, ErrorType type, const UString &message, int line, int sourceId, const UString &sourceURL)
{
JSObject *error = Error::create(exec, type, message, line, sourceId, sourceURL);
exec->setException(error);
return error;
}
JSObject* constructEmptyObject(ExecState* exec)
{
return new (exec) JSObject(exec->lexicalGlobalObject()->objectPrototype());
......
// -*- c-basic-offset: 2 -*-
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
......@@ -21,9 +20,10 @@
*
*/
#ifndef KJS_OBJECT_H
#define KJS_OBJECT_H
#ifndef JSObject_h
#define JSObject_h
#include "ClassInfo.h"
#include "CommonIdentifiers.h"
#include "ExecState.h"
#include "JSNumberCell.h"
......@@ -37,7 +37,6 @@ namespace KJS {
class InternalFunction;
class PropertyNameArray;
struct HashEntry;
struct HashTable;
......@@ -50,62 +49,6 @@ namespace KJS {
Function = 1 << 4, // property is a function - only used by static hashtables
IsGetterSetter = 1 << 5 }; // property is a getter or setter
/**
* Class Information
*/
struct ClassInfo {
/**
* A string denoting the class name. Example: "Window".
*/
const char* className;
/**
* Pointer to the class information of the base class.
* 0L if there is none.
*/
const ClassInfo* parentClass;
/**
* Static hash-table of properties.
* For classes that can be used from multiple threads, it is accessed via a getter function that would typically return a pointer to thread-specific value.
*/
const HashTable* propHashTable(ExecState* exec) const
{
if (classPropHashTableGetterFunction)
return classPropHashTableGetterFunction(exec);
return staticPropHashTable;
}
const HashTable* staticPropHashTable;
typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*);
const ClassPropHashTableGetterFunction classPropHashTableGetterFunction;
};
// This is an internal value object which stores getter and setter functions
// for a property.
class GetterSetter : public JSCell {
public:
JSType type() const { return GetterSetterType; }
GetterSetter() : m_getter(0), m_setter(0) { }
virtual void mark();
JSObject* getter() const { return m_getter; }
void setGetter(JSObject* getter) { m_getter = getter;