[webkit-changes] cvs commit: WebCore/kwq DOMInternal.mm
DOMUtility.mm KWQKHTMLPart.mm WebCoreBridge.mm
WebCoreScriptDebugger.mm
Darin
darin at opensource.apple.com
Sat Dec 10 18:06:21 PST 2005
darin 05/12/10 18:06:18
Modified: . ChangeLog
bindings NP_jsobject.cpp NP_jsobject.h runtime.cpp runtime.h
runtime_array.cpp runtime_array.h
runtime_method.cpp runtime_method.h
runtime_object.cpp runtime_object.h
runtime_root.cpp runtime_root.h
bindings/c c_instance.cpp c_instance.h c_runtime.cpp
c_runtime.h c_utility.cpp c_utility.h
bindings/jni jni_instance.cpp jni_instance.h
jni_jsobject.cpp jni_jsobject.h jni_objc.mm
jni_runtime.cpp jni_runtime.h jni_utility.cpp
jni_utility.h
bindings/objc WebScriptObject.mm WebScriptObjectPrivate.h
objc_class.h objc_class.mm objc_instance.h
objc_instance.mm objc_runtime.h objc_runtime.mm
objc_utility.h objc_utility.mm
kjs array_instance.h array_object.cpp array_object.h
bool_object.cpp bool_object.h collector.cpp
completion.h context.h date_object.cpp
date_object.h debugger.cpp debugger.h
error_object.cpp error_object.h function.cpp
function.h function_object.cpp function_object.h
internal.cpp internal.h interpreter.cpp
interpreter.h list.cpp list.h lookup.h
math_object.cpp math_object.h nodes.cpp nodes.h
number_object.cpp number_object.h object.cpp
object.h object_object.cpp object_object.h
operations.cpp operations.h property_map.cpp
property_map.h property_slot.cpp property_slot.h
protect.h protected_reference.h
protected_values.cpp protected_values.h
reference.cpp reference.h regexp_object.cpp
regexp_object.h scope_chain.h simple_number.h
string_object.cpp string_object.h testkjs.cpp
value.cpp value.h
. ChangeLog
khtml/ecma XSLTProcessor.cpp XSLTProcessor.h domparser.cpp
domparser.h kjs_binding.cpp kjs_binding.h
kjs_css.cpp kjs_css.h kjs_dom.cpp kjs_dom.h
kjs_events.cpp kjs_events.h kjs_html.cpp kjs_html.h
kjs_navigator.cpp kjs_navigator.h kjs_proxy.cpp
kjs_range.cpp kjs_range.h kjs_traversal.cpp
kjs_traversal.h kjs_views.cpp kjs_views.h
kjs_window.cpp kjs_window.h xmlhttprequest.cpp
xmlhttprequest.h xmlserializer.cpp xmlserializer.h
ksvg2/ecma Ecma.cpp Ecma.h GlobalObject.cpp GlobalObject.h
ksvg2/svg SVGScriptElementImpl.cpp
kwq DOMInternal.mm DOMUtility.mm KWQKHTMLPart.mm
WebCoreBridge.mm WebCoreScriptDebugger.mm
Log:
JavaScriptCore:
Rubber stamped by Maciej.
- did long-promised KJS renaming:
ValueImp -> JSValue
ObjectImp -> JSObject
AllocatedValueImp -> JSCell
A renaming to get a class out of the way
KJS::Bindings::JSObject -> JavaJSObject
and some other "imp-reduction" renaming
*InstanceImp -> *Instance
*ProtoFuncImp -> *ProtoFunc
*PrototypeImp -> *Prototype
ArgumentsImp -> Arguments
RuntimeArrayImp -> RuntimeArray
RuntimeMethodImp -> RuntimeMethod
* most files and functions
WebCore:
Rubber stamped by Maciej.
- updated for KJS class renaming
* many files and functions
Revision Changes Path
1.898 +25 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.897
retrieving revision 1.898
diff -u -r1.897 -r1.898
--- ChangeLog 11 Dec 2005 00:37:42 -0000 1.897
+++ ChangeLog 11 Dec 2005 02:05:29 -0000 1.898
@@ -1,5 +1,30 @@
2005-12-10 Darin Adler <darin at apple.com>
+ Rubber stamped by Maciej.
+
+ - did long-promised KJS renaming:
+
+ ValueImp -> JSValue
+ ObjectImp -> JSObject
+ AllocatedValueImp -> JSCell
+
+ A renaming to get a class out of the way
+
+ KJS::Bindings::JSObject -> JavaJSObject
+
+ and some other "imp-reduction" renaming
+
+ *InstanceImp -> *Instance
+ *ProtoFuncImp -> *ProtoFunc
+ *PrototypeImp -> *Prototype
+ ArgumentsImp -> Arguments
+ RuntimeArrayImp -> RuntimeArray
+ RuntimeMethodImp -> RuntimeMethod
+
+ * most files and functions
+
+2005-12-10 Darin Adler <darin at apple.com>
+
Reviewed by Maciej.
- eliminated the old Undefined(), Null(), Boolean(), Number(), and String()
1.27 +8 -8 JavaScriptCore/bindings/NP_jsobject.cpp
Index: NP_jsobject.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/NP_jsobject.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- NP_jsobject.cpp 11 Dec 2005 00:37:45 -0000 1.26
+++ NP_jsobject.cpp 11 Dec 2005 02:05:31 -0000 1.27
@@ -97,7 +97,7 @@
return true;
}
-NPObject *_NPN_CreateScriptObject (NPP npp, KJS::ObjectImp *imp, const KJS::Bindings::RootObject *originExecutionContext, const KJS::Bindings::RootObject *executionContext)
+NPObject *_NPN_CreateScriptObject (NPP npp, KJS::JSObject *imp, const KJS::Bindings::RootObject *originExecutionContext, const KJS::Bindings::RootObject *executionContext)
{
JavaScriptObject *obj = (JavaScriptObject *)_NPN_CreateObject(npp, NPScriptObjectClass);
@@ -150,7 +150,7 @@
// Lookup the function object.
ExecState *exec = obj->executionContext->interpreter()->globalExec();
JSLock lock;
- ValueImp *func = obj->imp->get (exec, identifierFromNPIdentifier(i->value.string));
+ JSValue *func = obj->imp->get (exec, identifierFromNPIdentifier(i->value.string));
if (func->isNull()) {
NPN_InitializeVariantAsNull(result);
@@ -160,10 +160,10 @@
return false;
} else {
// Call the function object.
- ObjectImp *funcImp = static_cast<ObjectImp*>(func);
- ObjectImp *thisObj = const_cast<ObjectImp*>(obj->imp);
+ JSObject *funcImp = static_cast<JSObject*>(func);
+ JSObject *thisObj = const_cast<JSObject*>(obj->imp);
List argList = listFromVariantArgs(exec, args, argCount);
- ValueImp *resultV = funcImp->call (exec, thisObj, argList);
+ JSValue *resultV = funcImp->call (exec, thisObj, argList);
// Convert and return the result of the function call.
convertValueToNPVariant(exec, resultV, result);
@@ -185,7 +185,7 @@
return false;
ExecState *exec = obj->executionContext->interpreter()->globalExec();
- ValueImp *result;
+ JSValue *result;
JSLock lock;
NPUTF16 *scriptString;
@@ -225,7 +225,7 @@
PrivateIdentifier *i = (PrivateIdentifier *)propertyName;
JSLock lock;
- ValueImp *result;
+ JSValue *result;
if (i->isString) {
result = obj->imp->get (exec, identifierFromNPIdentifier(i->value.string));
} else {
@@ -352,7 +352,7 @@
ExecState *exec = obj->executionContext->interpreter()->globalExec();
JSLock lock;
- ValueImp *func = obj->imp->get (exec, identifierFromNPIdentifier(i->value.string));
+ JSValue *func = obj->imp->get (exec, identifierFromNPIdentifier(i->value.string));
if (func->isUndefined()) {
return false;
1.7 +2 -2 JavaScriptCore/bindings/NP_jsobject.h
Index: NP_jsobject.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/NP_jsobject.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- NP_jsobject.h 17 Jan 2005 22:41:22 -0000 1.6
+++ NP_jsobject.h 11 Dec 2005 02:05:31 -0000 1.7
@@ -40,12 +40,12 @@
typedef struct
{
NPObject object;
- KJS::ObjectImp *imp;
+ KJS::JSObject *imp;
const KJS::Bindings::RootObject *originExecutionContext;
const KJS::Bindings::RootObject *executionContext;
} JavaScriptObject;
-NPObject *_NPN_CreateScriptObject (NPP npp, KJS::ObjectImp *imp, const KJS::Bindings::RootObject *originExecutionContext, const KJS::Bindings::RootObject *executionContext);
+NPObject *_NPN_CreateScriptObject (NPP npp, KJS::JSObject *imp, const KJS::Bindings::RootObject *originExecutionContext, const KJS::Bindings::RootObject *executionContext);
#ifdef __cplusplus
}
1.23 +5 -5 JavaScriptCore/bindings/runtime.cpp
Index: runtime.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- runtime.cpp 27 Nov 2005 07:54:41 -0000 1.22
+++ runtime.cpp 11 Dec 2005 02:05:31 -0000 1.23
@@ -92,11 +92,11 @@
void Instance::setDidExecuteFunction (KJSDidExecuteFunctionPtr func) { _DidExecuteFunction = func; }
KJSDidExecuteFunctionPtr Instance::didExecuteFunction () { return _DidExecuteFunction; }
-ValueImp *Instance::getValueOfField (KJS::ExecState *exec, const Field *aField) const {
+JSValue *Instance::getValueOfField (KJS::ExecState *exec, const Field *aField) const {
return aField->valueFromInstance (exec, this);
}
-void Instance::setValueOfField (KJS::ExecState *exec, const Field *aField, ValueImp *aValue) const {
+void Instance::setValueOfField (KJS::ExecState *exec, const Field *aField, JSValue *aValue) const {
aField->setValueToInstance (exec, this, aValue);
}
@@ -127,7 +127,7 @@
return newInstance;
}
-ObjectImp *Instance::createRuntimeObject (BindingLanguage language, void *nativeInstance, const RootObject *executionContext)
+JSObject *Instance::createRuntimeObject (BindingLanguage language, void *nativeInstance, const RootObject *executionContext)
{
Instance *interfaceObject = Instance::createBindingForLanguageInstance(language, (void *)nativeInstance, executionContext);
@@ -135,14 +135,14 @@
return new RuntimeObjectImp(interfaceObject,true);
}
-void *Instance::createLanguageInstanceForValue (ExecState *exec, BindingLanguage language, ObjectImp *value, const RootObject *origin, const RootObject *current)
+void *Instance::createLanguageInstanceForValue (ExecState *exec, BindingLanguage language, JSObject *value, const RootObject *origin, const RootObject *current)
{
void *result = 0;
if (!value->isObject())
return 0;
- ObjectImp *imp = static_cast<ObjectImp*>(value);
+ JSObject *imp = static_cast<JSObject*>(value);
switch (language) {
case Instance::ObjectiveCLanguage: {
1.34 +16 -16 JavaScriptCore/bindings/runtime.h
Index: runtime.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- runtime.h 11 Dec 2005 00:37:45 -0000 1.33
+++ runtime.h 11 Dec 2005 02:05:31 -0000 1.34
@@ -65,8 +65,8 @@
virtual const char *name() const = 0;
virtual RuntimeType type() const = 0;
- virtual ValueImp *valueFromInstance(ExecState *, const Instance *) const = 0;
- virtual void setValueToInstance(ExecState *, const Instance *, ValueImp *) const = 0;
+ virtual JSValue *valueFromInstance(ExecState *, const Instance *) const = 0;
+ virtual void setValueToInstance(ExecState *, const Instance *, JSValue *) const = 0;
virtual ~Field() {}
};
@@ -114,12 +114,12 @@
virtual Field *fieldNamed(const char *name, Instance *instance) const = 0;
- virtual ValueImp *fallbackObject(ExecState *, Instance *, const Identifier &) { return jsUndefined(); }
+ virtual JSValue *fallbackObject(ExecState *, Instance *, const Identifier &) { return jsUndefined(); }
virtual ~Class() {}
};
-typedef void (*KJSDidExecuteFunctionPtr)(ExecState *exec, ObjectImp *rootObject);
+typedef void (*KJSDidExecuteFunctionPtr)(ExecState *exec, JSObject *rootObject);
class Instance
{
@@ -134,8 +134,8 @@
static KJSDidExecuteFunctionPtr didExecuteFunction();
static Instance *createBindingForLanguageInstance(BindingLanguage language, void *nativeInstance, const RootObject *r = 0);
- static void *createLanguageInstanceForValue(ExecState *exec, BindingLanguage language, ObjectImp *value, const RootObject *origin, const RootObject *current);
- static ObjectImp *createRuntimeObject(BindingLanguage language, void *nativeInstance, const RootObject *r = 0);
+ static void *createLanguageInstanceForValue(ExecState *exec, BindingLanguage language, JSObject *value, const RootObject *origin, const RootObject *current);
+ static JSObject *createRuntimeObject(BindingLanguage language, void *nativeInstance, const RootObject *r = 0);
Instance() : _executionContext(0) {}
@@ -151,18 +151,18 @@
virtual Class *getClass() const = 0;
- virtual ValueImp *getValueOfField(ExecState *exec, const Field *aField) const;
- virtual ValueImp *getValueOfUndefinedField(ExecState *exec, const Identifier &property, Type hint) const { return jsUndefined(); }
- virtual void setValueOfField(ExecState *exec, const Field *aField, ValueImp *aValue) const;
+ virtual JSValue *getValueOfField(ExecState *exec, const Field *aField) const;
+ virtual JSValue *getValueOfUndefinedField(ExecState *exec, const Identifier &property, Type hint) const { return jsUndefined(); }
+ virtual void setValueOfField(ExecState *exec, const Field *aField, JSValue *aValue) const;
virtual bool supportsSetValueOfUndefinedField() { return false; }
- virtual void setValueOfUndefinedField(ExecState *exec, const Identifier &property, ValueImp *aValue) {}
+ virtual void setValueOfUndefinedField(ExecState *exec, const Identifier &property, JSValue *aValue) {}
- virtual ValueImp *invokeMethod(ExecState *exec, const MethodList &method, const List &args) = 0;
- virtual ValueImp *invokeDefaultMethod(ExecState *exec, const List &args) = 0;
+ virtual JSValue *invokeMethod(ExecState *exec, const MethodList &method, const List &args) = 0;
+ virtual JSValue *invokeDefaultMethod(ExecState *exec, const List &args) = 0;
- virtual ValueImp *defaultValue(Type hint) const = 0;
+ virtual JSValue *defaultValue(Type hint) const = 0;
- virtual ValueImp *valueOf() const { return jsString(getClass()->name()); }
+ virtual JSValue *valueOf() const { return jsString(getClass()->name()); }
void setExecutionContext(const RootObject *r) { _executionContext = r; }
const RootObject *executionContext() const { return _executionContext; }
@@ -176,8 +176,8 @@
class Array
{
public:
- virtual void setValueAt(ExecState *, unsigned index, ValueImp *) const = 0;
- virtual ValueImp *valueAt(ExecState *, unsigned index) const = 0;
+ virtual void setValueAt(ExecState *, unsigned index, JSValue *) const = 0;
+ virtual JSValue *valueAt(ExecState *, unsigned index) const = 0;
virtual unsigned int getLength() const = 0;
virtual ~Array() {}
};
1.14 +17 -17 JavaScriptCore/bindings/runtime_array.cpp
Index: runtime_array.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_array.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- runtime_array.cpp 11 Dec 2005 00:37:45 -0000 1.13
+++ runtime_array.cpp 11 Dec 2005 02:05:32 -0000 1.14
@@ -30,33 +30,33 @@
using namespace KJS;
-const ClassInfo RuntimeArrayImp::info = {"RuntimeArray", &ArrayInstanceImp::info, 0, 0};
+const ClassInfo RuntimeArray::info = {"RuntimeArray", &ArrayInstance::info, 0, 0};
-RuntimeArrayImp::RuntimeArrayImp(ExecState *exec, Bindings::Array *a)
- : ArrayInstanceImp(exec->lexicalInterpreter()->builtinArrayPrototype(), a->getLength())
+RuntimeArray::RuntimeArray(ExecState *exec, Bindings::Array *a)
+ : ArrayInstance(exec->lexicalInterpreter()->builtinArrayPrototype(), a->getLength())
{
// Always takes ownership of concrete array.
_array = a;
}
-RuntimeArrayImp::~RuntimeArrayImp()
+RuntimeArray::~RuntimeArray()
{
delete _array;
}
-ValueImp *RuntimeArrayImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *RuntimeArray::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
- RuntimeArrayImp *thisObj = static_cast<RuntimeArrayImp *>(slot.slotBase());
+ RuntimeArray *thisObj = static_cast<RuntimeArray *>(slot.slotBase());
return jsNumber(thisObj->getLength());
}
-ValueImp *RuntimeArrayImp::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *RuntimeArray::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
- RuntimeArrayImp *thisObj = static_cast<RuntimeArrayImp *>(slot.slotBase());
+ RuntimeArray *thisObj = static_cast<RuntimeArray *>(slot.slotBase());
return thisObj->getConcreteArray()->valueAt(exec, slot.index());
}
-bool RuntimeArrayImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool RuntimeArray::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
if (propertyName == lengthPropertyName) {
slot.setCustom(this, lengthGetter);
@@ -72,20 +72,20 @@
}
}
- return ArrayInstanceImp::getOwnPropertySlot(exec, propertyName, slot);
+ return ArrayInstance::getOwnPropertySlot(exec, propertyName, slot);
}
-bool RuntimeArrayImp::getOwnPropertySlot(ExecState *exec, unsigned index, PropertySlot& slot)
+bool RuntimeArray::getOwnPropertySlot(ExecState *exec, unsigned index, PropertySlot& slot)
{
if (index < getLength()) {
slot.setCustomIndex(this, index, indexGetter);
return true;
}
- return ArrayInstanceImp::getOwnPropertySlot(exec, index, slot);
+ return ArrayInstance::getOwnPropertySlot(exec, index, slot);
}
-void RuntimeArrayImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void RuntimeArray::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
if (propertyName == lengthPropertyName) {
throwError(exec, RangeError);
@@ -99,10 +99,10 @@
return;
}
- ObjectImp::put(exec, propertyName, value, attr);
+ JSObject::put(exec, propertyName, value, attr);
}
-void RuntimeArrayImp::put(ExecState *exec, unsigned index, ValueImp *value, int attr)
+void RuntimeArray::put(ExecState *exec, unsigned index, JSValue *value, int attr)
{
if (index >= getLength()) {
throwError(exec, RangeError);
@@ -112,12 +112,12 @@
getConcreteArray()->setValueAt(exec, index, value);
}
-bool RuntimeArrayImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
+bool RuntimeArray::deleteProperty(ExecState *exec, const Identifier &propertyName)
{
return false;
}
-bool RuntimeArrayImp::deleteProperty(ExecState *exec, unsigned index)
+bool RuntimeArray::deleteProperty(ExecState *exec, unsigned index)
{
return false;
}
1.13 +7 -7 JavaScriptCore/bindings/runtime_array.h
Index: runtime_array.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_array.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- runtime_array.h 8 Aug 2005 04:07:22 -0000 1.12
+++ runtime_array.h 11 Dec 2005 02:05:32 -0000 1.13
@@ -32,15 +32,15 @@
namespace KJS {
-class RuntimeArrayImp : public ArrayInstanceImp {
+class RuntimeArray : public ArrayInstance {
public:
- RuntimeArrayImp(ExecState *exec, Bindings::Array *i);
- ~RuntimeArrayImp();
+ RuntimeArray(ExecState *exec, Bindings::Array *i);
+ ~RuntimeArray();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState *, unsigned, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- virtual void put(ExecState *exec, unsigned propertyName, ValueImp *value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ virtual void put(ExecState *exec, unsigned propertyName, JSValue *value, int attr = None);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
@@ -54,8 +54,8 @@
static const ClassInfo info;
private:
- static ValueImp *lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
- static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
Bindings::Array *_array;
};
1.16 +11 -11 JavaScriptCore/bindings/runtime_method.cpp
Index: runtime_method.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_method.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- runtime_method.cpp 11 Dec 2005 00:37:45 -0000 1.15
+++ runtime_method.cpp 11 Dec 2005 02:05:32 -0000 1.16
@@ -32,18 +32,18 @@
using namespace KJS::Bindings;
using namespace KJS;
-RuntimeMethodImp::RuntimeMethodImp(ExecState *exec, const Identifier &ident, Bindings::MethodList &m) : FunctionImp (exec, ident)
+RuntimeMethod::RuntimeMethod(ExecState *exec, const Identifier &ident, Bindings::MethodList &m) : FunctionImp (exec, ident)
{
_methodList = m;
}
-RuntimeMethodImp::~RuntimeMethodImp()
+RuntimeMethod::~RuntimeMethod()
{
}
-ValueImp *RuntimeMethodImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *RuntimeMethod::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
- RuntimeMethodImp *thisObj = static_cast<RuntimeMethodImp *>(slot.slotBase());
+ RuntimeMethod *thisObj = static_cast<RuntimeMethod *>(slot.slotBase());
// Ick! There may be more than one method with this name. Arbitrarily
// just pick the first method. The fundamental problem here is that
@@ -54,7 +54,7 @@
return jsNumber(thisObj->_methodList.methodAt(0)->numParameters());
}
-bool RuntimeMethodImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot)
+bool RuntimeMethod::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot)
{
if (propertyName == lengthPropertyName) {
slot.setCustom(this, lengthGetter);
@@ -64,12 +64,12 @@
return FunctionImp::getOwnPropertySlot(exec, propertyName, slot);
}
-bool RuntimeMethodImp::implementsCall() const
+bool RuntimeMethod::implementsCall() const
{
return true;
}
-ValueImp *RuntimeMethodImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *RuntimeMethod::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (_methodList.length() > 0) {
RuntimeObjectImp *imp;
@@ -77,7 +77,7 @@
// If thisObj is the DOM object for a plugin, get the corresponding
// runtime object from the DOM object.
if (thisObj->classInfo() != &KJS::RuntimeObjectImp::info) {
- ValueImp *runtimeObject = thisObj->get(exec, "__apple_runtime_object");
+ JSValue *runtimeObject = thisObj->get(exec, "__apple_runtime_object");
imp = static_cast<RuntimeObjectImp*>(runtimeObject);
}
else {
@@ -88,7 +88,7 @@
instance->begin();
- ValueImp *aValue = instance->invokeMethod(exec, _methodList, args);
+ JSValue *aValue = instance->invokeMethod(exec, _methodList, args);
instance->end();
@@ -99,13 +99,13 @@
return jsUndefined();
}
-CodeType RuntimeMethodImp::codeType() const
+CodeType RuntimeMethod::codeType() const
{
return FunctionCode;
}
-Completion RuntimeMethodImp::execute(ExecState *exec)
+Completion RuntimeMethod::execute(ExecState *exec)
{
return Completion(Normal, jsUndefined());
}
1.8 +5 -5 JavaScriptCore/bindings/runtime_method.h
Index: runtime_method.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_method.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- runtime_method.h 8 Aug 2005 04:07:22 -0000 1.7
+++ runtime_method.h 11 Dec 2005 02:05:32 -0000 1.8
@@ -31,24 +31,24 @@
namespace KJS {
-class RuntimeMethodImp : public FunctionImp
+class RuntimeMethod : public FunctionImp
{
public:
- RuntimeMethodImp(ExecState *exec, const Identifier &n, Bindings::MethodList &methodList);
+ RuntimeMethod(ExecState *exec, const Identifier &n, Bindings::MethodList &methodList);
- virtual ~RuntimeMethodImp();
+ virtual ~RuntimeMethod();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
virtual CodeType codeType() const;
virtual Completion execute(ExecState *exec);
private:
- static ValueImp *lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
Bindings::MethodList _methodList;
};
1.30 +13 -13 JavaScriptCore/bindings/runtime_object.cpp
Index: runtime_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_object.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- runtime_object.cpp 3 Oct 2005 21:11:41 -0000 1.29
+++ runtime_object.cpp 11 Dec 2005 02:05:32 -0000 1.30
@@ -42,8 +42,8 @@
const ClassInfo RuntimeObjectImp::info = {"RuntimeObject", 0, 0, 0};
-RuntimeObjectImp::RuntimeObjectImp(ObjectImp *proto)
- : ObjectImp(proto)
+RuntimeObjectImp::RuntimeObjectImp(JSObject *proto)
+ : JSObject(proto)
{
instance = 0;
}
@@ -61,7 +61,7 @@
instance = i;
}
-ValueImp *RuntimeObjectImp::fallbackObjectGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *RuntimeObjectImp::fallbackObjectGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
RuntimeObjectImp *thisObj = static_cast<RuntimeObjectImp *>(slot.slotBase());
Bindings::Instance *instance = thisObj->instance;
@@ -69,14 +69,14 @@
instance->begin();
Class *aClass = instance->getClass();
- ValueImp *result = aClass->fallbackObject(exec, instance, propertyName);
+ JSValue *result = aClass->fallbackObject(exec, instance, propertyName);
instance->end();
return result;
}
-ValueImp *RuntimeObjectImp::fieldGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *RuntimeObjectImp::fieldGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
RuntimeObjectImp *thisObj = static_cast<RuntimeObjectImp *>(slot.slotBase());
Bindings::Instance *instance = thisObj->instance;
@@ -85,14 +85,14 @@
Class *aClass = instance->getClass();
Field *aField = aClass->fieldNamed(propertyName.ascii(), instance);
- ValueImp *result = instance->getValueOfField(exec, aField);
+ JSValue *result = instance->getValueOfField(exec, aField);
instance->end();
return result;
}
-ValueImp *RuntimeObjectImp::methodGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *RuntimeObjectImp::methodGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
RuntimeObjectImp *thisObj = static_cast<RuntimeObjectImp *>(slot.slotBase());
Bindings::Instance *instance = thisObj->instance;
@@ -101,7 +101,7 @@
Class *aClass = instance->getClass();
MethodList methodList = aClass->methodsNamed(propertyName.ascii(), instance);
- ValueImp *result = new RuntimeMethodImp(exec, propertyName, methodList);
+ JSValue *result = new RuntimeMethod(exec, propertyName, methodList);
instance->end();
@@ -147,7 +147,7 @@
}
void RuntimeObjectImp::put(ExecState *exec, const Identifier &propertyName,
- ValueImp *value, int attr)
+ JSValue *value, int attr)
{
instance->begin();
@@ -188,9 +188,9 @@
return false;
}
-ValueImp *RuntimeObjectImp::defaultValue(ExecState *exec, Type hint) const
+JSValue *RuntimeObjectImp::defaultValue(ExecState *exec, Type hint) const
{
- ValueImp *result;
+ JSValue *result;
instance->begin();
@@ -207,11 +207,11 @@
return true;
}
-ValueImp *RuntimeObjectImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *RuntimeObjectImp::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
instance->begin();
- ValueImp *aValue = getInternalInstance()->invokeDefaultMethod(exec, args);
+ JSValue *aValue = getInternalInstance()->invokeDefaultMethod(exec, args);
instance->end();
1.18 +8 -8 JavaScriptCore/bindings/runtime_object.h
Index: runtime_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_object.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- runtime_object.h 16 Aug 2005 00:47:21 -0000 1.17
+++ runtime_object.h 11 Dec 2005 02:05:32 -0000 1.18
@@ -30,9 +30,9 @@
namespace KJS {
-class RuntimeObjectImp : public ObjectImp {
+class RuntimeObjectImp : public JSObject {
public:
- RuntimeObjectImp(ObjectImp *proto);
+ RuntimeObjectImp(JSObject *proto);
~RuntimeObjectImp();
RuntimeObjectImp(Bindings::Instance *i, bool ownsInstance = true);
@@ -41,11 +41,11 @@
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
virtual bool canPut(ExecState *exec, const Identifier &propertyName) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
- virtual ValueImp *defaultValue(ExecState *exec, Type hint) const;
+ virtual JSValue *defaultValue(ExecState *exec, Type hint) const;
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
void setInternalInstance(Bindings::Instance *i) { instance = i; }
Bindings::Instance *getInternalInstance() const { return instance; }
@@ -53,9 +53,9 @@
static const ClassInfo info;
private:
- static ValueImp *fallbackObjectGetter(ExecState *, const Identifier&, const PropertySlot&);
- static ValueImp *fieldGetter(ExecState *, const Identifier&, const PropertySlot&);
- static ValueImp *methodGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *fallbackObjectGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *fieldGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *methodGetter(ExecState *, const Identifier&, const PropertySlot&);
Bindings::Instance *instance;
bool ownsInstance;
1.14 +9 -9 JavaScriptCore/bindings/runtime_root.cpp
Index: runtime_root.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_root.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- runtime_root.cpp 27 Nov 2005 07:54:41 -0000 1.13
+++ runtime_root.cpp 11 Dec 2005 02:05:32 -0000 1.14
@@ -31,10 +31,10 @@
// Java does NOT always call finalize (and thus KJS_JSObject_JSFinalize) when
// it collects an objects. This presents some difficulties. We must ensure
-// the a JSObject's corresponding JavaScript object doesn't get collected. We
+// the a JavaJSObject's corresponding JavaScript object doesn't get collected. We
// do this by incrementing the JavaScript's reference count the first time we
-// create a JSObject for it, and decrementing the JavaScript reference count when
-// the last JSObject that refers to it is finalized, or when the applet is
+// create a JavaJSObject for it, and decrementing the JavaScript reference count when
+// the last JavaJSObject that refers to it is finalized, or when the applet is
// shutdown.
//
// To do this we keep a dictionary that maps each applet instance
@@ -71,7 +71,7 @@
// dictionary.
// FIXME: This is a potential performance bottleneck with many applets. We could fix be adding a
// imp to root dictionary.
-CFMutableDictionaryRef KJS::Bindings::findReferenceDictionary(ObjectImp *imp)
+CFMutableDictionaryRef KJS::Bindings::findReferenceDictionary(JSObject *imp)
{
CFMutableDictionaryRef refsByRoot = getReferencesByRootDictionary ();
CFMutableDictionaryRef foundDictionary = 0;
@@ -98,7 +98,7 @@
// FIXME: This is a potential performance bottleneck with many applets. We could fix be adding a
// imp to root dictionary.
-const Bindings::RootObject *KJS::Bindings::rootForImp (ObjectImp *imp)
+const Bindings::RootObject *KJS::Bindings::rootForImp (JSObject *imp)
{
CFMutableDictionaryRef refsByRoot = getReferencesByRootDictionary ();
const Bindings::RootObject *rootObject = 0;
@@ -154,7 +154,7 @@
return result;
}
-void KJS::Bindings::addNativeReference (const Bindings::RootObject *root, ObjectImp *imp)
+void KJS::Bindings::addNativeReference (const Bindings::RootObject *root, JSObject *imp)
{
if (root) {
CFMutableDictionaryRef referencesDictionary = getReferencesDictionary (root);
@@ -171,7 +171,7 @@
}
}
-void KJS::Bindings::removeNativeReference (ObjectImp *imp)
+void KJS::Bindings::removeNativeReference (JSObject *imp)
{
if (!imp)
return;
@@ -283,7 +283,7 @@
JSObjectCallContext *callContext = (JSObjectCallContext *)sourceContext.info;
CFRunLoopRef originatingLoop = callContext->originatingLoop;
- JSObject::invoke (callContext);
+ JavaJSObject::invoke (callContext);
// Signal the originating thread that we're done.
CFRunLoopSourceSignal (completionSource);
@@ -328,7 +328,7 @@
CFDictionaryGetKeysAndValues (referencesDictionary, (const void **)allImps, NULL);
for(i = 0; i < count; i++) {
JSLock lock;
- ObjectImp *anImp = static_cast<ObjectImp*>(allImps[i]);
+ JSObject *anImp = static_cast<JSObject*>(allImps[i]);
gcUnprotect(anImp);
}
free ((void *)allImps);
1.13 +8 -8 JavaScriptCore/bindings/runtime_root.h
Index: runtime_root.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_root.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- runtime_root.h 27 Nov 2005 07:54:41 -0000 1.12
+++ runtime_root.h 11 Dec 2005 02:05:32 -0000 1.13
@@ -39,15 +39,15 @@
typedef RootObject *(*FindRootObjectForNativeHandleFunctionPtr)(void *);
-extern CFMutableDictionaryRef findReferenceDictionary(ObjectImp *imp);
-extern const RootObject *rootForImp (ObjectImp *imp);
+extern CFMutableDictionaryRef findReferenceDictionary(JSObject *imp);
+extern const RootObject *rootForImp (JSObject *imp);
extern const RootObject *rootForInterpreter (Interpreter *interpreter);
-extern void addNativeReference (const RootObject *root, ObjectImp *imp);
-extern void removeNativeReference (ObjectImp *imp);
+extern void addNativeReference (const RootObject *root, JSObject *imp);
+extern void removeNativeReference (JSObject *imp);
class RootObject
{
-friend class JSObject;
+friend class JavaJSObject;
public:
RootObject (const void *nativeHandle) : _nativeHandle(nativeHandle), _imp(0), _interpreter(0) {}
~RootObject () {
@@ -55,13 +55,13 @@
gcUnprotect(_imp);
}
- void setRootObjectImp (ObjectImp *i) {
+ void setRootObjectImp (JSObject *i) {
JSLock lock;
_imp = i;
gcProtect(_imp);
}
- ObjectImp *rootObjectImp() const { return _imp; }
+ JSObject *rootObjectImp() const { return _imp; }
void setInterpreter (Interpreter *i);
Interpreter *interpreter() const { return _interpreter; }
@@ -84,7 +84,7 @@
private:
const void *_nativeHandle;
- ObjectImp *_imp;
+ JSObject *_imp;
Interpreter *_interpreter;
static FindRootObjectForNativeHandleFunctionPtr _findRootObjectForNativeHandleFunctionPtr;
1.16 +9 -9 JavaScriptCore/bindings/c/c_instance.cpp
Index: c_instance.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/c/c_instance.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- c_instance.cpp 11 Dec 2005 00:37:46 -0000 1.15
+++ c_instance.cpp 11 Dec 2005 02:05:34 -0000 1.16
@@ -95,9 +95,9 @@
// Do nothing.
}
-ValueImp *CInstance::invokeMethod (ExecState *exec, const MethodList &methodList, const List &args)
+JSValue *CInstance::invokeMethod (ExecState *exec, const MethodList &methodList, const List &args)
{
- ValueImp *resultValue;
+ JSValue *resultValue;
// Overloading methods are not allowed by NPObjects. Should only be one
// name match for a particular method.
@@ -147,9 +147,9 @@
}
-ValueImp *CInstance::invokeDefaultMethod (ExecState *exec, const List &args)
+JSValue *CInstance::invokeDefaultMethod (ExecState *exec, const List &args)
{
- ValueImp *resultValue;
+ JSValue *resultValue;
if (_object->_class->invokeDefault) {
unsigned i, count = args.size();
@@ -189,7 +189,7 @@
}
-ValueImp *CInstance::defaultValue (Type hint) const
+JSValue *CInstance::defaultValue (Type hint) const
{
if (hint == StringType) {
return stringValue();
@@ -204,26 +204,26 @@
return valueOf();
}
-ValueImp *CInstance::stringValue() const
+JSValue *CInstance::stringValue() const
{
char buf[1024];
snprintf(buf, 1024, "NPObject %p, NPClass %p", _object, _object->_class);
return jsString(buf);
}
-ValueImp *CInstance::numberValue() const
+JSValue *CInstance::numberValue() const
{
// FIXME: Implement something sensible
return jsNumber(0);
}
-ValueImp *CInstance::booleanValue() const
+JSValue *CInstance::booleanValue() const
{
// FIXME: Implement something sensible
return jsBoolean(false);
}
-ValueImp *CInstance::valueOf() const
+JSValue *CInstance::valueOf() const
{
return stringValue();
}
1.8 +7 -7 JavaScriptCore/bindings/c/c_instance.h
Index: c_instance.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/c/c_instance.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- c_instance.h 8 Aug 2005 04:07:23 -0000 1.7
+++ c_instance.h 11 Dec 2005 02:05:34 -0000 1.8
@@ -51,15 +51,15 @@
virtual void begin();
virtual void end();
- virtual ValueImp *valueOf() const;
- virtual ValueImp *defaultValue (KJS::Type hint) const;
+ virtual JSValue *valueOf() const;
+ virtual JSValue *defaultValue (KJS::Type hint) const;
- virtual ValueImp *invokeMethod (ExecState *exec, const MethodList &method, const List &args);
- virtual ValueImp *invokeDefaultMethod (ExecState *exec, const List &args);
+ virtual JSValue *invokeMethod (ExecState *exec, const MethodList &method, const List &args);
+ virtual JSValue *invokeDefaultMethod (ExecState *exec, const List &args);
- ValueImp *stringValue() const;
- ValueImp *numberValue() const;
- ValueImp *booleanValue() const;
+ JSValue *stringValue() const;
+ JSValue *numberValue() const;
+ JSValue *booleanValue() const;
NPObject *getObject() const { return _object; }
1.10 +3 -3 JavaScriptCore/bindings/c/c_runtime.cpp
Index: c_runtime.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/c/c_runtime.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- c_runtime.cpp 11 Dec 2005 00:37:46 -0000 1.9
+++ c_runtime.cpp 11 Dec 2005 02:05:34 -0000 1.10
@@ -42,11 +42,11 @@
// ---------------------- CField ----------------------
-ValueImp *CField::valueFromInstance(ExecState *exec, const Instance *inst) const
+JSValue *CField::valueFromInstance(ExecState *exec, const Instance *inst) const
{
const CInstance *instance = static_cast<const CInstance*>(inst);
NPObject *obj = instance->getObject();
- ValueImp *aValue;
+ JSValue *aValue;
NPVariant property;
VOID_TO_NPVARIANT(property);
if (obj->_class->getProperty) {
@@ -59,7 +59,7 @@
return aValue;
}
-void CField::setValueToInstance(ExecState *exec, const Instance *inst, ValueImp *aValue) const
+void CField::setValueToInstance(ExecState *exec, const Instance *inst, JSValue *aValue) const
{
const CInstance *instance = static_cast<const CInstance*>(inst);
NPObject *obj = instance->getObject();
1.8 +4 -4 JavaScriptCore/bindings/c/c_runtime.h
Index: c_runtime.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/c/c_runtime.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- c_runtime.h 16 Sep 2005 22:42:28 -0000 1.7
+++ c_runtime.h 11 Dec 2005 02:05:34 -0000 1.8
@@ -48,8 +48,8 @@
_fieldIdentifier = ident;
};
- virtual ValueImp *valueFromInstance(ExecState *exec, const Instance *instance) const;
- virtual void setValueToInstance(ExecState *exec, const Instance *instance, ValueImp *aValue) const;
+ virtual JSValue *valueFromInstance(ExecState *exec, const Instance *instance) const;
+ virtual void setValueToInstance(ExecState *exec, const Instance *instance, JSValue *aValue) const;
virtual const char *name() const { return _NPN_UTF8FromIdentifier(_fieldIdentifier); }
virtual RuntimeType type() const { return ""; }
@@ -84,8 +84,8 @@
CArray &operator=(const CArray &other);
- virtual void setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const;
- virtual ValueImp *valueAt(ExecState *exec, unsigned int index) const;
+ virtual void setValueAt(ExecState *exec, unsigned int index, JSValue *aValue) const;
+ virtual JSValue *valueAt(ExecState *exec, unsigned int index) const;
virtual unsigned int getLength() const;
virtual ~CArray();
1.14 +6 -6 JavaScriptCore/bindings/c/c_utility.cpp
Index: c_utility.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/c/c_utility.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- c_utility.cpp 11 Dec 2005 00:37:47 -0000 1.13
+++ c_utility.cpp 11 Dec 2005 02:05:34 -0000 1.14
@@ -59,7 +59,7 @@
}
// Variant value must be released with NPReleaseVariantValue()
-void coerceValueToNPVariantStringType(ExecState *exec, ValueImp *value, NPVariant *result)
+void coerceValueToNPVariantStringType(ExecState *exec, JSValue *value, NPVariant *result)
{
UString ustring = value->toString(exec);
CString cstring = ustring.UTF8String();
@@ -68,7 +68,7 @@
}
// Variant value must be released with NPReleaseVariantValue()
-void convertValueToNPVariant(ExecState *exec, ValueImp *value, NPVariant *result)
+void convertValueToNPVariant(ExecState *exec, JSValue *value, NPVariant *result)
{
Type type = value->type();
@@ -91,7 +91,7 @@
NPN_InitializeVariantAsNull(result);
}
else if (type == ObjectType) {
- ObjectImp *objectImp = static_cast<ObjectImp*>(value);
+ JSObject *objectImp = static_cast<JSObject*>(value);
if (objectImp->classInfo() == &RuntimeObjectImp::info) {
RuntimeObjectImp *imp = static_cast<RuntimeObjectImp *>(value);
CInstance *instance = static_cast<CInstance*>(imp->getInternalInstance());
@@ -126,7 +126,7 @@
NPN_InitializeVariantAsUndefined(result);
}
-ValueImp *convertNPVariantToValue(ExecState *exec, const NPVariant *variant)
+JSValue *convertNPVariantToValue(ExecState *exec, const NPVariant *variant)
{
NPVariantType type = variant->type;
@@ -166,9 +166,9 @@
NPObject *obj = variant->value.objectValue;
if (obj->_class == NPScriptObjectClass) {
- // Get ObjectImp from NP_JavaScriptObject.
+ // Get JSObject from NP_JavaScriptObject.
JavaScriptObject *o = (JavaScriptObject *)obj;
- return const_cast<ObjectImp*>(o->imp);
+ return const_cast<JSObject*>(o->imp);
}
else {
// Wrap NPObject in a CInstance.
1.9 +3 -3 JavaScriptCore/bindings/c/c_utility.h
Index: c_utility.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/c/c_utility.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- c_utility.h 16 Aug 2005 22:01:30 -0000 1.8
+++ c_utility.h 11 Dec 2005 02:05:35 -0000 1.9
@@ -49,9 +49,9 @@
void convertNPStringToUTF16(const NPString *string, NPUTF16 **UTF16Chars, unsigned int *UTF16Length);
void convertUTF8ToUTF16(const NPUTF8 *UTF8Chars, int UTF8Length, NPUTF16 **UTF16Chars, unsigned int *UTF16Length);
-void coerceValueToNPVariantStringType(KJS::ExecState *exec, KJS::ValueImp *value, NPVariant *result);
-void convertValueToNPVariant(KJS::ExecState *exec, KJS::ValueImp *value, NPVariant *result);
-KJS::ValueImp *convertNPVariantToValue(KJS::ExecState *exec, const NPVariant *variant);
+void coerceValueToNPVariantStringType(KJS::ExecState *exec, KJS::JSValue *value, NPVariant *result);
+void convertValueToNPVariant(KJS::ExecState *exec, KJS::JSValue *value, NPVariant *result);
+KJS::JSValue *convertNPVariantToValue(KJS::ExecState *exec, const NPVariant *variant);
typedef struct
{
1.33 +9 -9 JavaScriptCore/bindings/jni/jni_instance.cpp
Index: jni_instance.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/jni/jni_instance.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- jni_instance.cpp 11 Dec 2005 00:37:47 -0000 1.32
+++ jni_instance.cpp 11 Dec 2005 02:05:35 -0000 1.33
@@ -74,7 +74,7 @@
return _class;
}
-ValueImp *JavaInstance::stringValue() const
+JSValue *JavaInstance::stringValue() const
{
jstring stringValue = (jstring)callJNIObjectMethod (_instance->_instance, "toString", "()Ljava/lang/String;");
JNIEnv *env = getJNIEnv();
@@ -84,23 +84,23 @@
return jsString(u);
}
-ValueImp *JavaInstance::numberValue() const
+JSValue *JavaInstance::numberValue() const
{
jdouble doubleValue = callJNIDoubleMethod (_instance->_instance, "doubleValue", "()D");
return jsNumber(doubleValue);
}
-ValueImp *JavaInstance::booleanValue() const
+JSValue *JavaInstance::booleanValue() const
{
jboolean booleanValue = callJNIBooleanMethod (_instance->_instance, "booleanValue", "()Z");
return jsBoolean(booleanValue);
}
-ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodList, const List &args)
+JSValue *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodList, const List &args)
{
int i, count = args.size();
jvalue *jArgs;
- ValueImp *resultValue;
+ JSValue *resultValue;
Method *method = 0;
unsigned int numMethods = methodList.length();
@@ -148,7 +148,7 @@
bool handled = false;
if (execContext && execContext->nativeHandle()) {
jobject obj = _instance->_instance;
- ValueImp *exceptionDescription = NULL;
+ JSValue *exceptionDescription = NULL;
const char *callingURL = 0; // FIXME, need to propagate calling URL to Java
handled = dispatchJNICall (execContext->nativeHandle(), obj, jMethod->isStatic(), jMethod->JNIReturnType(), jMethod->methodID(obj), jArgs, result, callingURL, exceptionDescription);
if (exceptionDescription) {
@@ -294,13 +294,13 @@
return resultValue;
}
-ValueImp *JavaInstance::invokeDefaultMethod (ExecState *exec, const List &args)
+JSValue *JavaInstance::invokeDefaultMethod (ExecState *exec, const List &args)
{
return jsUndefined();
}
-ValueImp *JavaInstance::defaultValue (Type hint) const
+JSValue *JavaInstance::defaultValue (Type hint) const
{
if (hint == StringType) {
return stringValue();
@@ -327,7 +327,7 @@
return valueOf();
}
-ValueImp *JavaInstance::valueOf() const
+JSValue *JavaInstance::valueOf() const
{
return stringValue();
};
1.20 +7 -7 JavaScriptCore/bindings/jni/jni_instance.h
Index: jni_instance.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/jni/jni_instance.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- jni_instance.h 10 Aug 2005 20:51:00 -0000 1.19
+++ jni_instance.h 11 Dec 2005 02:05:35 -0000 1.20
@@ -73,17 +73,17 @@
virtual void begin();
virtual void end();
- virtual ValueImp *valueOf() const;
- virtual ValueImp *defaultValue (Type hint) const;
+ virtual JSValue *valueOf() const;
+ virtual JSValue *defaultValue (Type hint) const;
- virtual ValueImp *invokeMethod (ExecState *exec, const MethodList &method, const List &args);
- virtual ValueImp *invokeDefaultMethod (ExecState *exec, const List &args);
+ virtual JSValue *invokeMethod (ExecState *exec, const MethodList &method, const List &args);
+ virtual JSValue *invokeDefaultMethod (ExecState *exec, const List &args);
jobject javaInstance() const { return _instance->_instance; }
- ValueImp *stringValue() const;
- ValueImp *numberValue() const;
- ValueImp *booleanValue() const;
+ JSValue *stringValue() const;
+ JSValue *numberValue() const;
+ JSValue *booleanValue() const;
private:
JavaInstance (); // prevent default construction
1.18 +63 -63 JavaScriptCore/bindings/jni/jni_jsobject.cpp
Index: jni_jsobject.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/jni/jni_jsobject.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- jni_jsobject.cpp 11 Dec 2005 00:37:47 -0000 1.17
+++ jni_jsobject.cpp 11 Dec 2005 02:05:36 -0000 1.18
@@ -56,7 +56,7 @@
return (RootObject::runLoop() == CFRunLoopGetCurrent());
}
-jvalue JSObject::invoke (JSObjectCallContext *context)
+jvalue JavaJSObject::invoke (JSObjectCallContext *context)
{
jvalue result;
@@ -75,10 +75,10 @@
}
if (context->type == CreateNative) {
- result.j = JSObject::createNative(nativeHandle);
+ result.j = JavaJSObject::createNative(nativeHandle);
}
else {
- ObjectImp *imp = jlong_to_impptr(nativeHandle);
+ JSObject *imp = jlong_to_impptr(nativeHandle);
if (!rootForImp(imp)) {
fprintf (stderr, "%s:%d: Attempt to access JavaScript from destroyed applet, type %d.\n", __FILE__, __LINE__, context->type);
return result;
@@ -86,54 +86,54 @@
switch (context->type){
case Call: {
- result.l = JSObject(nativeHandle).call(context->string, context->args);
+ result.l = JavaJSObject(nativeHandle).call(context->string, context->args);
break;
}
case Eval: {
- result.l = JSObject(nativeHandle).eval(context->string);
+ result.l = JavaJSObject(nativeHandle).eval(context->string);
break;
}
case GetMember: {
- result.l = JSObject(nativeHandle).getMember(context->string);
+ result.l = JavaJSObject(nativeHandle).getMember(context->string);
break;
}
case SetMember: {
- JSObject(nativeHandle).setMember(context->string, context->value);
+ JavaJSObject(nativeHandle).setMember(context->string, context->value);
break;
}
case RemoveMember: {
- JSObject(nativeHandle).removeMember(context->string);
+ JavaJSObject(nativeHandle).removeMember(context->string);
break;
}
case GetSlot: {
- result.l = JSObject(nativeHandle).getSlot(context->index);
+ result.l = JavaJSObject(nativeHandle).getSlot(context->index);
break;
}
case SetSlot: {
- JSObject(nativeHandle).setSlot(context->index, context->value);
+ JavaJSObject(nativeHandle).setSlot(context->index, context->value);
break;
}
case ToString: {
- result.l = (jobject) JSObject(nativeHandle).toString();
+ result.l = (jobject) JavaJSObject(nativeHandle).toString();
break;
}
case Finalize: {
- ObjectImp *imp = jlong_to_impptr(nativeHandle);
+ JSObject *imp = jlong_to_impptr(nativeHandle);
if (findReferenceDictionary(imp) == 0) {
// We may have received a finalize method call from the VM
// AFTER removing our last reference to the Java instance.
JS_LOG ("finalize called on instance we have already removed.\n");
}
else {
- JSObject(nativeHandle).finalize();
+ JavaJSObject(nativeHandle).finalize();
}
break;
}
@@ -150,11 +150,11 @@
}
-JSObject::JSObject(jlong nativeJSObject)
+JavaJSObject::JavaJSObject(jlong nativeJSObject)
{
_imp = jlong_to_impptr(nativeJSObject);
- // If we are unable to cast the nativeJSObject to an ObjectImp something is
+ // If we are unable to cast the nativeJSObject to an JSObject something is
// terribly wrong.
assert (_imp != 0);
@@ -165,7 +165,7 @@
}
-jobject JSObject::call(jstring methodName, jobjectArray args) const
+jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
{
JS_LOG ("methodName = %s\n", JavaString(methodName).UTF8String());
@@ -174,27 +174,27 @@
JSLock lock;
Identifier identifier(JavaString(methodName).ustring());
- ValueImp *func = _imp->get (exec, identifier);
+ JSValue *func = _imp->get (exec, identifier);
if (func->isUndefinedOrNull()) {
// Maybe throw an exception here?
return 0;
}
// Call the function object.
- ObjectImp *funcImp = static_cast<ObjectImp*>(func);
- ObjectImp *thisObj = const_cast<ObjectImp*>(_imp);
+ JSObject *funcImp = static_cast<JSObject*>(func);
+ JSObject *thisObj = const_cast<JSObject*>(_imp);
List argList = listFromJArray(args);
- ValueImp *result = funcImp->call(exec, thisObj, argList);
+ JSValue *result = funcImp->call(exec, thisObj, argList);
return convertValueToJObject(result);
}
-jobject JSObject::eval(jstring script) const
+jobject JavaJSObject::eval(jstring script) const
{
JS_LOG ("script = %s\n", JavaString(script).UTF8String());
- ObjectImp *thisObj = const_cast<ObjectImp*>(_imp);
- ValueImp *result;
+ JSObject *thisObj = const_cast<JSObject*>(_imp);
+ JSValue *result;
JSLock lock;
@@ -211,19 +211,19 @@
return convertValueToJObject (result);
}
-jobject JSObject::getMember(jstring memberName) const
+jobject JavaJSObject::getMember(jstring memberName) const
{
JS_LOG ("(%p) memberName = %s\n", _imp, JavaString(memberName).UTF8String());
ExecState *exec = _root->interpreter()->globalExec();
JSLock lock;
- ValueImp *result = _imp->get (exec, Identifier (JavaString(memberName).ustring()));
+ JSValue *result = _imp->get (exec, Identifier (JavaString(memberName).ustring()));
return convertValueToJObject(result);
}
-void JSObject::setMember(jstring memberName, jobject value) const
+void JavaJSObject::setMember(jstring memberName, jobject value) const
{
JS_LOG ("memberName = %s, value = %p\n", JavaString(memberName).UTF8String(), value);
ExecState *exec = _root->interpreter()->globalExec();
@@ -232,7 +232,7 @@
}
-void JSObject::removeMember(jstring memberName) const
+void JavaJSObject::removeMember(jstring memberName) const
{
JS_LOG ("memberName = %s\n", JavaString(memberName).UTF8String());
@@ -242,20 +242,20 @@
}
-jobject JSObject::getSlot(jint index) const
+jobject JavaJSObject::getSlot(jint index) const
{
JS_LOG ("index = %ld\n", index);
ExecState *exec = _root->interpreter()->globalExec();
JSLock lock;
- ValueImp *result = _imp->get (exec, (unsigned)index);
+ JSValue *result = _imp->get (exec, (unsigned)index);
return convertValueToJObject(result);
}
-void JSObject::setSlot(jint index, jobject value) const
+void JavaJSObject::setSlot(jint index, jobject value) const
{
JS_LOG ("index = %ld, value = %p\n", index, value);
@@ -265,27 +265,27 @@
}
-jstring JSObject::toString() const
+jstring JavaJSObject::toString() const
{
JS_LOG ("\n");
JSLock lock;
- ObjectImp *thisObj = const_cast<ObjectImp*>(_imp);
+ JSObject *thisObj = const_cast<JSObject*>(_imp);
ExecState *exec = _root->interpreter()->globalExec();
return (jstring)convertValueToJValue (exec, thisObj, object_type, "java.lang.String").l;
}
-void JSObject::finalize() const
+void JavaJSObject::finalize() const
{
JS_LOG ("\n");
removeNativeReference (_imp);
}
-// We're either creating a 'Root' object (via a call to JSObject.getWindow()), or
-// another JSObject.
-jlong JSObject::createNative(jlong nativeHandle)
+// We're either creating a 'Root' object (via a call to JavaJSObject.getWindow()), or
+// another JavaJSObject.
+jlong JavaJSObject::createNative(jlong nativeHandle)
{
JS_LOG ("nativeHandle = %d\n", (int)nativeHandle);
@@ -298,9 +298,9 @@
FindRootObjectForNativeHandleFunctionPtr aFunc = RootObject::findRootObjectForNativeHandleFunction();
if (aFunc) {
Bindings::RootObject *root = aFunc(jlong_to_ptr(nativeHandle));
- // If root is !NULL We must have been called via netscape.javascript.JSObject.getWindow(),
- // otherwise we are being called after creating a JSObject in
- // JSObject::convertValueToJObject().
+ // If root is !NULL We must have been called via netscape.javascript.JavaJSObject.getWindow(),
+ // otherwise we are being called after creating a JavaJSObject in
+ // JavaJSObject::convertValueToJObject().
if (root) {
addNativeReference (root, root->rootObjectImp());
return ptr_to_jlong(root->rootObjectImp());
@@ -313,7 +313,7 @@
return ptr_to_jlong(0);
}
-jobject JSObject::convertValueToJObject (ValueImp *value) const
+jobject JavaJSObject::convertValueToJObject (JSValue *value) const
{
ExecState *exec = _root->interpreter()->globalExec();
JNIEnv *env = getJNIEnv();
@@ -325,7 +325,7 @@
// string -> java.lang.String
// boolean -> java.lang.Boolean
// Java instance -> Java instance
- // Everything else -> JSObject
+ // Everything else -> JavaJSObject
Type type = value->type();
if (type == NumberType) {
@@ -348,15 +348,15 @@
}
}
else {
- // Create a JSObject.
+ // Create a JavaJSObject.
jlong nativeHandle;
if (type == ObjectType){
- ObjectImp *imp = static_cast<ObjectImp*>(value);
+ JSObject *imp = static_cast<JSObject*>(value);
// We either have a wrapper around a Java instance or a JavaScript
// object. If we have a wrapper around a Java instance, return that
- // instance, otherwise create a new Java JSObject with the ObjectImp*
+ // instance, otherwise create a new Java JavaJSObject with the JSObject*
// as it's nativeHandle.
if (imp->classInfo() && strcmp(imp->classInfo()->className, "RuntimeObject") == 0) {
RuntimeObjectImp *runtimeImp = static_cast<RuntimeObjectImp*>(value);
@@ -376,15 +376,15 @@
nativeHandle = UndefinedHandle;
}
- // Now create the Java JSObject. Look for the JSObject in it's new (Tiger)
+ // Now create the Java JavaJSObject. Look for the JavaJSObject in it's new (Tiger)
// location and in the original Java 1.4.2 location.
jclass JSObjectClass;
- JSObjectClass = env->FindClass ("sun/plugin/javascript/webkit/JSObject");
+ JSObjectClass = env->FindClass ("sun/plugin/javascript/webkit/JavaJSObject");
if (!JSObjectClass) {
env->ExceptionDescribe();
env->ExceptionClear();
- JSObjectClass = env->FindClass ("apple/applet/JSObject");
+ JSObjectClass = env->FindClass ("apple/applet/JavaJSObject");
}
jmethodID constructorID = env->GetMethodID (JSObjectClass, "<init>", "(J)V");
@@ -396,9 +396,9 @@
return result;
}
-ValueImp *JSObject::convertJObjectToValue (jobject theObject) const
+JSValue *JavaJSObject::convertJObjectToValue (jobject theObject) const
{
- // Instances of netscape.javascript.JSObject get converted back to
+ // Instances of netscape.javascript.JavaJSObject get converted back to
// JavaScript objects. All other objects are wrapped. It's not
// possible to pass primitive types from the Java to JavaScript.
// See section 22.7 of 'JavaScript: The Definitive Guide, 4th Edition',
@@ -406,9 +406,9 @@
jobject classOfInstance = callJNIObjectMethod(theObject, "getClass", "()Ljava/lang/Class;");
jstring className = (jstring)callJNIObjectMethod(classOfInstance, "getName", "()Ljava/lang/String;");
- if (strcmp(Bindings::JavaString(className).UTF8String(), "netscape.javascript.JSObject") == 0) {
+ if (strcmp(Bindings::JavaString(className).UTF8String(), "netscape.javascript.JavaJSObject") == 0) {
// Pull the nativeJSObject value from the Java instance. This is a
- // pointer to the ObjectImp.
+ // pointer to the JSObject.
JNIEnv *env = getJNIEnv();
jfieldID fieldID = env->GetFieldID((jclass)classOfInstance, "nativeJSObject", "int");
if (fieldID == NULL) {
@@ -418,7 +418,7 @@
if (nativeHandle == UndefinedHandle) {
return jsUndefined();
}
- ObjectImp *imp = static_cast<ObjectImp*>(jlong_to_impptr(nativeHandle));
+ JSObject *imp = static_cast<JSObject*>(jlong_to_impptr(nativeHandle));
return imp;
}
@@ -428,7 +428,7 @@
return newImp;
}
-List JSObject::listFromJArray(jobjectArray jArray) const
+List JavaJSObject::listFromJArray(jobjectArray jArray) const
{
JNIEnv *env = getJNIEnv();
int i, numObjects = jArray ? env->GetArrayLength (jArray) : 0;
@@ -455,7 +455,7 @@
JSObjectCallContext context;
context.type = CreateNative;
context.nativeHandle = nativeHandle;
- return JSObject::invoke (&context).j;
+ return JavaJSObject::invoke (&context).j;
}
void KJS_JSObject_JSFinalize (JNIEnv *env, jclass jsClass, jlong nativeHandle)
@@ -463,7 +463,7 @@
JSObjectCallContext context;
context.type = Finalize;
context.nativeHandle = nativeHandle;
- JSObject::invoke (&context);
+ JavaJSObject::invoke (&context);
}
jobject KJS_JSObject_JSObjectCall (JNIEnv *env, jclass jsClass, jlong nativeHandle, jstring jurl, jstring methodName, jobjectArray args, jboolean ctx)
@@ -473,7 +473,7 @@
context.nativeHandle = nativeHandle;
context.string = methodName;
context.args = args;
- return JSObject::invoke (&context).l;
+ return JavaJSObject::invoke (&context).l;
}
jobject KJS_JSObject_JSObjectEval (JNIEnv *env, jclass jsClass, jlong nativeHandle, jstring jurl, jstring jscript, jboolean ctx)
@@ -482,7 +482,7 @@
context.type = Eval;
context.nativeHandle = nativeHandle;
context.string = jscript;
- return JSObject::invoke (&context).l;
+ return JavaJSObject::invoke (&context).l;
}
jobject KJS_JSObject_JSObjectGetMember (JNIEnv *env, jclass jsClass, jlong nativeHandle, jstring jurl, jstring jname, jboolean ctx)
@@ -491,7 +491,7 @@
context.type = GetMember;
context.nativeHandle = nativeHandle;
context.string = jname;
- return JSObject::invoke (&context).l;
+ return JavaJSObject::invoke (&context).l;
}
void KJS_JSObject_JSObjectSetMember (JNIEnv *env, jclass jsClass, jlong nativeHandle, jstring jurl, jstring jname, jobject value, jboolean ctx)
@@ -501,7 +501,7 @@
context.nativeHandle = nativeHandle;
context.string = jname;
context.value = value;
- JSObject::invoke (&context);
+ JavaJSObject::invoke (&context);
}
void KJS_JSObject_JSObjectRemoveMember (JNIEnv *env, jclass jsClass, jlong nativeHandle, jstring jurl, jstring jname, jboolean ctx)
@@ -510,7 +510,7 @@
context.type = RemoveMember;
context.nativeHandle = nativeHandle;
context.string = jname;
- JSObject::invoke (&context);
+ JavaJSObject::invoke (&context);
}
jobject KJS_JSObject_JSObjectGetSlot (JNIEnv *env, jclass jsClass, jlong nativeHandle, jstring jurl, jint jindex, jboolean ctx)
@@ -519,7 +519,7 @@
context.type = GetSlot;
context.nativeHandle = nativeHandle;
context.index = jindex;
- return JSObject::invoke (&context).l;
+ return JavaJSObject::invoke (&context).l;
}
void KJS_JSObject_JSObjectSetSlot (JNIEnv *env, jclass jsClass, jlong nativeHandle, jstring jurl, jint jindex, jobject value, jboolean ctx)
@@ -529,7 +529,7 @@
context.nativeHandle = nativeHandle;
context.index = jindex;
context.value = value;
- JSObject::invoke (&context);
+ JavaJSObject::invoke (&context);
}
jstring KJS_JSObject_JSObjectToString (JNIEnv *env, jclass clazz, jlong nativeHandle)
@@ -537,7 +537,7 @@
JSObjectCallContext context;
context.type = ToString;
context.nativeHandle = nativeHandle;
- return (jstring)JSObject::invoke (&context).l;
+ return (jstring)JavaJSObject::invoke (&context).l;
}
}
1.5 +7 -7 JavaScriptCore/bindings/jni/jni_jsobject.h
Index: jni_jsobject.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/jni/jni_jsobject.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- jni_jsobject.h 8 Aug 2005 04:07:24 -0000 1.4
+++ jni_jsobject.h 11 Dec 2005 02:05:36 -0000 1.5
@@ -33,7 +33,7 @@
#include <JavaVM/jni.h>
#define jlong_to_ptr(a) ((void*)(uintptr_t)(a))
-#define jlong_to_impptr(a) (static_cast<KJS::ObjectImp*>(((void*)(uintptr_t)(a))))
+#define jlong_to_impptr(a) (static_cast<KJS::JSObject*>(((void*)(uintptr_t)(a))))
#define ptr_to_jlong(a) ((jlong)(uintptr_t)(a))
namespace KJS {
@@ -70,10 +70,10 @@
typedef struct JSObjectCallContext JSObjectCallContext;
-class JSObject
+class JavaJSObject
{
public:
- JSObject(jlong nativeHandle);
+ JavaJSObject(jlong nativeHandle);
static jlong createNative(jlong nativeHandle);
jobject call(jstring methodName, jobjectArray args) const;
@@ -88,13 +88,13 @@
static jvalue invoke (JSObjectCallContext *context);
- jobject convertValueToJObject (ValueImp *value) const;
- ValueImp *convertJObjectToValue (jobject theObject) const;
+ jobject convertValueToJObject (JSValue *value) const;
+ JSValue *convertJObjectToValue (jobject theObject) const;
List listFromJArray(jobjectArray jArray) const;
private:
const RootObject *_root;
- ObjectImp *_imp;
+ JSObject *_imp;
};
@@ -104,7 +104,7 @@
extern "C" {
-// Functions called from the Java VM when making calls to the JSObject class.
+// Functions called from the Java VM when making calls to the JavaJSObject class.
jlong KJS_JSCreateNativeJSObject (JNIEnv *env, jclass clazz, jstring jurl, jlong nativeHandle, jboolean ctx);
void KJS_JSObject_JSFinalize (JNIEnv *env, jclass jsClass, jlong nativeJSObject);
jobject KJS_JSObject_JSObjectCall (JNIEnv *env, jclass jsClass, jlong nativeJSObject, jstring jurl, jstring methodName, jobjectArray args, jboolean ctx);
1.6 +1 -1 JavaScriptCore/bindings/jni/jni_objc.mm
Index: jni_objc.mm
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/jni/jni_objc.mm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- jni_objc.mm 3 Oct 2005 21:11:45 -0000 1.5
+++ jni_objc.mm 11 Dec 2005 02:05:36 -0000 1.6
@@ -44,7 +44,7 @@
- (NSURL *)_webViewURL;
@end
-bool KJS::Bindings::dispatchJNICall (const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, ValueImp *&exceptionDescription)
+bool KJS::Bindings::dispatchJNICall (const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, JSValue *&exceptionDescription)
{
id view = (id)targetAppletView;
1.32 +9 -9 JavaScriptCore/bindings/jni/jni_runtime.cpp
Index: jni_runtime.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/jni/jni_runtime.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- jni_runtime.cpp 11 Dec 2005 00:37:48 -0000 1.31
+++ jni_runtime.cpp 11 Dec 2005 02:05:36 -0000 1.32
@@ -68,12 +68,12 @@
_field = new JavaInstance(aField, 0);
}
-ValueImp *JavaArray::convertJObjectToArray (ExecState *exec, jobject anObject, const char *type, const RootObject *r)
+JSValue *JavaArray::convertJObjectToArray (ExecState *exec, jobject anObject, const char *type, const RootObject *r)
{
if (type[0] != '[')
return jsUndefined();
- return new RuntimeArrayImp(exec, new JavaArray((jobject)anObject, type, r));
+ return new RuntimeArray(exec, new JavaArray((jobject)anObject, type, r));
}
jvalue JavaField::dispatchValueFromInstance(ExecState *exec, const JavaInstance *instance, const char *name, const char *sig, JNIType returnType) const
@@ -91,7 +91,7 @@
{
const RootObject *execContext = instance->executionContext();
if (execContext && execContext->nativeHandle()) {
- ValueImp *exceptionDescription = NULL;
+ JSValue *exceptionDescription = NULL;
jvalue args[1];
args[0].l = jinstance;
@@ -104,11 +104,11 @@
return result;
}
-ValueImp *JavaField::valueFromInstance(ExecState *exec, const Instance *i) const
+JSValue *JavaField::valueFromInstance(ExecState *exec, const Instance *i) const
{
const JavaInstance *instance = static_cast<const JavaInstance *>(i);
- ValueImp *jsresult = jsUndefined();
+ JSValue *jsresult = jsUndefined();
switch (_JNIType) {
case object_type: {
@@ -172,7 +172,7 @@
{
const RootObject *execContext = instance->executionContext();
if (execContext && execContext->nativeHandle()) {
- ValueImp *exceptionDescription = NULL;
+ JSValue *exceptionDescription = NULL;
jvalue args[2];
jvalue result;
@@ -186,7 +186,7 @@
}
}
-void JavaField::setValueToInstance(ExecState *exec, const Instance *i, ValueImp *aValue) const
+void JavaField::setValueToInstance(ExecState *exec, const Instance *i, JSValue *aValue) const
{
const JavaInstance *instance = static_cast<const JavaInstance *>(i);
jvalue javaValue = convertValueToJValue (exec, aValue, _JNIType, type());
@@ -388,7 +388,7 @@
_type = strdup(other._type);
};
-void JavaArray::setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const
+void JavaArray::setValueAt(ExecState *exec, unsigned int index, JSValue *aValue) const
{
JNIEnv *env = getJNIEnv();
char *javaClassName = 0;
@@ -456,7 +456,7 @@
}
-ValueImp *JavaArray::valueAt(ExecState *exec, unsigned int index) const
+JSValue *JavaArray::valueAt(ExecState *exec, unsigned int index) const
{
JNIEnv *env = getJNIEnv();
JNIType arrayType = JNITypeFromPrimitiveType(_type[1]);
1.28 +5 -5 JavaScriptCore/bindings/jni/jni_runtime.h
Index: jni_runtime.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/jni/jni_runtime.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- jni_runtime.h 16 Sep 2005 22:42:28 -0000 1.27
+++ jni_runtime.h 11 Dec 2005 02:05:36 -0000 1.28
@@ -181,8 +181,8 @@
return *this;
}
- virtual ValueImp *valueFromInstance(ExecState *exec, const Instance *instance) const;
- virtual void setValueToInstance(ExecState *exec, const Instance *instance, ValueImp *aValue) const;
+ virtual JSValue *valueFromInstance(ExecState *exec, const Instance *instance) const;
+ virtual void setValueToInstance(ExecState *exec, const Instance *instance, JSValue *aValue) const;
virtual const char *name() const { return _name.UTF8String(); }
virtual RuntimeType type() const { return _type.UTF8String(); }
@@ -290,15 +290,15 @@
return *this;
};
- virtual void setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const;
- virtual ValueImp *valueAt(ExecState *exec, unsigned int index) const;
+ virtual void setValueAt(ExecState *exec, unsigned int index, JSValue *aValue) const;
+ virtual JSValue *valueAt(ExecState *exec, unsigned int index) const;
virtual unsigned int getLength() const;
virtual ~JavaArray();
jobject javaArray() const { return _array->_instance; }
- static ValueImp *convertJObjectToArray (ExecState *exec, jobject anObject, const char *type, const RootObject *r);
+ static JSValue *convertJObjectToArray (ExecState *exec, jobject anObject, const char *type, const RootObject *r);
const RootObject *executionContext() const { return _root; }
1.27 +4 -4 JavaScriptCore/bindings/jni/jni_utility.cpp
Index: jni_utility.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/jni/jni_utility.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- jni_utility.cpp 3 Oct 2005 21:11:45 -0000 1.26
+++ jni_utility.cpp 11 Dec 2005 02:05:36 -0000 1.27
@@ -711,7 +711,7 @@
return result;
}
-jvalue convertValueToJValue (ExecState *exec, ValueImp *value, JNIType _JNIType, const char *javaClassName)
+jvalue convertValueToJValue (ExecState *exec, JSValue *value, JNIType _JNIType, const char *javaClassName)
{
jvalue result;
@@ -721,14 +721,14 @@
// First see if we have a Java instance.
if (value->isObject()){
- ObjectImp *objectImp = static_cast<ObjectImp*>(value);
+ JSObject *objectImp = static_cast<JSObject*>(value);
if (objectImp->classInfo() == &RuntimeObjectImp::info) {
RuntimeObjectImp *imp = static_cast<RuntimeObjectImp *>(value);
JavaInstance *instance = static_cast<JavaInstance*>(imp->getInternalInstance());
result.l = instance->javaInstance();
}
- else if (objectImp->classInfo() == &RuntimeArrayImp::info) {
- RuntimeArrayImp *imp = static_cast<RuntimeArrayImp *>(value);
+ else if (objectImp->classInfo() == &RuntimeArray::info) {
+ RuntimeArray *imp = static_cast<RuntimeArray *>(value);
JavaArray *array = static_cast<JavaArray*>(imp->getConcreteArray());
result.l = array->javaArray();
}
1.19 +2 -2 JavaScriptCore/bindings/jni/jni_utility.h
Index: jni_utility.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/jni/jni_utility.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- jni_utility.h 8 Aug 2005 04:07:24 -0000 1.18
+++ jni_utility.h 11 Dec 2005 02:05:36 -0000 1.19
@@ -63,7 +63,7 @@
JNIType JNITypeFromPrimitiveType(char type);
const char *signatureFromPrimitiveType(JNIType type);
-jvalue convertValueToJValue(ExecState *exec, ValueImp *value, JNIType _JNIType, const char *javaClassName);
+jvalue convertValueToJValue(ExecState *exec, JSValue *value, JNIType _JNIType, const char *javaClassName);
jvalue getJNIField(jobject obj, JNIType type, const char *name, const char *signature);
@@ -106,7 +106,7 @@
JavaVM *getJavaVM();
JNIEnv *getJNIEnv();
-bool dispatchJNICall(const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, ValueImp *&exceptionDescription);
+bool dispatchJNICall(const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, JSValue *&exceptionDescription);
} // namespace Bindings
1.29 +20 -20 JavaScriptCore/bindings/objc/WebScriptObject.mm
Index: WebScriptObject.mm
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/WebScriptObject.mm,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- WebScriptObject.mm 11 Dec 2005 00:37:49 -0000 1.28
+++ WebScriptObject.mm 11 Dec 2005 02:05:38 -0000 1.29
@@ -63,10 +63,10 @@
ExecState *exec = [obj _executionContext]->interpreter()->globalExec();
KJSDidExecuteFunctionPtr func = Instance::didExecuteFunction();
if (func)
- func (exec, static_cast<ObjectImp*>([obj _executionContext]->rootObjectImp()));
+ func (exec, static_cast<JSObject*>([obj _executionContext]->rootObjectImp()));
}
-- (void)_initializeWithObjectImp:(ObjectImp *)imp originExecutionContext:(const RootObject *)originExecutionContext executionContext:(const RootObject *)executionContext
+- (void)_initializeWithObjectImp:(JSObject *)imp originExecutionContext:(const RootObject *)originExecutionContext executionContext:(const RootObject *)executionContext
{
_private->imp = imp;
_private->executionContext = executionContext;
@@ -75,7 +75,7 @@
addNativeReference (executionContext, imp);
}
-- _initWithObjectImp:(ObjectImp *)imp originExecutionContext:(const RootObject *)originExecutionContext executionContext:(const RootObject *)executionContext
+- _initWithJSObject:(JSObject *)imp originExecutionContext:(const RootObject *)originExecutionContext executionContext:(const RootObject *)executionContext
{
assert (imp != 0);
//assert (root != 0);
@@ -89,7 +89,7 @@
return self;
}
-- (ObjectImp *)_imp
+- (JSObject *)_imp
{
if (!_private->imp && _private->isCreatedByDOMWrapper) {
// Associate the WebScriptObject with the JS wrapper for the ObjC DOM
@@ -193,9 +193,9 @@
JSLock lock;
- ValueImp *v = convertObjcValueToValue(exec, &name, ObjcObjectType);
+ JSValue *v = convertObjcValueToValue(exec, &name, ObjcObjectType);
Identifier identifier(v->toString(exec));
- ValueImp *func = [self _imp]->get (exec, identifier);
+ JSValue *func = [self _imp]->get (exec, identifier);
if (!func || func->isUndefined()) {
// Maybe throw an exception here?
@@ -203,10 +203,10 @@
}
// Call the function object.
- ObjectImp *funcImp = static_cast<ObjectImp*>(func);
- ObjectImp *thisObj = const_cast<ObjectImp*>([self _imp]);
+ JSObject *funcImp = static_cast<JSObject*>(func);
+ JSObject *thisObj = const_cast<JSObject*>([self _imp]);
List argList = listFromNSArray(exec, args);
- ValueImp *result = funcImp->call (exec, thisObj, argList);
+ JSValue *result = funcImp->call (exec, thisObj, argList);
if (exec->hadException()) {
LOG_EXCEPTION (exec);
@@ -230,11 +230,11 @@
return nil;
ExecState *exec = [self _executionContext]->interpreter()->globalExec();
- ValueImp *result;
+ JSValue *result;
JSLock lock;
- ValueImp *v = convertObjcValueToValue(exec, &script, ObjcObjectType);
+ JSValue *v = convertObjcValueToValue(exec, &script, ObjcObjectType);
Completion completion = [self _executionContext]->interpreter()->evaluate(UString(), 0, v->toString(exec));
ComplType type = completion.complType();
@@ -268,7 +268,7 @@
ExecState *exec = [self _executionContext]->interpreter()->globalExec();
JSLock lock;
- ValueImp *v = convertObjcValueToValue(exec, &key, ObjcObjectType);
+ JSValue *v = convertObjcValueToValue(exec, &key, ObjcObjectType);
[self _imp]->put (exec, Identifier (v->toString(exec)), (convertObjcValueToValue(exec, &value, ObjcObjectType)));
if (exec->hadException()) {
@@ -289,8 +289,8 @@
ExecState *exec = [self _executionContext]->interpreter()->globalExec();
JSLock lock;
- ValueImp *v = convertObjcValueToValue(exec, &key, ObjcObjectType);
- ValueImp *result = [self _imp]->get (exec, Identifier (v->toString(exec)));
+ JSValue *v = convertObjcValueToValue(exec, &key, ObjcObjectType);
+ JSValue *result = [self _imp]->get (exec, Identifier (v->toString(exec)));
if (exec->hadException()) {
LOG_EXCEPTION (exec);
@@ -315,7 +315,7 @@
ExecState *exec = [self _executionContext]->interpreter()->globalExec();
JSLock lock;
- ValueImp *v = convertObjcValueToValue(exec, &key, ObjcObjectType);
+ JSValue *v = convertObjcValueToValue(exec, &key, ObjcObjectType);
[self _imp]->deleteProperty (exec, Identifier (v->toString(exec)));
if (exec->hadException()) {
@@ -332,7 +332,7 @@
return @"Undefined";
JSLock lock;
- ObjectImp *thisObj = const_cast<ObjectImp*>([self _imp]);
+ JSObject *thisObj = const_cast<JSObject*>([self _imp]);
ExecState *exec = [self _executionContext]->interpreter()->globalExec();
id result = convertValueToObjcValue(exec, thisObj, ObjcObjectType).objectValue;
@@ -354,7 +354,7 @@
ExecState *exec = [self _executionContext]->interpreter()->globalExec();
JSLock lock;
- ValueImp *result = [self _imp]->get (exec, (unsigned)index);
+ JSValue *result = [self _imp]->get (exec, (unsigned)index);
if (exec->hadException()) {
LOG_EXCEPTION (exec);
@@ -393,17 +393,17 @@
throwError(root->interpreter()->globalExec(), GeneralError, description);
}
-+ (id)_convertValueToObjcValue:(ValueImp *)value originExecutionContext:(const RootObject *)originExecutionContext executionContext:(const RootObject *)executionContext
++ (id)_convertValueToObjcValue:(JSValue *)value originExecutionContext:(const RootObject *)originExecutionContext executionContext:(const RootObject *)executionContext
{
// First see if we have a ObjC instance.
if (value->isObject()) {
- ObjectImp *objectImp = static_cast<ObjectImp*>(value);
+ JSObject *objectImp = static_cast<JSObject*>(value);
Interpreter *intepreter = executionContext->interpreter();
ExecState *exec = intepreter->globalExec();
JSLock lock;
if (objectImp->classInfo() != &RuntimeObjectImp::info) {
- ValueImp *runtimeObject = objectImp->get(exec, "__apple_runtime_object");
+ JSValue *runtimeObject = objectImp->get(exec, "__apple_runtime_object");
if (runtimeObject && runtimeObject->isObject())
objectImp = static_cast<RuntimeObjectImp*>(runtimeObject);
}
1.9 +5 -5 JavaScriptCore/bindings/objc/WebScriptObjectPrivate.h
Index: WebScriptObjectPrivate.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/WebScriptObjectPrivate.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- WebScriptObjectPrivate.h 8 Aug 2005 04:07:26 -0000 1.8
+++ WebScriptObjectPrivate.h 11 Dec 2005 02:05:38 -0000 1.9
@@ -13,12 +13,12 @@
#include <JavaScriptCore/value.h>
@interface WebScriptObject (Private)
-+ (id)_convertValueToObjcValue:(KJS::ValueImp *)value originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext;
++ (id)_convertValueToObjcValue:(KJS::JSValue *)value originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext;
- _init;
-- _initWithObjectImp:(KJS::ObjectImp *)imp originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext ;
-- (void)_initializeWithObjectImp:(KJS::ObjectImp *)imp originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext ;
+- _initWithJSObject:(KJS::JSObject *)imp originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext ;
+- (void)_initializeWithObjectImp:(KJS::JSObject *)imp originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext ;
- (void)_initializeScriptDOMNodeImp;
-- (KJS::ObjectImp *)_imp;
+- (KJS::JSObject *)_imp;
- (void)_setExecutionContext:(const KJS::Bindings::RootObject *)context;
- (const KJS::Bindings::RootObject *)_executionContext;
- (void)_setOriginExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext;
@@ -28,7 +28,7 @@
@interface WebScriptObjectPrivate : NSObject
{
@public
- KJS::ObjectImp *imp;
+ KJS::JSObject *imp;
const KJS::Bindings::RootObject *executionContext;
const KJS::Bindings::RootObject *originExecutionContext;
BOOL isCreatedByDOMWrapper;
1.7 +1 -1 JavaScriptCore/bindings/objc/objc_class.h
Index: objc_class.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_class.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- objc_class.h 16 Sep 2005 22:42:29 -0000 1.6
+++ objc_class.h 11 Dec 2005 02:05:38 -0000 1.7
@@ -68,7 +68,7 @@
virtual MethodList methodsNamed(const char *name, Instance *instance) const;
virtual Field *fieldNamed(const char *name, Instance *instance) const;
- virtual ValueImp *fallbackObject(ExecState *exec, Instance *instance, const Identifier &propertyName);
+ virtual JSValue *fallbackObject(ExecState *exec, Instance *instance, const Identifier &propertyName);
virtual Constructor *constructorAt(int i) const { return 0; }
virtual int numConstructors() const { return 0; }
1.13 +1 -1 JavaScriptCore/bindings/objc/objc_class.mm
Index: objc_class.mm
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_class.mm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- objc_class.mm 6 Nov 2005 06:20:43 -0000 1.12
+++ objc_class.mm 11 Dec 2005 02:05:38 -0000 1.13
@@ -234,7 +234,7 @@
return aField;
}
-ValueImp *ObjcClass::fallbackObject (ExecState *exec, Instance *instance, const Identifier &propertyName)
+JSValue *ObjcClass::fallbackObject (ExecState *exec, Instance *instance, const Identifier &propertyName)
{
ObjcInstance * objcInstance = static_cast<ObjcInstance*>(instance);
id targetObject = objcInstance->getObject();
1.9 +11 -11 JavaScriptCore/bindings/objc/objc_instance.h
Index: objc_instance.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_instance.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- objc_instance.h 16 Sep 2005 22:42:29 -0000 1.8
+++ objc_instance.h 11 Dec 2005 02:05:38 -0000 1.9
@@ -53,24 +53,24 @@
virtual void begin();
virtual void end();
- virtual ValueImp *valueOf() const;
- virtual ValueImp *defaultValue (Type hint) const;
+ virtual JSValue *valueOf() const;
+ virtual JSValue *defaultValue (Type hint) const;
- virtual ValueImp *invokeMethod (ExecState *exec, const MethodList &method, const List &args);
- virtual ValueImp *invokeDefaultMethod (ExecState *exec, const List &args);
+ virtual JSValue *invokeMethod (ExecState *exec, const MethodList &method, const List &args);
+ virtual JSValue *invokeDefaultMethod (ExecState *exec, const List &args);
- virtual void setValueOfField (ExecState *exec, const Field *aField, ValueImp *aValue) const;
+ virtual void setValueOfField (ExecState *exec, const Field *aField, JSValue *aValue) const;
virtual bool supportsSetValueOfUndefinedField ();
- virtual void setValueOfUndefinedField (ExecState *exec, const Identifier &property, ValueImp *aValue);
+ virtual void setValueOfUndefinedField (ExecState *exec, const Identifier &property, JSValue *aValue);
- virtual ValueImp *ObjcInstance::getValueOfField (ExecState *exec, const Field *aField) const;
- virtual ValueImp *getValueOfUndefinedField (ExecState *exec, const Identifier &property, Type hint) const;
+ virtual JSValue *ObjcInstance::getValueOfField (ExecState *exec, const Field *aField) const;
+ virtual JSValue *getValueOfUndefinedField (ExecState *exec, const Identifier &property, Type hint) const;
ObjectStructPtr getObject() const { return _instance; }
- ValueImp *stringValue() const;
- ValueImp *numberValue() const;
- ValueImp *booleanValue() const;
+ JSValue *stringValue() const;
+ JSValue *numberValue() const;
+ JSValue *booleanValue() const;
private:
ObjectStructPtr _instance;
1.17 +17 -17 JavaScriptCore/bindings/objc/objc_instance.mm
Index: objc_instance.mm
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_instance.mm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- objc_instance.mm 11 Dec 2005 00:37:49 -0000 1.16
+++ objc_instance.mm 11 Dec 2005 02:05:39 -0000 1.17
@@ -123,9 +123,9 @@
return static_cast<Bindings::Class*>(_class);
}
-ValueImp *ObjcInstance::invokeMethod (ExecState *exec, const MethodList &methodList, const List &args)
+JSValue *ObjcInstance::invokeMethod (ExecState *exec, const MethodList &methodList, const List &args)
{
- ValueImp *resultValue;
+ JSValue *resultValue;
// Overloading methods is not allowed in ObjectiveC. Should only be one
// name match for a particular method.
@@ -143,7 +143,7 @@
if (method->isFallbackMethod()) {
if (objcValueTypeForType([signature methodReturnType]) != ObjcObjectType) {
NSLog(@"Incorrect signature for invokeUndefinedMethodFromWebScript:withArguments: -- return type must be object.");
- NS_VALUERETURN(jsUndefined(), ValueImp *);
+ NS_VALUERETURN(jsUndefined(), JSValue *);
}
// Invoke invokeUndefinedMethodFromWebScript:withArguments:, pass JavaScript function
@@ -239,14 +239,14 @@
return resultValue;
}
-ValueImp *ObjcInstance::invokeDefaultMethod (ExecState *exec, const List &args)
+JSValue *ObjcInstance::invokeDefaultMethod (ExecState *exec, const List &args)
{
- ValueImp *resultValue;
+ JSValue *resultValue;
NS_DURING
if (![_instance respondsToSelector:@selector(invokeDefaultMethodWithArguments:)])
- NS_VALUERETURN(jsUndefined(), ValueImp *);
+ NS_VALUERETURN(jsUndefined(), JSValue *);
NSMethodSignature *signature = [_instance methodSignatureForSelector:@selector(invokeDefaultMethodWithArguments:)];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
@@ -256,7 +256,7 @@
if (objcValueTypeForType([signature methodReturnType]) != ObjcObjectType) {
NSLog(@"Incorrect signature for invokeDefaultMethodWithArguments: -- return type must be object.");
- NS_VALUERETURN(jsUndefined(), ValueImp *);
+ NS_VALUERETURN(jsUndefined(), JSValue *);
}
NSMutableArray *objcArgs = [NSMutableArray array];
@@ -290,7 +290,7 @@
return resultValue;
}
-void ObjcInstance::setValueOfField (ExecState *exec, const Field *aField, ValueImp *aValue) const
+void ObjcInstance::setValueOfField (ExecState *exec, const Field *aField, JSValue *aValue) const
{
aField->setValueToInstance (exec, this, aValue);
}
@@ -305,7 +305,7 @@
return false;
}
-void ObjcInstance::setValueOfUndefinedField (ExecState *exec, const Identifier &property, ValueImp *aValue)
+void ObjcInstance::setValueOfUndefinedField (ExecState *exec, const Identifier &property, JSValue *aValue)
{
id targetObject = getObject();
@@ -328,13 +328,13 @@
}
}
-ValueImp *ObjcInstance::getValueOfField (ExecState *exec, const Field *aField) const {
+JSValue *ObjcInstance::getValueOfField (ExecState *exec, const Field *aField) const {
return aField->valueFromInstance (exec, this);
}
-ValueImp *ObjcInstance::getValueOfUndefinedField (ExecState *exec, const Identifier &property, Type hint) const
+JSValue *ObjcInstance::getValueOfUndefinedField (ExecState *exec, const Identifier &property, Type hint) const
{
- ValueImp *volatile result = jsUndefined();
+ JSValue *volatile result = jsUndefined();
id targetObject = getObject();
@@ -360,7 +360,7 @@
return result;
}
-ValueImp *ObjcInstance::defaultValue (Type hint) const
+JSValue *ObjcInstance::defaultValue (Type hint) const
{
if (hint == StringType) {
return stringValue();
@@ -386,24 +386,24 @@
return valueOf();
}
-ValueImp *ObjcInstance::stringValue() const
+JSValue *ObjcInstance::stringValue() const
{
return convertNSStringToString ([getObject() description]);
}
-ValueImp *ObjcInstance::numberValue() const
+JSValue *ObjcInstance::numberValue() const
{
// FIXME: Implement something sensible
return jsNumber(0);
}
-ValueImp *ObjcInstance::booleanValue() const
+JSValue *ObjcInstance::booleanValue() const
{
// FIXME: Implement something sensible
return jsBoolean(false);
}
-ValueImp *ObjcInstance::valueOf() const
+JSValue *ObjcInstance::valueOf() const
{
return stringValue();
}
1.16 +10 -10 JavaScriptCore/bindings/objc/objc_runtime.h
Index: objc_runtime.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_runtime.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- objc_runtime.h 16 Sep 2005 22:42:29 -0000 1.15
+++ objc_runtime.h 11 Dec 2005 02:05:39 -0000 1.16
@@ -79,8 +79,8 @@
return *this;
}
- virtual ValueImp *valueFromInstance(ExecState *exec, const Instance *instance) const;
- virtual void setValueToInstance(ExecState *exec, const Instance *instance, ValueImp *aValue) const;
+ virtual JSValue *valueFromInstance(ExecState *exec, const Instance *instance) const;
+ virtual void setValueToInstance(ExecState *exec, const Instance *instance, JSValue *aValue) const;
virtual const char *name() const;
virtual RuntimeType type() const;
@@ -142,32 +142,32 @@
virtual ~ObjcArray();
- virtual void setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const;
- virtual ValueImp *valueAt(ExecState *exec, unsigned int index) const;
+ virtual void setValueAt(ExecState *exec, unsigned int index, JSValue *aValue) const;
+ virtual JSValue *valueAt(ExecState *exec, unsigned int index) const;
virtual unsigned int getLength() const;
ObjectStructPtr getObjcArray() const { return _array; }
- static ValueImp *convertObjcArrayToArray(ExecState *exec, ObjectStructPtr anObject);
+ static JSValue *convertObjcArrayToArray(ExecState *exec, ObjectStructPtr anObject);
private:
ObjectStructPtr _array;
};
-class ObjcFallbackObjectImp : public ObjectImp {
+class ObjcFallbackObjectImp : public JSObject {
public:
- ObjcFallbackObjectImp(ObjectImp *proto);
+ ObjcFallbackObjectImp(JSObject *proto);
ObjcFallbackObjectImp(ObjcInstance *i, const Identifier propertyName);
const ClassInfo *classInfo() const { return &info; }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
virtual bool canPut(ExecState *exec, const Identifier &propertyName) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
- virtual ValueImp *defaultValue(ExecState *exec, Type hint) const;
+ virtual JSValue *defaultValue(ExecState *exec, Type hint) const;
virtual Type type() const;
virtual bool toBoolean(ExecState *exec) const;
1.24 +13 -13 JavaScriptCore/bindings/objc/objc_runtime.mm
Index: objc_runtime.mm
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_runtime.mm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- objc_runtime.mm 11 Dec 2005 00:37:49 -0000 1.23
+++ objc_runtime.mm 11 Dec 2005 02:05:39 -0000 1.24
@@ -103,9 +103,9 @@
return "";
}
-ValueImp *ObjcField::valueFromInstance(ExecState *exec, const Instance *instance) const
+JSValue *ObjcField::valueFromInstance(ExecState *exec, const Instance *instance) const
{
- ValueImp *aValue;
+ JSValue *aValue;
id targetObject = (static_cast<const ObjcInstance*>(instance))->getObject();
id objcValue = nil;
@@ -128,7 +128,7 @@
return aValue;
}
-static id convertValueToObjcObject (ExecState *exec, ValueImp *value)
+static id convertValueToObjcObject (ExecState *exec, JSValue *value)
{
const Bindings::RootObject *root = rootForInterpreter(exec->interpreter());
if (!root) {
@@ -140,7 +140,7 @@
}
-void ObjcField::setValueToInstance(ExecState *exec, const Instance *instance, ValueImp *aValue) const
+void ObjcField::setValueToInstance(ExecState *exec, const Instance *instance, JSValue *aValue) const
{
id targetObject = (static_cast<const ObjcInstance*>(instance))->getObject();
id value = convertValueToObjcObject(exec, aValue);
@@ -185,7 +185,7 @@
return *this;
}
-void ObjcArray::setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const
+void ObjcArray::setValueAt(ExecState *exec, unsigned int index, JSValue *aValue) const
{
if (![_array respondsToSelector:@selector(insertObject:atIndex:)]) {
throwError(exec, TypeError, "Array is not mutable.");
@@ -213,13 +213,13 @@
}
-ValueImp *ObjcArray::valueAt(ExecState *exec, unsigned int index) const
+JSValue *ObjcArray::valueAt(ExecState *exec, unsigned int index) const
{
if (index > [_array count])
return throwError(exec, RangeError, "Index exceeds array size.");
ObjectStructPtr obj = 0;
- ObjectImp * volatile error;
+ JSObject * volatile error;
volatile bool haveError = false;
NS_DURING
@@ -247,8 +247,8 @@
const ClassInfo ObjcFallbackObjectImp::info = {"ObjcFallbackObject", 0, 0, 0};
-ObjcFallbackObjectImp::ObjcFallbackObjectImp(ObjectImp *proto)
- : ObjectImp(proto)
+ObjcFallbackObjectImp::ObjcFallbackObjectImp(JSObject *proto)
+ : JSObject(proto)
{
_instance = 0;
}
@@ -267,7 +267,7 @@
}
void ObjcFallbackObjectImp::put(ExecState *exec, const Identifier &propertyName,
- ValueImp *value, int attr)
+ JSValue *value, int attr)
{
}
@@ -297,9 +297,9 @@
return false;
}
-ValueImp *ObjcFallbackObjectImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *ObjcFallbackObjectImp::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
- ValueImp *result = jsUndefined();
+ JSValue *result = jsUndefined();
RuntimeObjectImp *imp = static_cast<RuntimeObjectImp*>(thisObj);
if (imp) {
@@ -332,7 +332,7 @@
return false;
}
-ValueImp *ObjcFallbackObjectImp::defaultValue(ExecState *exec, Type hint) const
+JSValue *ObjcFallbackObjectImp::defaultValue(ExecState *exec, Type hint) const
{
return _instance->getValueOfUndefinedField(exec, _item, hint);
}
1.7 +5 -5 JavaScriptCore/bindings/objc/objc_utility.h
Index: objc_utility.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_utility.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- objc_utility.h 16 Aug 2005 00:47:23 -0000 1.6
+++ objc_utility.h 11 Dec 2005 02:05:39 -0000 1.7
@@ -65,16 +65,16 @@
class RootObject;
-ObjcValue convertValueToObjcValue(ExecState *exec, ValueImp *value, ObjcValueType type);
-ValueImp *convertNSStringToString(NSString *nsstring);
-ValueImp *convertObjcValueToValue(ExecState *exec, void *buffer, ObjcValueType type);
+ObjcValue convertValueToObjcValue(ExecState *exec, JSValue *value, ObjcValueType type);
+JSValue *convertNSStringToString(NSString *nsstring);
+JSValue *convertObjcValueToValue(ExecState *exec, void *buffer, ObjcValueType type);
ObjcValueType objcValueTypeForType(const char *type);
void JSMethodNameToObjCMethodName(const char *name, char *name, unsigned int length);
-void *createObjcInstanceForValue(ValueImp *value, const RootObject *origin, const RootObject *current);
+void *createObjcInstanceForValue(JSValue *value, const RootObject *origin, const RootObject *current);
-ObjectImp *throwError(ExecState *, ErrorType, NSString *message);
+JSObject *throwError(ExecState *, ErrorType, NSString *message);
} // namespace Bindings
} // namespace KJS
1.23 +11 -11 JavaScriptCore/bindings/objc/objc_utility.mm
Index: objc_utility.mm
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_utility.mm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- objc_utility.mm 11 Dec 2005 00:37:49 -0000 1.22
+++ objc_utility.mm 11 Dec 2005 02:05:39 -0000 1.23
@@ -89,7 +89,7 @@
[], other exception
*/
-ObjcValue convertValueToObjcValue (ExecState *exec, ValueImp *value, ObjcValueType type)
+ObjcValue convertValueToObjcValue (ExecState *exec, JSValue *value, ObjcValueType type)
{
ObjcValue result;
double d = 0;
@@ -166,14 +166,14 @@
return result;
}
-ValueImp *convertNSStringToString(NSString *nsstring)
+JSValue *convertNSStringToString(NSString *nsstring)
{
unichar *chars;
unsigned int length = [nsstring length];
chars = (unichar *)malloc(sizeof(unichar)*length);
[nsstring getCharacters:chars];
UString u((const UChar*)chars, length);
- ValueImp *aValue = jsString(u);
+ JSValue *aValue = jsString(u);
free((void *)chars);
return aValue;
}
@@ -194,9 +194,9 @@
other should not happen
*/
-ValueImp *convertObjcValueToValue (ExecState *exec, void *buffer, ObjcValueType type)
+JSValue *convertObjcValueToValue (ExecState *exec, void *buffer, ObjcValueType type)
{
- ValueImp *aValue = NULL;
+ JSValue *aValue = NULL;
switch (type) {
case ObjcObjectType:
@@ -220,7 +220,7 @@
} else if ([*obj isKindOfClass:[NSNumber class]]) {
aValue = jsNumber([*obj doubleValue]);
} else if ([*obj isKindOfClass:[NSArray class]]) {
- aValue = new RuntimeArrayImp(exec, new ObjcArray(*obj));
+ aValue = new RuntimeArray(exec, new ObjcArray(*obj));
} else if ([*obj isKindOfClass:[WebScriptObject class]]) {
WebScriptObject *jsobject = (WebScriptObject *)*obj;
aValue = [jsobject _imp];
@@ -307,21 +307,21 @@
}
-void *createObjcInstanceForValue(ValueImp *value, const RootObject *origin, const RootObject *current)
+void *createObjcInstanceForValue(JSValue *value, const RootObject *origin, const RootObject *current)
{
if (!value->isObject())
return 0;
- ObjectImp *object = static_cast<ObjectImp *>(value);
- return [[[WebScriptObject alloc] _initWithObjectImp:object originExecutionContext:origin executionContext:current] autorelease];
+ JSObject *object = static_cast<JSObject *>(value);
+ return [[[WebScriptObject alloc] _initWithJSObject:object originExecutionContext:origin executionContext:current] autorelease];
}
-ObjectImp *throwError(ExecState *exec, ErrorType type, NSString *message)
+JSObject *throwError(ExecState *exec, ErrorType type, NSString *message)
{
assert(message);
size_t length = [message length];
unichar *buffer = new unichar[length];
[message getCharacters:buffer];
- ObjectImp *error = throwError(exec, type, UString(reinterpret_cast<UChar *>(buffer), length));
+ JSObject *error = throwError(exec, type, UString(reinterpret_cast<UChar *>(buffer), length));
delete [] buffer;
return error;
}
1.19 +9 -9 JavaScriptCore/kjs/array_instance.h
Index: array_instance.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/array_instance.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- array_instance.h 16 Oct 2005 00:46:21 -0000 1.18
+++ array_instance.h 11 Dec 2005 02:05:41 -0000 1.19
@@ -27,16 +27,16 @@
namespace KJS {
- class ArrayInstanceImp : public ObjectImp {
+ class ArrayInstance : public JSObject {
public:
- ArrayInstanceImp(ObjectImp *proto, unsigned initialLength);
- ArrayInstanceImp(ObjectImp *proto, const List &initialValues);
- ~ArrayInstanceImp();
+ ArrayInstance(JSObject *proto, unsigned initialLength);
+ ArrayInstance(JSObject *proto, const List &initialValues);
+ ~ArrayInstance();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState *, unsigned, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- virtual void put(ExecState *exec, unsigned propertyName, ValueImp *value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ virtual void put(ExecState *exec, unsigned propertyName, JSValue *value, int attr = None);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
virtual ReferenceList propList(ExecState *exec, bool recursive);
@@ -49,10 +49,10 @@
unsigned getLength() const { return length; }
void sort(ExecState *exec);
- void sort(ExecState *exec, ObjectImp *compareFunction);
+ void sort(ExecState *exec, JSObject *compareFunction);
private:
- static ValueImp *lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
void setLength(unsigned newLength, ExecState *exec);
@@ -63,7 +63,7 @@
unsigned length;
unsigned storageLength;
unsigned capacity;
- ValueImp **storage;
+ JSValue **storage;
};
} // namespace KJS
1.57 +124 -124 JavaScriptCore/kjs/array_object.cpp
Index: array_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/array_object.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- array_object.cpp 11 Dec 2005 00:37:50 -0000 1.56
+++ array_object.cpp 11 Dec 2005 02:05:41 -0000 1.57
@@ -40,27 +40,27 @@
using namespace KJS;
-// ------------------------------ ArrayInstanceImp -----------------------------
+// ------------------------------ ArrayInstance -----------------------------
const unsigned sparseArrayCutoff = 10000;
-const ClassInfo ArrayInstanceImp::info = {"Array", 0, 0, 0};
+const ClassInfo ArrayInstance::info = {"Array", 0, 0, 0};
-ArrayInstanceImp::ArrayInstanceImp(ObjectImp *proto, unsigned initialLength)
- : ObjectImp(proto)
+ArrayInstance::ArrayInstance(JSObject *proto, unsigned initialLength)
+ : JSObject(proto)
, length(initialLength)
, storageLength(initialLength < sparseArrayCutoff ? initialLength : 0)
, capacity(storageLength)
- , storage(capacity ? (ValueImp **)fastCalloc(capacity, sizeof(ValueImp *)) : 0)
+ , storage(capacity ? (JSValue **)fastCalloc(capacity, sizeof(JSValue *)) : 0)
{
}
-ArrayInstanceImp::ArrayInstanceImp(ObjectImp *proto, const List &list)
- : ObjectImp(proto)
+ArrayInstance::ArrayInstance(JSObject *proto, const List &list)
+ : JSObject(proto)
, length(list.size())
, storageLength(length)
, capacity(storageLength)
- , storage(capacity ? (ValueImp **)fastMalloc(sizeof(ValueImp *) * capacity) : 0)
+ , storage(capacity ? (JSValue **)fastMalloc(sizeof(JSValue *) * capacity) : 0)
{
ListIterator it = list.begin();
unsigned l = length;
@@ -69,17 +69,17 @@
}
}
-ArrayInstanceImp::~ArrayInstanceImp()
+ArrayInstance::~ArrayInstance()
{
fastFree(storage);
}
-ValueImp *ArrayInstanceImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *ArrayInstance::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
- return jsNumber(static_cast<ArrayInstanceImp *>(slot.slotBase())->length);
+ return jsNumber(static_cast<ArrayInstance *>(slot.slotBase())->length);
}
-bool ArrayInstanceImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool ArrayInstance::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
if (propertyName == lengthPropertyName) {
slot.setCustom(this, lengthGetter);
@@ -92,7 +92,7 @@
if (index >= length)
return false;
if (index < storageLength) {
- ValueImp *v = storage[index];
+ JSValue *v = storage[index];
if (!v || v->isUndefined())
return false;
slot.setValueSlot(this, &storage[index]);
@@ -100,26 +100,26 @@
}
}
- return ObjectImp::getOwnPropertySlot(exec, propertyName, slot);
+ return JSObject::getOwnPropertySlot(exec, propertyName, slot);
}
-bool ArrayInstanceImp::getOwnPropertySlot(ExecState *exec, unsigned index, PropertySlot& slot)
+bool ArrayInstance::getOwnPropertySlot(ExecState *exec, unsigned index, PropertySlot& slot)
{
if (index >= length)
return false;
if (index < storageLength) {
- ValueImp *v = storage[index];
+ JSValue *v = storage[index];
if (!v || v->isUndefined())
return false;
slot.setValueSlot(this, &storage[index]);
return true;
}
- return ObjectImp::getOwnPropertySlot(exec, index, slot);
+ return JSObject::getOwnPropertySlot(exec, index, slot);
}
// Special implementation of [[Put]] - see ECMA 15.4.5.1
-void ArrayInstanceImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void ArrayInstance::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
if (propertyName == lengthPropertyName) {
setLength(value->toUInt32(exec), exec);
@@ -133,10 +133,10 @@
return;
}
- ObjectImp::put(exec, propertyName, value, attr);
+ JSObject::put(exec, propertyName, value, attr);
}
-void ArrayInstanceImp::put(ExecState *exec, unsigned index, ValueImp *value, int attr)
+void ArrayInstance::put(ExecState *exec, unsigned index, JSValue *value, int attr)
{
if (index < sparseArrayCutoff && index >= storageLength) {
resizeStorage(index + 1);
@@ -152,10 +152,10 @@
}
assert(index >= sparseArrayCutoff);
- ObjectImp::put(exec, Identifier::from(index), value, attr);
+ JSObject::put(exec, Identifier::from(index), value, attr);
}
-bool ArrayInstanceImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
+bool ArrayInstance::deleteProperty(ExecState *exec, const Identifier &propertyName)
{
if (propertyName == lengthPropertyName)
return false;
@@ -171,10 +171,10 @@
}
}
- return ObjectImp::deleteProperty(exec, propertyName);
+ return JSObject::deleteProperty(exec, propertyName);
}
-bool ArrayInstanceImp::deleteProperty(ExecState *exec, unsigned index)
+bool ArrayInstance::deleteProperty(ExecState *exec, unsigned index)
{
if (index >= length)
return true;
@@ -183,18 +183,18 @@
return true;
}
- return ObjectImp::deleteProperty(exec, Identifier::from(index));
+ return JSObject::deleteProperty(exec, Identifier::from(index));
}
-ReferenceList ArrayInstanceImp::propList(ExecState *exec, bool recursive)
+ReferenceList ArrayInstance::propList(ExecState *exec, bool recursive)
{
- ReferenceList properties = ObjectImp::propList(exec,recursive);
+ ReferenceList properties = JSObject::propList(exec,recursive);
// avoid fetching this every time through the loop
- ValueImp *undefined = jsUndefined();
+ JSValue *undefined = jsUndefined();
for (unsigned i = 0; i < storageLength; ++i) {
- ValueImp *imp = storage[i];
+ JSValue *imp = storage[i];
if (imp && imp != undefined) {
properties.append(Reference(this, i));
}
@@ -202,10 +202,10 @@
return properties;
}
-void ArrayInstanceImp::resizeStorage(unsigned newLength)
+void ArrayInstance::resizeStorage(unsigned newLength)
{
if (newLength < storageLength) {
- memset(storage + newLength, 0, sizeof(ValueImp *) * (storageLength - newLength));
+ memset(storage + newLength, 0, sizeof(JSValue *) * (storageLength - newLength));
}
if (newLength > capacity) {
unsigned newCapacity;
@@ -217,14 +217,14 @@
newCapacity = sparseArrayCutoff;
}
}
- storage = (ValueImp **)fastRealloc(storage, newCapacity * sizeof (ValueImp *));
- memset(storage + capacity, 0, sizeof(ValueImp *) * (newCapacity - capacity));
+ storage = (JSValue **)fastRealloc(storage, newCapacity * sizeof (JSValue *));
+ memset(storage + capacity, 0, sizeof(JSValue *) * (newCapacity - capacity));
capacity = newCapacity;
}
storageLength = newLength;
}
-void ArrayInstanceImp::setLength(unsigned newLength, ExecState *exec)
+void ArrayInstance::setLength(unsigned newLength, ExecState *exec)
{
if (newLength <= storageLength) {
resizeStorage(newLength);
@@ -249,12 +249,12 @@
length = newLength;
}
-void ArrayInstanceImp::mark()
+void ArrayInstance::mark()
{
- ObjectImp::mark();
+ JSObject::mark();
unsigned l = storageLength;
for (unsigned i = 0; i < l; ++i) {
- ValueImp *imp = storage[i];
+ JSValue *imp = storage[i];
if (imp && !imp->marked())
imp->mark();
}
@@ -265,8 +265,8 @@
static int compareByStringForQSort(const void *a, const void *b)
{
ExecState *exec = execForCompareByStringForQSort;
- ValueImp *va = *(ValueImp **)a;
- ValueImp *vb = *(ValueImp **)b;
+ JSValue *va = *(JSValue **)a;
+ JSValue *vb = *(JSValue **)b;
if (va->isUndefined()) {
return vb->isUndefined() ? 0 : 1;
}
@@ -276,17 +276,17 @@
return compare(va->toString(exec), vb->toString(exec));
}
-void ArrayInstanceImp::sort(ExecState *exec)
+void ArrayInstance::sort(ExecState *exec)
{
int lengthNotIncludingUndefined = pushUndefinedObjectsToEnd(exec);
execForCompareByStringForQSort = exec;
- qsort(storage, lengthNotIncludingUndefined, sizeof(ValueImp *), compareByStringForQSort);
+ qsort(storage, lengthNotIncludingUndefined, sizeof(JSValue *), compareByStringForQSort);
execForCompareByStringForQSort = 0;
}
struct CompareWithCompareFunctionArguments {
- CompareWithCompareFunctionArguments(ExecState *e, ObjectImp *cf)
+ CompareWithCompareFunctionArguments(ExecState *e, JSObject *cf)
: exec(e)
, compareFunction(cf)
, globalObject(e->dynamicInterpreter()->globalObject())
@@ -296,9 +296,9 @@
}
ExecState *exec;
- ObjectImp *compareFunction;
+ JSObject *compareFunction;
List arguments;
- ObjectImp *globalObject;
+ JSObject *globalObject;
};
static CompareWithCompareFunctionArguments *compareWithCompareFunctionArguments;
@@ -307,8 +307,8 @@
{
CompareWithCompareFunctionArguments *args = compareWithCompareFunctionArguments;
- ValueImp *va = *(ValueImp **)a;
- ValueImp *vb = *(ValueImp **)b;
+ JSValue *va = *(JSValue **)a;
+ JSValue *vb = *(JSValue **)b;
if (va->isUndefined()) {
return vb->isUndefined() ? 0 : 1;
}
@@ -324,24 +324,24 @@
return compareResult < 0 ? -1 : compareResult > 0 ? 1 : 0;
}
-void ArrayInstanceImp::sort(ExecState *exec, ObjectImp *compareFunction)
+void ArrayInstance::sort(ExecState *exec, JSObject *compareFunction)
{
int lengthNotIncludingUndefined = pushUndefinedObjectsToEnd(exec);
CompareWithCompareFunctionArguments args(exec, compareFunction);
compareWithCompareFunctionArguments = &args;
- qsort(storage, lengthNotIncludingUndefined, sizeof(ValueImp *), compareWithCompareFunctionForQSort);
+ qsort(storage, lengthNotIncludingUndefined, sizeof(JSValue *), compareWithCompareFunctionForQSort);
compareWithCompareFunctionArguments = 0;
}
-unsigned ArrayInstanceImp::pushUndefinedObjectsToEnd(ExecState *exec)
+unsigned ArrayInstance::pushUndefinedObjectsToEnd(ExecState *exec)
{
- ValueImp *undefined = jsUndefined();
+ JSValue *undefined = jsUndefined();
unsigned o = 0;
for (unsigned i = 0; i != storageLength; ++i) {
- ValueImp *v = storage[i];
+ JSValue *v = storage[i];
if (v && v != undefined) {
if (o != i)
storage[o] = v;
@@ -361,69 +361,69 @@
while (it != sparseProperties.end()) {
Reference ref = it++;
storage[o] = ref.getValue(exec);
- ObjectImp::deleteProperty(exec, ref.getPropertyName(exec));
+ JSObject::deleteProperty(exec, ref.getPropertyName(exec));
o++;
}
if (newLength != storageLength)
- memset(storage + o, 0, sizeof(ValueImp *) * (storageLength - o));
+ memset(storage + o, 0, sizeof(JSValue *) * (storageLength - o));
return o;
}
-// ------------------------------ ArrayPrototypeImp ----------------------------
+// ------------------------------ ArrayPrototype ----------------------------
-const ClassInfo ArrayPrototypeImp::info = {"Array", &ArrayInstanceImp::info, &arrayTable, 0};
+const ClassInfo ArrayPrototype::info = {"Array", &ArrayInstance::info, &arrayTable, 0};
/* Source for array_object.lut.h
@begin arrayTable 16
- toString ArrayProtoFuncImp::ToString DontEnum|Function 0
- toLocaleString ArrayProtoFuncImp::ToLocaleString DontEnum|Function 0
- concat ArrayProtoFuncImp::Concat DontEnum|Function 1
- join ArrayProtoFuncImp::Join DontEnum|Function 1
- pop ArrayProtoFuncImp::Pop DontEnum|Function 0
- push ArrayProtoFuncImp::Push DontEnum|Function 1
- reverse ArrayProtoFuncImp::Reverse DontEnum|Function 0
- shift ArrayProtoFuncImp::Shift DontEnum|Function 0
- slice ArrayProtoFuncImp::Slice DontEnum|Function 2
- sort ArrayProtoFuncImp::Sort DontEnum|Function 1
- splice ArrayProtoFuncImp::Splice DontEnum|Function 2
- unshift ArrayProtoFuncImp::UnShift DontEnum|Function 1
- every ArrayProtoFuncImp::Every DontEnum|Function 5
- forEach ArrayProtoFuncImp::ForEach DontEnum|Function 5
- some ArrayProtoFuncImp::Some DontEnum|Function 5
+ toString ArrayProtoFunc::ToString DontEnum|Function 0
+ toLocaleString ArrayProtoFunc::ToLocaleString DontEnum|Function 0
+ concat ArrayProtoFunc::Concat DontEnum|Function 1
+ join ArrayProtoFunc::Join DontEnum|Function 1
+ pop ArrayProtoFunc::Pop DontEnum|Function 0
+ push ArrayProtoFunc::Push DontEnum|Function 1
+ reverse ArrayProtoFunc::Reverse DontEnum|Function 0
+ shift ArrayProtoFunc::Shift DontEnum|Function 0
+ slice ArrayProtoFunc::Slice DontEnum|Function 2
+ sort ArrayProtoFunc::Sort DontEnum|Function 1
+ splice ArrayProtoFunc::Splice DontEnum|Function 2
+ unshift ArrayProtoFunc::UnShift DontEnum|Function 1
+ every ArrayProtoFunc::Every DontEnum|Function 5
+ forEach ArrayProtoFunc::ForEach DontEnum|Function 5
+ some ArrayProtoFunc::Some DontEnum|Function 5
@end
*/
// ECMA 15.4.4
-ArrayPrototypeImp::ArrayPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objProto)
- : ArrayInstanceImp(objProto, 0)
+ArrayPrototype::ArrayPrototype(ExecState *exec,
+ ObjectPrototype *objProto)
+ : ArrayInstance(objProto, 0)
{
setInternalValue(jsNull());
}
-bool ArrayPrototypeImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool ArrayPrototype::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
- return getStaticFunctionSlot<ArrayProtoFuncImp, ArrayInstanceImp>(exec, &arrayTable, this, propertyName, slot);
+ return getStaticFunctionSlot<ArrayProtoFunc, ArrayInstance>(exec, &arrayTable, this, propertyName, slot);
}
-// ------------------------------ ArrayProtoFuncImp ----------------------------
+// ------------------------------ ArrayProtoFunc ----------------------------
-ArrayProtoFuncImp::ArrayProtoFuncImp(ExecState *exec, int i, int len)
+ArrayProtoFunc::ArrayProtoFunc(ExecState *exec, int i, int len)
: InternalFunctionImp(
- static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
+ static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
), id(i)
{
put(exec,lengthPropertyName,jsNumber(len),DontDelete|ReadOnly|DontEnum);
}
-bool ArrayProtoFuncImp::implementsCall() const
+bool ArrayProtoFunc::implementsCall() const
{
return true;
}
-static ValueImp *getProperty(ExecState *exec, ObjectImp *obj, unsigned index)
+static JSValue *getProperty(ExecState *exec, JSObject *obj, unsigned index)
{
PropertySlot slot;
if (!obj->getPropertySlot(exec, index, slot))
@@ -432,22 +432,22 @@
}
// ECMA 15.4.4
-ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *ArrayProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
unsigned length = thisObj->get(exec,lengthPropertyName)->toUInt32(exec);
- ValueImp *result = 0; // work around gcc 4.0 bug in uninitialized variable warning
+ JSValue *result = 0; // work around gcc 4.0 bug in uninitialized variable warning
switch (id) {
case ToLocaleString:
case ToString:
- if (!thisObj->inherits(&ArrayInstanceImp::info))
+ if (!thisObj->inherits(&ArrayInstance::info))
return throwError(exec, TypeError);
// fall through
case Join: {
- static HashSet< ObjectImp*, PointerHash<ObjectImp*> > visitedElems;
+ static HashSet< JSObject*, PointerHash<JSObject*> > visitedElems;
if (visitedElems.contains(thisObj))
return jsString("");
UString separator = ",";
@@ -460,16 +460,16 @@
if (k >= 1)
str += separator;
- ValueImp *element = thisObj->get(exec, k);
+ JSValue *element = thisObj->get(exec, k);
if (element->isUndefinedOrNull())
continue;
bool fallback = false;
if (id == ToLocaleString) {
- ObjectImp *o = element->toObject(exec);
- ValueImp *conversionFunction = o->get(exec, toLocaleStringPropertyName);
- if (conversionFunction->isObject() && static_cast<ObjectImp *>(conversionFunction)->implementsCall()) {
- str += static_cast<ObjectImp *>(conversionFunction)->call(exec, o, List())->toString(exec);
+ JSObject *o = element->toObject(exec);
+ JSValue *conversionFunction = o->get(exec, toLocaleStringPropertyName);
+ if (conversionFunction->isObject() && static_cast<JSObject *>(conversionFunction)->implementsCall()) {
+ str += static_cast<JSObject *>(conversionFunction)->call(exec, o, List())->toString(exec);
} else {
// try toString() fallback
fallback = true;
@@ -478,10 +478,10 @@
if (id == ToString || id == Join || fallback) {
if (element->isObject()) {
- ObjectImp *o = static_cast<ObjectImp *>(element);
- ValueImp *conversionFunction = o->get(exec, toStringPropertyName);
- if (conversionFunction->isObject() && static_cast<ObjectImp *>(conversionFunction)->implementsCall()) {
- str += static_cast<ObjectImp *>(conversionFunction)->call(exec, o, List())->toString(exec);
+ JSObject *o = static_cast<JSObject *>(element);
+ JSValue *conversionFunction = o->get(exec, toStringPropertyName);
+ if (conversionFunction->isObject() && static_cast<JSObject *>(conversionFunction)->implementsCall()) {
+ str += static_cast<JSObject *>(conversionFunction)->call(exec, o, List())->toString(exec);
} else {
return throwError(exec, RangeError, "Can't convert " + o->className() + " object to string");
}
@@ -498,20 +498,20 @@
break;
}
case Concat: {
- ObjectImp *arr = static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
+ JSObject *arr = static_cast<JSObject *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
int n = 0;
- ValueImp *curArg = thisObj;
- ObjectImp *curObj = static_cast<ObjectImp *>(thisObj);
+ JSValue *curArg = thisObj;
+ JSObject *curObj = static_cast<JSObject *>(thisObj);
ListIterator it = args.begin();
for (;;) {
if (curArg->isObject() &&
- curObj->inherits(&ArrayInstanceImp::info)) {
+ curObj->inherits(&ArrayInstance::info)) {
unsigned int k = 0;
// Older versions tried to optimize out getting the length of thisObj
// by checking for n != 0, but that doesn't work if thisObj is an empty array.
length = curObj->get(exec,lengthPropertyName)->toUInt32(exec);
while (k < length) {
- if (ValueImp *v = getProperty(exec, curObj, k))
+ if (JSValue *v = getProperty(exec, curObj, k))
arr->put(exec, n, v);
n++;
k++;
@@ -523,7 +523,7 @@
if (it == args.end())
break;
curArg = *it;
- curObj = static_cast<ObjectImp *>(it++); // may be 0
+ curObj = static_cast<JSObject *>(it++); // may be 0
}
arr->put(exec,lengthPropertyName, jsNumber(n), DontEnum | DontDelete);
@@ -554,8 +554,8 @@
for (unsigned int k = 0; k < middle; k++) {
unsigned lk1 = length - k - 1;
- ValueImp *obj2 = getProperty(exec, thisObj, lk1);
- ValueImp *obj = getProperty(exec, thisObj, k);
+ JSValue *obj2 = getProperty(exec, thisObj, lk1);
+ JSValue *obj = getProperty(exec, thisObj, k);
if (obj2)
thisObj->put(exec, k, obj2);
@@ -577,7 +577,7 @@
} else {
result = thisObj->get(exec, 0);
for(unsigned int k = 1; k < length; k++) {
- if (ValueImp *obj = getProperty(exec, thisObj, k))
+ if (JSValue *obj = getProperty(exec, thisObj, k))
thisObj->put(exec, k-1, obj);
else
thisObj->deleteProperty(exec, k-1);
@@ -591,7 +591,7 @@
// http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10
// We return a new array
- ObjectImp *resObj = static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
+ JSObject *resObj = static_cast<JSObject *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
result = resObj;
double begin = 0;
if (!args[0]->isUndefined()) {
@@ -623,7 +623,7 @@
int b = static_cast<int>(begin);
int e = static_cast<int>(end);
for(int k = b; k < e; k++, n++) {
- if (ValueImp *v = getProperty(exec, thisObj, k))
+ if (JSValue *v = getProperty(exec, thisObj, k))
resObj->put(exec, n, v);
}
resObj->put(exec, lengthPropertyName, jsNumber(n), DontEnum | DontDelete);
@@ -635,7 +635,7 @@
for ( unsigned int i = 0 ; i<length ; ++i )
printf("KJS Array::Sort: %d: %s\n", i, thisObj->get(exec, i)->toString(exec).ascii() );
#endif
- ObjectImp *sortFunction = NULL;
+ JSObject *sortFunction = NULL;
if (!args[0]->isUndefined())
{
sortFunction = args[0]->toObject(exec);
@@ -643,11 +643,11 @@
sortFunction = NULL;
}
- if (thisObj->classInfo() == &ArrayInstanceImp::info) {
+ if (thisObj->classInfo() == &ArrayInstance::info) {
if (sortFunction)
- ((ArrayInstanceImp *)thisObj)->sort(exec, sortFunction);
+ ((ArrayInstance *)thisObj)->sort(exec, sortFunction);
else
- ((ArrayInstanceImp *)thisObj)->sort(exec);
+ ((ArrayInstance *)thisObj)->sort(exec);
result = thisObj;
break;
}
@@ -662,12 +662,12 @@
// or quicksort, and much less swapping than bubblesort/insertionsort.
for ( unsigned int i = 0 ; i<length-1 ; ++i )
{
- ValueImp *iObj = thisObj->get(exec,i);
+ JSValue *iObj = thisObj->get(exec,i);
unsigned int themin = i;
- ValueImp *minObj = iObj;
+ JSValue *minObj = iObj;
for ( unsigned int j = i+1 ; j<length ; ++j )
{
- ValueImp *jObj = thisObj->get(exec,j);
+ JSValue *jObj = thisObj->get(exec,j);
double cmp;
if (jObj->isUndefined()) {
cmp = 1; // don't check minObj because there's no need to differentiate == (0) from > (1)
@@ -705,7 +705,7 @@
}
case Splice: {
// 15.4.4.12 - oh boy this is huge
- ObjectImp *resObj = static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
+ JSObject *resObj = static_cast<JSObject *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
result = resObj;
int begin = args[0]->toUInt32(exec);
if ( begin < 0 )
@@ -716,7 +716,7 @@
//printf( "Splicing from %d, deleteCount=%d \n", begin, deleteCount );
for(unsigned int k = 0; k < deleteCount; k++) {
- if (ValueImp *v = getProperty(exec, thisObj, k+begin))
+ if (JSValue *v = getProperty(exec, thisObj, k+begin))
resObj->put(exec, k, v);
}
resObj->put(exec, lengthPropertyName, jsNumber(deleteCount), DontEnum | DontDelete);
@@ -728,7 +728,7 @@
{
for ( unsigned int k = begin; k < length - deleteCount; ++k )
{
- if (ValueImp *v = getProperty(exec, thisObj, k+deleteCount))
+ if (JSValue *v = getProperty(exec, thisObj, k+deleteCount))
thisObj->put(exec, k+additionalArgs, v);
else
thisObj->deleteProperty(exec, k+additionalArgs);
@@ -740,7 +740,7 @@
{
for ( unsigned int k = length - deleteCount; (int)k > begin; --k )
{
- if (ValueImp *obj = getProperty(exec, thisObj, k + deleteCount - 1))
+ if (JSValue *obj = getProperty(exec, thisObj, k + deleteCount - 1))
thisObj->put(exec, k + additionalArgs - 1, obj);
else
thisObj->deleteProperty(exec, k+additionalArgs-1);
@@ -758,7 +758,7 @@
unsigned int nrArgs = args.size();
for ( unsigned int k = length; k > 0; --k )
{
- if (ValueImp *v = getProperty(exec, thisObj, k - 1))
+ if (JSValue *v = getProperty(exec, thisObj, k - 1))
thisObj->put(exec, k+nrArgs-1, v);
else
thisObj->deleteProperty(exec, k+nrArgs-1);
@@ -777,12 +777,12 @@
//http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach
//http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:some
- ObjectImp *eachFunction = args[0]->toObject(exec);
+ JSObject *eachFunction = args[0]->toObject(exec);
if (!eachFunction->implementsCall())
return throwError(exec, TypeError);
- ObjectImp *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() : args[1]->toObject(exec);
+ JSObject *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() : args[1]->toObject(exec);
if (id == Some || id == Every)
result = jsBoolean(id == Every);
@@ -822,8 +822,8 @@
// ------------------------------ ArrayObjectImp -------------------------------
ArrayObjectImp::ArrayObjectImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
- ArrayPrototypeImp *arrayProto)
+ FunctionPrototype *funcProto,
+ ArrayPrototype *arrayProto)
: InternalFunctionImp(funcProto)
{
// ECMA 15.4.3.1 Array.prototype
@@ -839,18 +839,18 @@
}
// ECMA 15.4.2
-ObjectImp *ArrayObjectImp::construct(ExecState *exec, const List &args)
+JSObject *ArrayObjectImp::construct(ExecState *exec, const List &args)
{
// a single numeric argument denotes the array size (!)
if (args.size() == 1 && args[0]->isNumber()) {
uint32_t n = args[0]->toUInt32(exec);
if (n != args[0]->toNumber(exec))
return throwError(exec, RangeError, "Array size is not a small enough positive integer.");
- return new ArrayInstanceImp(exec->lexicalInterpreter()->builtinArrayPrototype(), n);
+ return new ArrayInstance(exec->lexicalInterpreter()->builtinArrayPrototype(), n);
}
// otherwise the array is constructed with the arguments in it
- return new ArrayInstanceImp(exec->lexicalInterpreter()->builtinArrayPrototype(), args);
+ return new ArrayInstance(exec->lexicalInterpreter()->builtinArrayPrototype(), args);
}
bool ArrayObjectImp::implementsCall() const
@@ -859,7 +859,7 @@
}
// ECMA 15.6.1
-ValueImp *ArrayObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *ArrayObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
// equivalent to 'new Array(....)'
return construct(exec,args);
1.17 +10 -10 JavaScriptCore/kjs/array_object.h
Index: array_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/array_object.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- array_object.h 8 Aug 2005 04:07:27 -0000 1.16
+++ array_object.h 11 Dec 2005 02:05:41 -0000 1.17
@@ -27,21 +27,21 @@
namespace KJS {
- class ArrayPrototypeImp : public ArrayInstanceImp {
+ class ArrayPrototype : public ArrayInstance {
public:
- ArrayPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objProto);
+ ArrayPrototype(ExecState *exec,
+ ObjectPrototype *objProto);
bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
- class ArrayProtoFuncImp : public InternalFunctionImp {
+ class ArrayProtoFunc : public InternalFunctionImp {
public:
- ArrayProtoFuncImp(ExecState *exec, int i, int len);
+ ArrayProtoFunc(ExecState *exec, int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
enum { ToString, ToLocaleString, Concat, Join, Pop, Push,
Reverse, Shift, Slice, Sort, Splice, UnShift,
@@ -53,13 +53,13 @@
class ArrayObjectImp : public InternalFunctionImp {
public:
ArrayObjectImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
- ArrayPrototypeImp *arrayProto);
+ FunctionPrototype *funcProto,
+ ArrayPrototype *arrayProto);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
1.16 +23 -23 JavaScriptCore/kjs/bool_object.cpp
Index: bool_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/bool_object.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- bool_object.cpp 11 Dec 2005 00:37:50 -0000 1.15
+++ bool_object.cpp 11 Dec 2005 02:05:41 -0000 1.16
@@ -33,58 +33,58 @@
using namespace KJS;
-// ------------------------------ BooleanInstanceImp ---------------------------
+// ------------------------------ BooleanInstance ---------------------------
-const ClassInfo BooleanInstanceImp::info = {"Boolean", 0, 0, 0};
+const ClassInfo BooleanInstance::info = {"Boolean", 0, 0, 0};
-BooleanInstanceImp::BooleanInstanceImp(ObjectImp *proto)
- : ObjectImp(proto)
+BooleanInstance::BooleanInstance(JSObject *proto)
+ : JSObject(proto)
{
}
-// ------------------------------ BooleanPrototypeImp --------------------------
+// ------------------------------ BooleanPrototype --------------------------
// ECMA 15.6.4
-BooleanPrototypeImp::BooleanPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objectProto,
- FunctionPrototypeImp *funcProto)
- : BooleanInstanceImp(objectProto)
+BooleanPrototype::BooleanPrototype(ExecState *exec,
+ ObjectPrototype *objectProto,
+ FunctionPrototype *funcProto)
+ : BooleanInstance(objectProto)
{
// The constructor will be added later by InterpreterImp::InterpreterImp()
- putDirect(toStringPropertyName, new BooleanProtoFuncImp(exec,funcProto,BooleanProtoFuncImp::ToString,0), DontEnum);
- putDirect(valueOfPropertyName, new BooleanProtoFuncImp(exec,funcProto,BooleanProtoFuncImp::ValueOf,0), DontEnum);
+ putDirect(toStringPropertyName, new BooleanProtoFunc(exec,funcProto,BooleanProtoFunc::ToString,0), DontEnum);
+ putDirect(valueOfPropertyName, new BooleanProtoFunc(exec,funcProto,BooleanProtoFunc::ValueOf,0), DontEnum);
setInternalValue(jsBoolean(false));
}
-// ------------------------------ BooleanProtoFuncImp --------------------------
+// ------------------------------ BooleanProtoFunc --------------------------
-BooleanProtoFuncImp::BooleanProtoFuncImp(ExecState *exec,
- FunctionPrototypeImp *funcProto, int i, int len)
+BooleanProtoFunc::BooleanProtoFunc(ExecState *exec,
+ FunctionPrototype *funcProto, int i, int len)
: InternalFunctionImp(funcProto), id(i)
{
putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
}
-bool BooleanProtoFuncImp::implementsCall() const
+bool BooleanProtoFunc::implementsCall() const
{
return true;
}
// ECMA 15.6.4.2 + 15.6.4.3
-ValueImp *BooleanProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &/*args*/)
+JSValue *BooleanProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &/*args*/)
{
// no generic function. "this" has to be a Boolean object
- if (!thisObj->inherits(&BooleanInstanceImp::info))
+ if (!thisObj->inherits(&BooleanInstance::info))
return throwError(exec, TypeError);
// execute "toString()" or "valueOf()", respectively
- ValueImp *v = thisObj->internalValue();
+ JSValue *v = thisObj->internalValue();
assert(v);
if (id == ToString)
@@ -95,8 +95,8 @@
// ------------------------------ BooleanObjectImp -----------------------------
-BooleanObjectImp::BooleanObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto,
- BooleanPrototypeImp *booleanProto)
+BooleanObjectImp::BooleanObjectImp(ExecState *exec, FunctionPrototype *funcProto,
+ BooleanPrototype *booleanProto)
: InternalFunctionImp(funcProto)
{
putDirect(prototypePropertyName, booleanProto, DontEnum|DontDelete|ReadOnly);
@@ -112,9 +112,9 @@
}
// ECMA 15.6.2
-ObjectImp *BooleanObjectImp::construct(ExecState *exec, const List &args)
+JSObject *BooleanObjectImp::construct(ExecState *exec, const List &args)
{
- ObjectImp *obj(new BooleanInstanceImp(exec->lexicalInterpreter()->builtinBooleanPrototype()));
+ JSObject *obj(new BooleanInstance(exec->lexicalInterpreter()->builtinBooleanPrototype()));
bool b;
if (args.size() > 0)
@@ -133,7 +133,7 @@
}
// ECMA 15.6.1
-ValueImp *BooleanObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *BooleanObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
if (args.isEmpty())
return jsBoolean(false);
1.7 +15 -15 JavaScriptCore/kjs/bool_object.h
Index: bool_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/bool_object.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- bool_object.h 8 Aug 2005 04:07:27 -0000 1.6
+++ bool_object.h 11 Dec 2005 02:05:41 -0000 1.7
@@ -27,9 +27,9 @@
namespace KJS {
- class BooleanInstanceImp : public ObjectImp {
+ class BooleanInstance : public JSObject {
public:
- BooleanInstanceImp(ObjectImp *proto);
+ BooleanInstance(JSObject *proto);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
@@ -41,11 +41,11 @@
* The initial value of Boolean.prototype (and thus all objects created
* with the Boolean constructor
*/
- class BooleanPrototypeImp : public BooleanInstanceImp {
+ class BooleanPrototype : public BooleanInstance {
public:
- BooleanPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objectProto,
- FunctionPrototypeImp *funcProto);
+ BooleanPrototype(ExecState *exec,
+ ObjectPrototype *objectProto,
+ FunctionPrototype *funcProto);
};
/**
@@ -54,13 +54,13 @@
* Class to implement all methods that are properties of the
* Boolean.prototype object
*/
- class BooleanProtoFuncImp : public InternalFunctionImp {
+ class BooleanProtoFunc : public InternalFunctionImp {
public:
- BooleanProtoFuncImp(ExecState *exec,
- FunctionPrototypeImp *funcProto, int i, int len);
+ BooleanProtoFunc(ExecState *exec,
+ FunctionPrototype *funcProto, int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
enum { ToString, ValueOf };
private:
@@ -73,16 +73,16 @@
* The initial value of the the global variable's "Boolean" property
*/
class BooleanObjectImp : public InternalFunctionImp {
- friend class BooleanProtoFuncImp;
+ friend class BooleanProtoFunc;
public:
- BooleanObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto,
- BooleanPrototypeImp *booleanProto);
+ BooleanObjectImp(ExecState *exec, FunctionPrototype *funcProto,
+ BooleanPrototype *booleanProto);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
} // namespace
1.53 +12 -12 JavaScriptCore/kjs/collector.cpp
Index: collector.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/collector.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- collector.cpp 27 Nov 2005 07:54:44 -0000 1.52
+++ collector.cpp 11 Dec 2005 02:05:42 -0000 1.53
@@ -282,7 +282,7 @@
gotGoodPointer:
if (((CollectorCell *)x)->u.freeCell.zeroIfFree != 0) {
- AllocatedValueImp *imp = reinterpret_cast<AllocatedValueImp *>(x);
+ JSCell *imp = reinterpret_cast<JSCell *>(x);
if (!imp->marked())
imp->mark();
}
@@ -384,7 +384,7 @@
Entry *table = ProtectedValues::_table;
Entry *end = table + ProtectedValues::_tableSize;
for (Entry *entry = table; entry != end; ++entry) {
- AllocatedValueImp *val = entry->key;
+ JSCell *val = entry->key;
if (val && !val->marked()) {
val->mark();
}
@@ -426,11 +426,11 @@
// special case with a block where all cells are used -- testing indicates this happens often
for (size_t i = 0; i < CELLS_PER_BLOCK; i++) {
CollectorCell *cell = curBlock->cells + i;
- AllocatedValueImp *imp = reinterpret_cast<AllocatedValueImp *>(cell);
+ JSCell *imp = reinterpret_cast<JSCell *>(cell);
if (imp->m_marked) {
imp->m_marked = false;
} else {
- imp->~AllocatedValueImp();
+ imp->~JSCell();
--usedCells;
--numLiveObjects;
@@ -447,11 +447,11 @@
if (cell->u.freeCell.zeroIfFree == 0) {
++minimumCellsToProcess;
} else {
- AllocatedValueImp *imp = reinterpret_cast<AllocatedValueImp *>(cell);
+ JSCell *imp = reinterpret_cast<JSCell *>(cell);
if (imp->m_marked) {
imp->m_marked = false;
} else {
- imp->~AllocatedValueImp();
+ imp->~JSCell();
--usedCells;
--numLiveObjects;
@@ -491,10 +491,10 @@
size_t cell = 0;
while (cell < heap.usedOversizeCells) {
- AllocatedValueImp *imp = (AllocatedValueImp *)heap.oversizeCells[cell];
+ JSCell *imp = (JSCell *)heap.oversizeCells[cell];
if (!imp->m_marked) {
- imp->~AllocatedValueImp();
+ imp->~JSCell();
#if DEBUG_COLLECTOR
heap.oversizeCells[cell]->u.freeCell.zeroIfFree = 0;
#else
@@ -563,7 +563,7 @@
size_t size = ProtectedValues::_tableSize;
ProtectedValues::KeyValue *table = ProtectedValues::_table;
for (size_t i = 0; i < size; i++) {
- AllocatedValueImp *val = table[i].key;
+ JSCell *val = table[i].key;
if (val) {
++count;
}
@@ -574,7 +574,7 @@
#if APPLE_CHANGES
-static const char *className(AllocatedValueImp *val)
+static const char *className(JSCell *val)
{
const char *name = "???";
switch (val->type()) {
@@ -596,7 +596,7 @@
name = "number";
break;
case ObjectType: {
- const ClassInfo *info = static_cast<ObjectImp *>(val)->classInfo();
+ const ClassInfo *info = static_cast<JSObject *>(val)->classInfo();
name = info ? info->className : "Object";
break;
}
@@ -611,7 +611,7 @@
int size = ProtectedValues::_tableSize;
ProtectedValues::KeyValue *table = ProtectedValues::_table;
for (int i = 0; i < size; i++) {
- AllocatedValueImp *val = table[i].key;
+ JSCell *val = table[i].key;
if (val) {
CFStringRef name = CFStringCreateWithCString(NULL, className(val), kCFStringEncodingASCII);
CFSetAddValue(classes, name);
1.12 +3 -3 JavaScriptCore/kjs/completion.h
Index: completion.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/completion.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- completion.h 8 Aug 2005 04:07:27 -0000 1.11
+++ completion.h 11 Dec 2005 02:05:42 -0000 1.12
@@ -47,16 +47,16 @@
*/
class Completion {
public:
- Completion(ComplType c = Normal, ValueImp *v = NULL, const Identifier &t = Identifier::null())
+ Completion(ComplType c = Normal, JSValue *v = NULL, const Identifier &t = Identifier::null())
: comp(c), val(v), tar(t) { }
ComplType complType() const { return comp; }
- ValueImp *value() const { return val; }
+ JSValue *value() const { return val; }
Identifier target() const { return tar; }
bool isValueCompletion() const { return val; }
private:
ComplType comp;
- ValueImp *val;
+ JSValue *val;
Identifier tar;
};
1.13 +9 -9 JavaScriptCore/kjs/context.h
Index: context.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/context.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- context.h 8 Aug 2005 04:07:27 -0000 1.12
+++ context.h 11 Dec 2005 02:05:42 -0000 1.13
@@ -35,21 +35,21 @@
*/
class ContextImp {
public:
- ContextImp(ObjectImp *glob, InterpreterImp *, ObjectImp *thisV, CodeType type = GlobalCode,
+ ContextImp(JSObject *glob, InterpreterImp *, JSObject *thisV, CodeType type = GlobalCode,
ContextImp *callingContext = 0, FunctionImp *functiion = 0, const List *args = 0);
~ContextImp();
const ScopeChain &scopeChain() const { return scope; }
CodeType codeType() { return m_codeType; }
- ObjectImp *variableObject() const { return variable; }
- void setVariableObject(ObjectImp *v) { variable = v; }
- ObjectImp *thisValue() const { return thisVal; }
+ JSObject *variableObject() const { return variable; }
+ void setVariableObject(JSObject *v) { variable = v; }
+ JSObject *thisValue() const { return thisVal; }
ContextImp *callingContext() { return _callingContext; }
- ObjectImp *activationObject() { return activation; }
+ JSObject *activationObject() { return activation; }
FunctionImp *function() const { return _function; }
const List *arguments() const { return _arguments; }
- void pushScope(ObjectImp *s) { scope.push(s); }
+ void pushScope(JSObject *s) { scope.push(s); }
void popScope() { scope.pop(); }
LabelStack *seenLabels() { return &ls; }
@@ -63,11 +63,11 @@
// because ContextImp is always allocated on the stack,
// there is no need to protect various pointers from conservative
// GC since they will be caught by the conservative sweep anyway!
- ObjectImp *activation;
+ JSObject *activation;
ScopeChain scope;
- ObjectImp *variable;
- ObjectImp *thisVal;
+ JSObject *variable;
+ JSObject *thisVal;
LabelStack ls;
CodeType m_codeType;
1.64 +74 -74 JavaScriptCore/kjs/date_object.cpp
Index: date_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/date_object.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- date_object.cpp 29 Nov 2005 10:33:22 -0000 1.63
+++ date_object.cpp 11 Dec 2005 02:05:42 -0000 1.64
@@ -69,12 +69,12 @@
* Class to implement all methods that are properties of the
* Date.prototype object
*/
-class DateProtoFuncImp : public InternalFunctionImp {
+class DateProtoFunc : public InternalFunctionImp {
public:
- DateProtoFuncImp(ExecState *, int i, int len);
+ DateProtoFunc(ExecState *, int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args);
Completion execute(const List &);
enum { ToString, ToDateString, ToTimeString, ToLocaleString,
@@ -98,10 +98,10 @@
*/
class DateObjectFuncImp : public InternalFunctionImp {
public:
- DateObjectFuncImp(ExecState *, FunctionPrototypeImp *, int i, int len);
+ DateObjectFuncImp(ExecState *, FunctionPrototype *, int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args);
enum { Parse, UTC };
@@ -378,93 +378,93 @@
}
}
-// ------------------------------ DateInstanceImp ------------------------------
+// ------------------------------ DateInstance ------------------------------
-const ClassInfo DateInstanceImp::info = {"Date", 0, 0, 0};
+const ClassInfo DateInstance::info = {"Date", 0, 0, 0};
-DateInstanceImp::DateInstanceImp(ObjectImp *proto)
- : ObjectImp(proto)
+DateInstance::DateInstance(JSObject *proto)
+ : JSObject(proto)
{
}
-// ------------------------------ DatePrototypeImp -----------------------------
+// ------------------------------ DatePrototype -----------------------------
-const ClassInfo DatePrototypeImp::info = {"Date", &DateInstanceImp::info, &dateTable, 0};
+const ClassInfo DatePrototype::info = {"Date", &DateInstance::info, &dateTable, 0};
/* Source for date_object.lut.h
We use a negative ID to denote the "UTC" variant.
@begin dateTable 61
- toString DateProtoFuncImp::ToString DontEnum|Function 0
- toUTCString -DateProtoFuncImp::ToUTCString DontEnum|Function 0
- toDateString DateProtoFuncImp::ToDateString DontEnum|Function 0
- toTimeString DateProtoFuncImp::ToTimeString DontEnum|Function 0
- toLocaleString DateProtoFuncImp::ToLocaleString DontEnum|Function 0
- toLocaleDateString DateProtoFuncImp::ToLocaleDateString DontEnum|Function 0
- toLocaleTimeString DateProtoFuncImp::ToLocaleTimeString DontEnum|Function 0
- valueOf DateProtoFuncImp::ValueOf DontEnum|Function 0
- getTime DateProtoFuncImp::GetTime DontEnum|Function 0
- getFullYear DateProtoFuncImp::GetFullYear DontEnum|Function 0
- getUTCFullYear -DateProtoFuncImp::GetFullYear DontEnum|Function 0
- toGMTString -DateProtoFuncImp::ToGMTString DontEnum|Function 0
- getMonth DateProtoFuncImp::GetMonth DontEnum|Function 0
- getUTCMonth -DateProtoFuncImp::GetMonth DontEnum|Function 0
- getDate DateProtoFuncImp::GetDate DontEnum|Function 0
- getUTCDate -DateProtoFuncImp::GetDate DontEnum|Function 0
- getDay DateProtoFuncImp::GetDay DontEnum|Function 0
- getUTCDay -DateProtoFuncImp::GetDay DontEnum|Function 0
- getHours DateProtoFuncImp::GetHours DontEnum|Function 0
- getUTCHours -DateProtoFuncImp::GetHours DontEnum|Function 0
- getMinutes DateProtoFuncImp::GetMinutes DontEnum|Function 0
- getUTCMinutes -DateProtoFuncImp::GetMinutes DontEnum|Function 0
- getSeconds DateProtoFuncImp::GetSeconds DontEnum|Function 0
- getUTCSeconds -DateProtoFuncImp::GetSeconds DontEnum|Function 0
- getMilliseconds DateProtoFuncImp::GetMilliSeconds DontEnum|Function 0
- getUTCMilliseconds -DateProtoFuncImp::GetMilliSeconds DontEnum|Function 0
- getTimezoneOffset DateProtoFuncImp::GetTimezoneOffset DontEnum|Function 0
- setTime DateProtoFuncImp::SetTime DontEnum|Function 1
- setMilliseconds DateProtoFuncImp::SetMilliSeconds DontEnum|Function 1
- setUTCMilliseconds -DateProtoFuncImp::SetMilliSeconds DontEnum|Function 1
- setSeconds DateProtoFuncImp::SetSeconds DontEnum|Function 2
- setUTCSeconds -DateProtoFuncImp::SetSeconds DontEnum|Function 2
- setMinutes DateProtoFuncImp::SetMinutes DontEnum|Function 3
- setUTCMinutes -DateProtoFuncImp::SetMinutes DontEnum|Function 3
- setHours DateProtoFuncImp::SetHours DontEnum|Function 4
- setUTCHours -DateProtoFuncImp::SetHours DontEnum|Function 4
- setDate DateProtoFuncImp::SetDate DontEnum|Function 1
- setUTCDate -DateProtoFuncImp::SetDate DontEnum|Function 1
- setMonth DateProtoFuncImp::SetMonth DontEnum|Function 2
- setUTCMonth -DateProtoFuncImp::SetMonth DontEnum|Function 2
- setFullYear DateProtoFuncImp::SetFullYear DontEnum|Function 3
- setUTCFullYear -DateProtoFuncImp::SetFullYear DontEnum|Function 3
- setYear DateProtoFuncImp::SetYear DontEnum|Function 1
- getYear DateProtoFuncImp::GetYear DontEnum|Function 0
+ toString DateProtoFunc::ToString DontEnum|Function 0
+ toUTCString -DateProtoFunc::ToUTCString DontEnum|Function 0
+ toDateString DateProtoFunc::ToDateString DontEnum|Function 0
+ toTimeString DateProtoFunc::ToTimeString DontEnum|Function 0
+ toLocaleString DateProtoFunc::ToLocaleString DontEnum|Function 0
+ toLocaleDateString DateProtoFunc::ToLocaleDateString DontEnum|Function 0
+ toLocaleTimeString DateProtoFunc::ToLocaleTimeString DontEnum|Function 0
+ valueOf DateProtoFunc::ValueOf DontEnum|Function 0
+ getTime DateProtoFunc::GetTime DontEnum|Function 0
+ getFullYear DateProtoFunc::GetFullYear DontEnum|Function 0
+ getUTCFullYear -DateProtoFunc::GetFullYear DontEnum|Function 0
+ toGMTString -DateProtoFunc::ToGMTString DontEnum|Function 0
+ getMonth DateProtoFunc::GetMonth DontEnum|Function 0
+ getUTCMonth -DateProtoFunc::GetMonth DontEnum|Function 0
+ getDate DateProtoFunc::GetDate DontEnum|Function 0
+ getUTCDate -DateProtoFunc::GetDate DontEnum|Function 0
+ getDay DateProtoFunc::GetDay DontEnum|Function 0
+ getUTCDay -DateProtoFunc::GetDay DontEnum|Function 0
+ getHours DateProtoFunc::GetHours DontEnum|Function 0
+ getUTCHours -DateProtoFunc::GetHours DontEnum|Function 0
+ getMinutes DateProtoFunc::GetMinutes DontEnum|Function 0
+ getUTCMinutes -DateProtoFunc::GetMinutes DontEnum|Function 0
+ getSeconds DateProtoFunc::GetSeconds DontEnum|Function 0
+ getUTCSeconds -DateProtoFunc::GetSeconds DontEnum|Function 0
+ getMilliseconds DateProtoFunc::GetMilliSeconds DontEnum|Function 0
+ getUTCMilliseconds -DateProtoFunc::GetMilliSeconds DontEnum|Function 0
+ getTimezoneOffset DateProtoFunc::GetTimezoneOffset DontEnum|Function 0
+ setTime DateProtoFunc::SetTime DontEnum|Function 1
+ setMilliseconds DateProtoFunc::SetMilliSeconds DontEnum|Function 1
+ setUTCMilliseconds -DateProtoFunc::SetMilliSeconds DontEnum|Function 1
+ setSeconds DateProtoFunc::SetSeconds DontEnum|Function 2
+ setUTCSeconds -DateProtoFunc::SetSeconds DontEnum|Function 2
+ setMinutes DateProtoFunc::SetMinutes DontEnum|Function 3
+ setUTCMinutes -DateProtoFunc::SetMinutes DontEnum|Function 3
+ setHours DateProtoFunc::SetHours DontEnum|Function 4
+ setUTCHours -DateProtoFunc::SetHours DontEnum|Function 4
+ setDate DateProtoFunc::SetDate DontEnum|Function 1
+ setUTCDate -DateProtoFunc::SetDate DontEnum|Function 1
+ setMonth DateProtoFunc::SetMonth DontEnum|Function 2
+ setUTCMonth -DateProtoFunc::SetMonth DontEnum|Function 2
+ setFullYear DateProtoFunc::SetFullYear DontEnum|Function 3
+ setUTCFullYear -DateProtoFunc::SetFullYear DontEnum|Function 3
+ setYear DateProtoFunc::SetYear DontEnum|Function 1
+ getYear DateProtoFunc::GetYear DontEnum|Function 0
@end
*/
// ECMA 15.9.4
-DatePrototypeImp::DatePrototypeImp(ExecState *, ObjectPrototypeImp *objectProto)
- : DateInstanceImp(objectProto)
+DatePrototype::DatePrototype(ExecState *, ObjectPrototype *objectProto)
+ : DateInstance(objectProto)
{
setInternalValue(jsNaN());
// The constructor will be added later, after DateObjectImp has been built.
}
-bool DatePrototypeImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DatePrototype::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
- return getStaticFunctionSlot<DateProtoFuncImp, ObjectImp>(exec, &dateTable, this, propertyName, slot);
+ return getStaticFunctionSlot<DateProtoFunc, JSObject>(exec, &dateTable, this, propertyName, slot);
}
-// ------------------------------ DateProtoFuncImp -----------------------------
+// ------------------------------ DateProtoFunc -----------------------------
-DateProtoFuncImp::DateProtoFuncImp(ExecState *exec, int i, int len)
- : InternalFunctionImp(static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())),
+DateProtoFunc::DateProtoFunc(ExecState *exec, int i, int len)
+ : InternalFunctionImp(static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype())),
id(abs(i)), utc(i<0)
// We use a negative ID to denote the "UTC" variant.
{
putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
}
-bool DateProtoFuncImp::implementsCall() const
+bool DateProtoFunc::implementsCall() const
{
return true;
}
@@ -475,10 +475,10 @@
return minusOne < 0;
}
-ValueImp *DateProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DateProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if ((id == ToString || id == ValueOf || id == GetTime || id == SetTime) &&
- !thisObj->inherits(&DateInstanceImp::info)) {
+ !thisObj->inherits(&DateInstance::info)) {
// non-generic function called on non-date object
// ToString and ValueOf are generic according to the spec, but the mozilla
@@ -487,7 +487,7 @@
}
- ValueImp *result = 0;
+ JSValue *result = 0;
UString s;
#if !__APPLE__
const int bufsize=100;
@@ -497,7 +497,7 @@
oldlocale = setlocale(LC_ALL, 0);
// FIXME: Where's the code to set the locale back to oldlocale?
#endif
- ValueImp *v = thisObj->internalValue();
+ JSValue *v = thisObj->internalValue();
double milli = v->toNumber(exec);
if (isNaN(milli)) {
switch (id) {
@@ -681,8 +681,8 @@
// TODO: MakeTime (15.9.11.1) etc. ?
DateObjectImp::DateObjectImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
- DatePrototypeImp *dateProto)
+ FunctionPrototype *funcProto,
+ DatePrototype *dateProto)
: InternalFunctionImp(funcProto)
{
// ECMA 15.9.4.1 Date.prototype
@@ -703,7 +703,7 @@
}
// ECMA 15.9.3
-ObjectImp *DateObjectImp::construct(ExecState *exec, const List &args)
+JSObject *DateObjectImp::construct(ExecState *exec, const List &args)
{
int numArgs = args.size();
@@ -755,7 +755,7 @@
}
}
- DateInstanceImp *ret = new DateInstanceImp(exec->lexicalInterpreter()->builtinDatePrototype());
+ DateInstance *ret = new DateInstance(exec->lexicalInterpreter()->builtinDatePrototype());
ret->setInternalValue(jsNumber(timeClip(value)));
return ret;
}
@@ -766,7 +766,7 @@
}
// ECMA 15.9.2
-ValueImp *DateObjectImp::callAsFunction(ExecState * /*exec*/, ObjectImp * /*thisObj*/, const List &/*args*/)
+JSValue *DateObjectImp::callAsFunction(ExecState * /*exec*/, JSObject * /*thisObj*/, const List &/*args*/)
{
time_t t = time(0);
tm ts;
@@ -776,7 +776,7 @@
// ------------------------------ DateObjectFuncImp ----------------------------
-DateObjectFuncImp::DateObjectFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len)
+DateObjectFuncImp::DateObjectFuncImp(ExecState *exec, FunctionPrototype *funcProto, int i, int len)
: InternalFunctionImp(funcProto), id(i)
{
putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
@@ -788,7 +788,7 @@
}
// ECMA 15.9.4.2 - 3
-ValueImp *DateObjectFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DateObjectFuncImp::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (id == Parse) {
return jsNumber(parseDate(args[0]->toString(exec)));
1.18 +10 -10 JavaScriptCore/kjs/date_object.h
Index: date_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/date_object.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- date_object.h 9 Oct 2005 22:56:29 -0000 1.17
+++ date_object.h 11 Dec 2005 02:05:42 -0000 1.18
@@ -25,12 +25,12 @@
namespace KJS {
- class FunctionPrototypeImp;
- class ObjectPrototypeImp;
+ class FunctionPrototype;
+ class ObjectPrototype;
- class DateInstanceImp : public ObjectImp {
+ class DateInstance : public JSObject {
public:
- DateInstanceImp(ObjectImp *proto);
+ DateInstance(JSObject *proto);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
@@ -42,9 +42,9 @@
* The initial value of Date.prototype (and thus all objects created
* with the Date constructor
*/
- class DatePrototypeImp : public DateInstanceImp {
+ class DatePrototype : public DateInstance {
public:
- DatePrototypeImp(ExecState *, ObjectPrototypeImp *);
+ DatePrototype(ExecState *, ObjectPrototype *);
virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
@@ -57,15 +57,15 @@
*/
class DateObjectImp : public InternalFunctionImp {
public:
- DateObjectImp(ExecState *, FunctionPrototypeImp *, DatePrototypeImp *);
+ DateObjectImp(ExecState *, FunctionPrototype *, DatePrototype *);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *, const List &args);
+ virtual JSObject *construct(ExecState *, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args);
Completion execute(const List &);
- ObjectImp *construct(const List &);
+ JSObject *construct(const List &);
};
} // namespace
1.8 +3 -3 JavaScriptCore/kjs/debugger.cpp
Index: debugger.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/debugger.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- debugger.cpp 3 Oct 2005 21:11:48 -0000 1.7
+++ debugger.cpp 11 Dec 2005 02:05:43 -0000 1.8
@@ -100,7 +100,7 @@
}
bool Debugger::exception(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/,
- ObjectImp */*exceptionObj*/)
+ JSObject */*exceptionObj*/)
{
return true;
}
@@ -112,13 +112,13 @@
}
bool Debugger::callEvent(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/,
- ObjectImp */*function*/, const List &/*args*/)
+ JSObject */*function*/, const List &/*args*/)
{
return true;
}
bool Debugger::returnEvent(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/,
- ObjectImp */*function*/)
+ JSObject */*function*/)
{
return true;
}
1.7 +4 -4 JavaScriptCore/kjs/debugger.h
Index: debugger.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/debugger.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- debugger.h 8 Aug 2005 04:07:28 -0000 1.6
+++ debugger.h 11 Dec 2005 02:05:43 -0000 1.7
@@ -28,7 +28,7 @@
class DebuggerImp;
class Interpreter;
class ExecState;
- class ObjectImp;
+ class JSObject;
class UString;
class List;
@@ -141,7 +141,7 @@
* be aborted
*/
virtual bool exception(ExecState *exec, int sourceId, int lineno,
- ObjectImp *exceptionObj);
+ JSObject *exceptionObj);
/**
* Called when a line of the script is reached (before it is executed)
@@ -181,7 +181,7 @@
* be aborted
*/
virtual bool callEvent(ExecState *exec, int sourceId, int lineno,
- ObjectImp *function, const List &args);
+ JSObject *function, const List &args);
/**
* Called on each function exit. The function being returned from is that
@@ -202,7 +202,7 @@
* be aborted
*/
virtual bool returnEvent(ExecState *exec, int sourceId, int lineno,
- ObjectImp *function);
+ JSObject *function);
private:
DebuggerImp *rep;
1.21 +32 -32 JavaScriptCore/kjs/error_object.cpp
Index: error_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/error_object.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- error_object.cpp 11 Dec 2005 00:37:50 -0000 1.20
+++ error_object.cpp 11 Dec 2005 02:05:43 -0000 1.21
@@ -31,50 +31,50 @@
using namespace KJS;
-// ------------------------------ ErrorInstanceImp ----------------------------
+// ------------------------------ ErrorInstance ----------------------------
-const ClassInfo ErrorInstanceImp::info = {"Error", 0, 0, 0};
+const ClassInfo ErrorInstance::info = {"Error", 0, 0, 0};
-ErrorInstanceImp::ErrorInstanceImp(ObjectImp *proto)
-: ObjectImp(proto)
+ErrorInstance::ErrorInstance(JSObject *proto)
+: JSObject(proto)
{
}
-// ------------------------------ ErrorPrototypeImp ----------------------------
+// ------------------------------ ErrorPrototype ----------------------------
// ECMA 15.9.4
-ErrorPrototypeImp::ErrorPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objectProto,
- FunctionPrototypeImp *funcProto)
- : ObjectImp(objectProto)
+ErrorPrototype::ErrorPrototype(ExecState *exec,
+ ObjectPrototype *objectProto,
+ FunctionPrototype *funcProto)
+ : JSObject(objectProto)
{
setInternalValue(jsUndefined());
// The constructor will be added later in ErrorObjectImp's constructor
put(exec, namePropertyName, jsString("Error"), DontEnum);
put(exec, messagePropertyName, jsString("Unknown error"), DontEnum);
- putDirect(toStringPropertyName, new ErrorProtoFuncImp(exec,funcProto), DontEnum);
+ putDirect(toStringPropertyName, new ErrorProtoFunc(exec,funcProto), DontEnum);
}
-// ------------------------------ ErrorProtoFuncImp ----------------------------
+// ------------------------------ ErrorProtoFunc ----------------------------
-ErrorProtoFuncImp::ErrorProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto)
+ErrorProtoFunc::ErrorProtoFunc(ExecState *exec, FunctionPrototype *funcProto)
: InternalFunctionImp(funcProto)
{
putDirect(lengthPropertyName, jsNumber(0), DontDelete|ReadOnly|DontEnum);
}
-bool ErrorProtoFuncImp::implementsCall() const
+bool ErrorProtoFunc::implementsCall() const
{
return true;
}
-ValueImp *ErrorProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &/*args*/)
+JSValue *ErrorProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &/*args*/)
{
// toString()
UString s = "Error";
- ValueImp *v = thisObj->get(exec, namePropertyName);
+ JSValue *v = thisObj->get(exec, namePropertyName);
if (!v->isUndefined()) {
s = v->toString(exec);
}
@@ -89,8 +89,8 @@
// ------------------------------ ErrorObjectImp -------------------------------
-ErrorObjectImp::ErrorObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto,
- ErrorPrototypeImp *errorProto)
+ErrorObjectImp::ErrorObjectImp(ExecState *exec, FunctionPrototype *funcProto,
+ ErrorPrototype *errorProto)
: InternalFunctionImp(funcProto)
{
// ECMA 15.11.3.1 Error.prototype
@@ -105,11 +105,11 @@
}
// ECMA 15.9.3
-ObjectImp *ErrorObjectImp::construct(ExecState *exec, const List &args)
+JSObject *ErrorObjectImp::construct(ExecState *exec, const List &args)
{
- ObjectImp *proto = static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinErrorPrototype());
- ObjectImp *imp = new ErrorInstanceImp(proto);
- ObjectImp *obj(imp);
+ JSObject *proto = static_cast<JSObject *>(exec->lexicalInterpreter()->builtinErrorPrototype());
+ JSObject *imp = new ErrorInstance(proto);
+ JSObject *obj(imp);
if (!args[0]->isUndefined())
imp->putDirect(messagePropertyName, jsString(args[0]->toString(exec)));
@@ -123,17 +123,17 @@
}
// ECMA 15.9.2
-ValueImp *ErrorObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *ErrorObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
// "Error()" gives the sames result as "new Error()"
return construct(exec,args);
}
-// ------------------------------ NativeErrorPrototypeImp ----------------------
+// ------------------------------ NativeErrorPrototype ----------------------
-NativeErrorPrototypeImp::NativeErrorPrototypeImp(ExecState *exec, ErrorPrototypeImp *errorProto,
+NativeErrorPrototype::NativeErrorPrototype(ExecState *exec, ErrorPrototype *errorProto,
ErrorType et, UString name, UString message)
- : ObjectImp(errorProto)
+ : JSObject(errorProto)
{
errType = et;
putDirect(namePropertyName, jsString(name), 0);
@@ -144,8 +144,8 @@
const ClassInfo NativeErrorImp::info = {"Function", &InternalFunctionImp::info, 0, 0};
-NativeErrorImp::NativeErrorImp(ExecState *exec, FunctionPrototypeImp *funcProto,
- ObjectImp *prot)
+NativeErrorImp::NativeErrorImp(ExecState *exec, FunctionPrototype *funcProto,
+ JSObject *prot)
: InternalFunctionImp(funcProto), proto(prot)
{
putDirect(lengthPropertyName, jsNumber(1), DontDelete|ReadOnly|DontEnum); // ECMA 15.11.7.5
@@ -157,10 +157,10 @@
return true;
}
-ObjectImp *NativeErrorImp::construct(ExecState *exec, const List &args)
+JSObject *NativeErrorImp::construct(ExecState *exec, const List &args)
{
- ObjectImp *imp = new ErrorInstanceImp(proto);
- ObjectImp *obj(imp);
+ JSObject *imp = new ErrorInstance(proto);
+ JSObject *obj(imp);
if (!args[0]->isUndefined())
imp->putDirect(messagePropertyName, jsString(args[0]->toString(exec)));
return obj;
@@ -171,14 +171,14 @@
return true;
}
-ValueImp *NativeErrorImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *NativeErrorImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
return construct(exec,args);
}
void NativeErrorImp::mark()
{
- ObjectImp::mark();
+ JSObject::mark();
if (proto && !proto->marked())
proto->mark();
}
1.7 +20 -20 JavaScriptCore/kjs/error_object.h
Index: error_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/error_object.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- error_object.h 8 Aug 2005 04:07:28 -0000 1.6
+++ error_object.h 11 Dec 2005 02:05:43 -0000 1.7
@@ -27,43 +27,43 @@
namespace KJS {
- class ErrorInstanceImp : public ObjectImp {
+ class ErrorInstance : public JSObject {
public:
- ErrorInstanceImp(ObjectImp *proto);
+ ErrorInstance(JSObject *proto);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
- class ErrorPrototypeImp : public ObjectImp {
+ class ErrorPrototype : public JSObject {
public:
- ErrorPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objectProto,
- FunctionPrototypeImp *funcProto);
+ ErrorPrototype(ExecState *exec,
+ ObjectPrototype *objectProto,
+ FunctionPrototype *funcProto);
};
- class ErrorProtoFuncImp : public InternalFunctionImp {
+ class ErrorProtoFunc : public InternalFunctionImp {
public:
- ErrorProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto);
+ ErrorProtoFunc(ExecState *exec, FunctionPrototype *funcProto);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
class ErrorObjectImp : public InternalFunctionImp {
public:
- ErrorObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto,
- ErrorPrototypeImp *errorProto);
+ ErrorObjectImp(ExecState *exec, FunctionPrototype *funcProto,
+ ErrorPrototype *errorProto);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
- class NativeErrorPrototypeImp : public ObjectImp {
+ class NativeErrorPrototype : public JSObject {
public:
- NativeErrorPrototypeImp(ExecState *exec, ErrorPrototypeImp *errorProto,
+ NativeErrorPrototype(ExecState *exec, ErrorPrototype *errorProto,
ErrorType et, UString name, UString message);
private:
ErrorType errType;
@@ -71,20 +71,20 @@
class NativeErrorImp : public InternalFunctionImp {
public:
- NativeErrorImp(ExecState *exec, FunctionPrototypeImp *funcProto,
- ObjectImp *prot);
+ NativeErrorImp(ExecState *exec, FunctionPrototype *funcProto,
+ JSObject *prot);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
virtual void mark();
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
private:
- ObjectImp *proto;
+ JSObject *proto;
};
} // namespace
1.63 +41 -41 JavaScriptCore/kjs/function.cpp
Index: function.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/function.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- function.cpp 11 Dec 2005 00:37:50 -0000 1.62
+++ function.cpp 11 Dec 2005 02:05:43 -0000 1.63
@@ -58,7 +58,7 @@
FunctionImp::FunctionImp(ExecState *exec, const Identifier &n)
: InternalFunctionImp(
- static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
+ static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
), param(0L), ident(n)
{
}
@@ -73,9 +73,9 @@
return true;
}
-ValueImp *FunctionImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *FunctionImp::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
- ObjectImp *globalObj = exec->dynamicInterpreter()->globalObject();
+ JSObject *globalObj = exec->dynamicInterpreter()->globalObject();
// enter a new execution context
ContextImp ctx(globalObj, exec->dynamicInterpreter()->imp(), thisObj, codeType(),
@@ -170,7 +170,7 @@
// ECMA 10.1.3q
void FunctionImp::processParameters(ExecState *exec, const List &args)
{
- ObjectImp *variable = exec->context().imp()->variableObject();
+ JSObject *variable = exec->context().imp()->variableObject();
#ifdef KJS_VERBOSE
fprintf(stderr, "---------------------------------------------------\n"
@@ -206,7 +206,7 @@
{
}
-ValueImp *FunctionImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *FunctionImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
FunctionImp *thisObj = static_cast<FunctionImp *>(slot.slotBase());
ContextImp *context = exec->_context;
@@ -219,7 +219,7 @@
return jsNull();
}
-ValueImp *FunctionImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *FunctionImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
FunctionImp *thisObj = static_cast<FunctionImp *>(slot.slotBase());
const Parameter *p = thisObj->param;
@@ -248,7 +248,7 @@
return InternalFunctionImp::getOwnPropertySlot(exec, propertyName, slot);
}
-void FunctionImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void FunctionImp::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier() || propertyName == lengthPropertyName)
return;
@@ -312,21 +312,21 @@
}
// ECMA 13.2.2 [[Construct]]
-ObjectImp *DeclaredFunctionImp::construct(ExecState *exec, const List &args)
+JSObject *DeclaredFunctionImp::construct(ExecState *exec, const List &args)
{
- ObjectImp *proto;
- ValueImp *p = get(exec,prototypePropertyName);
+ JSObject *proto;
+ JSValue *p = get(exec,prototypePropertyName);
if (p->isObject())
- proto = static_cast<ObjectImp*>(p);
+ proto = static_cast<JSObject*>(p);
else
proto = exec->lexicalInterpreter()->builtinObjectPrototype();
- ObjectImp *obj(new ObjectImp(proto));
+ JSObject *obj(new JSObject(proto));
- ValueImp *res = call(exec,obj,args);
+ JSValue *res = call(exec,obj,args);
if (res->isObject())
- return static_cast<ObjectImp *>(res);
+ return static_cast<JSObject *>(res);
else
return obj;
}
@@ -413,13 +413,13 @@
return (*this)[indexAsNumber];
}
-// ------------------------------ ArgumentsImp ---------------------------------
+// ------------------------------ Arguments ---------------------------------
-const ClassInfo ArgumentsImp::info = {"Arguments", 0, 0, 0};
+const ClassInfo Arguments::info = {"Arguments", 0, 0, 0};
// ECMA 10.1.8
-ArgumentsImp::ArgumentsImp(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act)
-: ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype()),
+Arguments::Arguments(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act)
+: JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()),
_activationObject(act),
indexToNameMap(func, args)
{
@@ -430,50 +430,50 @@
ListIterator iterator = args.begin();
for (; iterator != args.end(); i++, iterator++) {
if (!indexToNameMap.isMapped(Identifier::from(i))) {
- ObjectImp::put(exec, Identifier::from(i), *iterator, DontEnum);
+ JSObject::put(exec, Identifier::from(i), *iterator, DontEnum);
}
}
}
-void ArgumentsImp::mark()
+void Arguments::mark()
{
- ObjectImp::mark();
+ JSObject::mark();
if (_activationObject && !_activationObject->marked())
_activationObject->mark();
}
-ValueImp *ArgumentsImp::mappedIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *Arguments::mappedIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
- ArgumentsImp *thisObj = static_cast<ArgumentsImp *>(slot.slotBase());
+ Arguments *thisObj = static_cast<Arguments *>(slot.slotBase());
return thisObj->_activationObject->get(exec, thisObj->indexToNameMap[propertyName]);
}
-bool ArgumentsImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool Arguments::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
if (indexToNameMap.isMapped(propertyName)) {
slot.setCustom(this, mappedIndexGetter);
return true;
}
- return ObjectImp::getOwnPropertySlot(exec, propertyName, slot);
+ return JSObject::getOwnPropertySlot(exec, propertyName, slot);
}
-void ArgumentsImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void Arguments::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
if (indexToNameMap.isMapped(propertyName)) {
_activationObject->put(exec, indexToNameMap[propertyName], value, attr);
} else {
- ObjectImp::put(exec, propertyName, value, attr);
+ JSObject::put(exec, propertyName, value, attr);
}
}
-bool ArgumentsImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
+bool Arguments::deleteProperty(ExecState *exec, const Identifier &propertyName)
{
if (indexToNameMap.isMapped(propertyName)) {
indexToNameMap.unMap(propertyName);
return true;
} else {
- return ObjectImp::deleteProperty(exec, propertyName);
+ return JSObject::deleteProperty(exec, propertyName);
}
}
@@ -489,7 +489,7 @@
// FIXME: Do we need to support enumerating the arguments property?
}
-ValueImp *ActivationImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *ActivationImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
ActivationImp *thisObj = static_cast<ActivationImp *>(slot.slotBase());
@@ -508,7 +508,7 @@
bool ActivationImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
// do this first so property map arguments property wins over the below
- if (ObjectImp::getOwnPropertySlot(exec, propertyName, slot))
+ if (JSObject::getOwnPropertySlot(exec, propertyName, slot))
return true;
if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier()) {
@@ -523,7 +523,7 @@
{
if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier())
return false;
- return ObjectImp::deleteProperty(exec, propertyName);
+ return JSObject::deleteProperty(exec, propertyName);
}
void ActivationImp::mark()
@@ -533,18 +533,18 @@
_arguments.mark();
if (_argumentsObject && !_argumentsObject->marked())
_argumentsObject->mark();
- ObjectImp::mark();
+ JSObject::mark();
}
void ActivationImp::createArgumentsObject(ExecState *exec) const
{
- _argumentsObject = new ArgumentsImp(exec, _function, _arguments, const_cast<ActivationImp *>(this));
+ _argumentsObject = new Arguments(exec, _function, _arguments, const_cast<ActivationImp *>(this));
}
// ------------------------------ GlobalFunc -----------------------------------
-GlobalFuncImp::GlobalFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len)
+GlobalFuncImp::GlobalFuncImp(ExecState *exec, FunctionPrototype *funcProto, int i, int len)
: InternalFunctionImp(funcProto), id(i)
{
putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
@@ -560,7 +560,7 @@
return true;
}
-static ValueImp *encode(ExecState *exec, const List &args, const char *do_not_escape)
+static JSValue *encode(ExecState *exec, const List &args, const char *do_not_escape)
{
UString r = "", s, str = args[0]->toString(exec);
CString cstr = str.UTF8String();
@@ -578,7 +578,7 @@
return jsString(r);
}
-static ValueImp *decode(ExecState *exec, const List &args, const char *do_not_unescape, bool strict)
+static JSValue *decode(ExecState *exec, const List &args, const char *do_not_unescape, bool strict)
{
UString s = "", str = args[0]->toString(exec);
int k = 0, len = str.size();
@@ -747,9 +747,9 @@
return s.toDouble( true /*tolerant*/, false /* NaN for empty string */ );
}
-ValueImp *GlobalFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *GlobalFuncImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
- ValueImp *res = jsUndefined();
+ JSValue *res = jsUndefined();
static const char do_not_escape[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -772,7 +772,7 @@
switch (id) {
case Eval: { // eval()
- ValueImp *x = args[0];
+ JSValue *x = args[0];
if (!x->isString())
return x;
else {
@@ -796,7 +796,7 @@
}
// enter a new execution context
- ObjectImp *thisVal = static_cast<ObjectImp *>(exec->context().thisValue());
+ JSObject *thisVal = static_cast<JSObject *>(exec->context().thisValue());
ContextImp ctx(exec->dynamicInterpreter()->globalObject(),
exec->dynamicInterpreter()->imp(),
thisVal,
1.37 +14 -14 JavaScriptCore/kjs/function.h
Index: function.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/function.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- function.h 1 Dec 2005 10:31:59 -0000 1.36
+++ function.h 11 Dec 2005 02:05:43 -0000 1.37
@@ -42,11 +42,11 @@
virtual ~FunctionImp();
virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
void addParameter(const Identifier &n);
Identifier getParameterName(int index);
@@ -64,8 +64,8 @@
Identifier ident;
private:
- static ValueImp *argumentsGetter(ExecState *, const Identifier &, const PropertySlot&);
- static ValueImp *lengthGetter(ExecState *, const Identifier &, const PropertySlot&);
+ static JSValue *argumentsGetter(ExecState *, const Identifier &, const PropertySlot&);
+ static JSValue *lengthGetter(ExecState *, const Identifier &, const PropertySlot&);
void processParameters(ExecState *exec, const List &);
virtual void processVarDecls(ExecState *exec);
@@ -77,7 +77,7 @@
FunctionBodyNode *b, const ScopeChain &sc);
bool implementsConstruct() const;
- ObjectImp *construct(ExecState *exec, const List &args);
+ JSObject *construct(ExecState *exec, const List &args);
virtual Completion execute(ExecState *exec);
CodeType codeType() const { return FunctionCode; }
@@ -105,23 +105,23 @@
Identifier * _map;
};
- class ArgumentsImp : public ObjectImp {
+ class Arguments : public JSObject {
public:
- ArgumentsImp(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act);
+ Arguments(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act);
virtual void mark();
virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
private:
- static ValueImp *mappedIndexGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
+ static JSValue *mappedIndexGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
ActivationImp *_activationObject;
mutable IndexToNameMap indexToNameMap;
};
- class ActivationImp : public ObjectImp {
+ class ActivationImp : public JSObject {
public:
ActivationImp(FunctionImp *function, const List &arguments);
@@ -136,19 +136,19 @@
bool isActivation() { return true; }
private:
static PropertySlot::GetValueFunc getArgumentsGetter();
- static ValueImp *argumentsGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
+ static JSValue *argumentsGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
void createArgumentsObject(ExecState *exec) const;
FunctionImp *_function;
List _arguments;
- mutable ArgumentsImp *_argumentsObject;
+ mutable Arguments *_argumentsObject;
};
class GlobalFuncImp : public InternalFunctionImp {
public:
- GlobalFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len);
+ GlobalFuncImp(ExecState *exec, FunctionPrototype *funcProto, int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
virtual CodeType codeType() const;
enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, Escape, UnEscape,
DecodeURI, DecodeURIComponent, EncodeURI, EncodeURIComponent
1.36 +31 -31 JavaScriptCore/kjs/function_object.cpp
Index: function_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/function_object.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- function_object.cpp 11 Dec 2005 00:37:51 -0000 1.35
+++ function_object.cpp 11 Dec 2005 02:05:43 -0000 1.36
@@ -36,51 +36,51 @@
using namespace KJS;
-// ------------------------------ FunctionPrototypeImp -------------------------
+// ------------------------------ FunctionPrototype -------------------------
-FunctionPrototypeImp::FunctionPrototypeImp(ExecState *exec)
+FunctionPrototype::FunctionPrototype(ExecState *exec)
{
putDirect(lengthPropertyName, jsNumber(0), DontDelete|ReadOnly|DontEnum);
- putDirect(toStringPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::ToString, 0), DontEnum);
+ putDirect(toStringPropertyName, new FunctionProtoFunc(exec, this, FunctionProtoFunc::ToString, 0), DontEnum);
static const Identifier applyPropertyName("apply");
- putDirect(applyPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Apply, 2), DontEnum);
+ putDirect(applyPropertyName, new FunctionProtoFunc(exec, this, FunctionProtoFunc::Apply, 2), DontEnum);
static const Identifier callPropertyName("call");
- putDirect(callPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Call, 1), DontEnum);
+ putDirect(callPropertyName, new FunctionProtoFunc(exec, this, FunctionProtoFunc::Call, 1), DontEnum);
}
-FunctionPrototypeImp::~FunctionPrototypeImp()
+FunctionPrototype::~FunctionPrototype()
{
}
-bool FunctionPrototypeImp::implementsCall() const
+bool FunctionPrototype::implementsCall() const
{
return true;
}
// ECMA 15.3.4
-ValueImp *FunctionPrototypeImp::callAsFunction(ExecState */*exec*/, ObjectImp */*thisObj*/, const List &/*args*/)
+JSValue *FunctionPrototype::callAsFunction(ExecState */*exec*/, JSObject */*thisObj*/, const List &/*args*/)
{
return jsUndefined();
}
-// ------------------------------ FunctionProtoFuncImp -------------------------
+// ------------------------------ FunctionProtoFunc -------------------------
-FunctionProtoFuncImp::FunctionProtoFuncImp(ExecState *exec,
- FunctionPrototypeImp *funcProto, int i, int len)
+FunctionProtoFunc::FunctionProtoFunc(ExecState *exec,
+ FunctionPrototype *funcProto, int i, int len)
: InternalFunctionImp(funcProto), id(i)
{
putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
}
-bool FunctionProtoFuncImp::implementsCall() const
+bool FunctionProtoFunc::implementsCall() const
{
return true;
}
-ValueImp *FunctionProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *FunctionProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
- ValueImp *result = NULL;
+ JSValue *result = NULL;
switch (id) {
case ToString: {
@@ -106,14 +106,14 @@
}
break;
case Apply: {
- ValueImp *thisArg = args[0];
- ValueImp *argArray = args[1];
- ObjectImp *func = thisObj;
+ JSValue *thisArg = args[0];
+ JSValue *argArray = args[1];
+ JSObject *func = thisObj;
if (!func->implementsCall())
return throwError(exec, TypeError);
- ObjectImp *applyThis;
+ JSObject *applyThis;
if (thisArg->isUndefinedOrNull())
applyThis = exec->dynamicInterpreter()->globalObject();
else
@@ -122,10 +122,10 @@
List applyArgs;
if (!argArray->isUndefinedOrNull()) {
if (argArray->isObject() &&
- (static_cast<ObjectImp *>(argArray)->inherits(&ArrayInstanceImp::info) ||
- static_cast<ObjectImp *>(argArray)->inherits(&ArgumentsImp::info))) {
+ (static_cast<JSObject *>(argArray)->inherits(&ArrayInstance::info) ||
+ static_cast<JSObject *>(argArray)->inherits(&Arguments::info))) {
- ObjectImp *argArrayObj = static_cast<ObjectImp *>(argArray);
+ JSObject *argArrayObj = static_cast<JSObject *>(argArray);
unsigned int length = argArrayObj->get(exec,lengthPropertyName)->toUInt32(exec);
for (unsigned int i = 0; i < length; i++)
applyArgs.append(argArrayObj->get(exec,i));
@@ -137,13 +137,13 @@
}
break;
case Call: {
- ValueImp *thisArg = args[0];
- ObjectImp *func = thisObj;
+ JSValue *thisArg = args[0];
+ JSObject *func = thisObj;
if (!func->implementsCall())
return throwError(exec, TypeError);
- ObjectImp *callThis;
+ JSObject *callThis;
if (thisArg->isUndefinedOrNull())
callThis = exec->dynamicInterpreter()->globalObject();
else
@@ -159,7 +159,7 @@
// ------------------------------ FunctionObjectImp ----------------------------
-FunctionObjectImp::FunctionObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto)
+FunctionObjectImp::FunctionObjectImp(ExecState *exec, FunctionPrototype *funcProto)
: InternalFunctionImp(funcProto)
{
putDirect(prototypePropertyName, funcProto, DontEnum|DontDelete|ReadOnly);
@@ -178,7 +178,7 @@
}
// ECMA 15.3.2 The Function Constructor
-ObjectImp *FunctionObjectImp::construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber)
+JSObject *FunctionObjectImp::construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber)
{
UString p("");
UString body;
@@ -207,7 +207,7 @@
bool cont = dbg->sourceParsed(exec,sid,UString(),body,errLine);
if (!cont) {
dbg->imp()->abort();
- return new ObjectImp();
+ return new JSObject();
}
}
@@ -258,15 +258,15 @@
List consArgs;
- ObjectImp *objCons = exec->lexicalInterpreter()->builtinObject();
- ObjectImp *prototype = objCons->construct(exec,List::empty());
+ JSObject *objCons = exec->lexicalInterpreter()->builtinObject();
+ JSObject *prototype = objCons->construct(exec,List::empty());
prototype->put(exec, constructorPropertyName, fimp, DontEnum|DontDelete|ReadOnly);
fimp->put(exec, prototypePropertyName, prototype, DontEnum|DontDelete|ReadOnly);
return fimp;
}
// ECMA 15.3.2 The Function Constructor
-ObjectImp *FunctionObjectImp::construct(ExecState *exec, const List &args)
+JSObject *FunctionObjectImp::construct(ExecState *exec, const List &args)
{
return FunctionObjectImp::construct(exec, args, UString(), 0);
}
@@ -278,7 +278,7 @@
}
// ECMA 15.3.1 The Function Constructor Called as a Function
-ValueImp *FunctionObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *FunctionObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
return construct(exec,args);
}
1.7 +12 -12 JavaScriptCore/kjs/function_object.h
Index: function_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/function_object.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- function_object.h 8 Aug 2005 04:07:28 -0000 1.6
+++ function_object.h 11 Dec 2005 02:05:43 -0000 1.7
@@ -34,13 +34,13 @@
* The initial value of Function.prototype (and thus all objects created
* with the Function constructor)
*/
- class FunctionPrototypeImp : public InternalFunctionImp {
+ class FunctionPrototype : public InternalFunctionImp {
public:
- FunctionPrototypeImp(ExecState *exec);
- virtual ~FunctionPrototypeImp();
+ FunctionPrototype(ExecState *exec);
+ virtual ~FunctionPrototype();
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
/**
@@ -49,13 +49,13 @@
* Class to implement all methods that are properties of the
* Function.prototype object
*/
- class FunctionProtoFuncImp : public InternalFunctionImp {
+ class FunctionProtoFunc : public InternalFunctionImp {
public:
- FunctionProtoFuncImp(ExecState *exec,
- FunctionPrototypeImp *funcProto, int i, int len);
+ FunctionProtoFunc(ExecState *exec,
+ FunctionPrototype *funcProto, int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
enum { ToString, Apply, Call };
private:
@@ -69,14 +69,14 @@
*/
class FunctionObjectImp : public InternalFunctionImp {
public:
- FunctionObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto);
+ FunctionObjectImp(ExecState *exec, FunctionPrototype *funcProto);
virtual ~FunctionObjectImp();
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber);
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber);
+ virtual JSObject *construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
} // namespace
1.82 +47 -47 JavaScriptCore/kjs/internal.cpp
Index: internal.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/internal.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- internal.cpp 11 Dec 2005 00:37:51 -0000 1.81
+++ internal.cpp 11 Dec 2005 02:05:44 -0000 1.82
@@ -76,7 +76,7 @@
// ------------------------------ UndefinedImp ---------------------------------
-ValueImp *UndefinedImp::toPrimitive(ExecState *, Type) const
+JSValue *UndefinedImp::toPrimitive(ExecState *, Type) const
{
return const_cast<UndefinedImp *>(this);
}
@@ -96,14 +96,14 @@
return "undefined";
}
-ObjectImp *UndefinedImp::toObject(ExecState *exec) const
+JSObject *UndefinedImp::toObject(ExecState *exec) const
{
return throwError(exec, TypeError, "Undefined value");
}
// ------------------------------ NullImp --------------------------------------
-ValueImp *NullImp::toPrimitive(ExecState *, Type) const
+JSValue *NullImp::toPrimitive(ExecState *, Type) const
{
return const_cast<NullImp *>(this);
}
@@ -123,14 +123,14 @@
return "null";
}
-ObjectImp *NullImp::toObject(ExecState *exec) const
+JSObject *NullImp::toObject(ExecState *exec) const
{
return throwError(exec, TypeError, "Null value");
}
// ------------------------------ BooleanImp -----------------------------------
-ValueImp *BooleanImp::toPrimitive(ExecState *, Type) const
+JSValue *BooleanImp::toPrimitive(ExecState *, Type) const
{
return const_cast<BooleanImp *>(this);
}
@@ -150,16 +150,16 @@
return val ? "true" : "false";
}
-ObjectImp *BooleanImp::toObject(ExecState *exec) const
+JSObject *BooleanImp::toObject(ExecState *exec) const
{
List args;
args.append(const_cast<BooleanImp*>(this));
- return static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinBoolean()->construct(exec,args));
+ return static_cast<JSObject *>(exec->lexicalInterpreter()->builtinBoolean()->construct(exec,args));
}
// ------------------------------ StringImp ------------------------------------
-ValueImp *StringImp::toPrimitive(ExecState *, Type) const
+JSValue *StringImp::toPrimitive(ExecState *, Type) const
{
return const_cast<StringImp *>(this);
}
@@ -179,16 +179,16 @@
return val;
}
-ObjectImp *StringImp::toObject(ExecState *exec) const
+JSObject *StringImp::toObject(ExecState *exec) const
{
List args;
args.append(const_cast<StringImp*>(this));
- return static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinString()->construct(exec, args));
+ return static_cast<JSObject *>(exec->lexicalInterpreter()->builtinString()->construct(exec, args));
}
// ------------------------------ NumberImp ------------------------------------
-ValueImp *NumberImp::toPrimitive(ExecState *, Type) const
+JSValue *NumberImp::toPrimitive(ExecState *, Type) const
{
return const_cast<NumberImp *>(this);
}
@@ -210,11 +210,11 @@
return UString::from(val);
}
-ObjectImp *NumberImp::toObject(ExecState *exec) const
+JSObject *NumberImp::toObject(ExecState *exec) const
{
List args;
args.append(const_cast<NumberImp*>(this));
- return static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinNumber()->construct(exec,args));
+ return static_cast<JSObject *>(exec->lexicalInterpreter()->builtinNumber()->construct(exec,args));
}
bool NumberImp::getUInt32(uint32_t& uint32) const
@@ -252,7 +252,7 @@
// ------------------------------ ContextImp -----------------------------------
// ECMA 10.2
-ContextImp::ContextImp(ObjectImp *glob, InterpreterImp *interpreter, ObjectImp *thisV, CodeType type,
+ContextImp::ContextImp(JSObject *glob, InterpreterImp *interpreter, JSObject *thisV, CodeType type,
ContextImp *callingCon, FunctionImp *func, const List *args)
: _interpreter(interpreter), _function(func), _arguments(args)
{
@@ -280,7 +280,7 @@
case GlobalCode:
scope.clear();
scope.push(glob);
- thisVal = static_cast<ObjectImp*>(glob);
+ thisVal = static_cast<JSObject*>(glob);
break;
case FunctionCode:
case AnonymousCode:
@@ -394,7 +394,7 @@
InterpreterImp* InterpreterImp::s_hook = 0L;
-typedef HashMap<ObjectImp *, InterpreterImp *, PointerHash<ObjectImp *> > InterpreterMap;
+typedef HashMap<JSObject *, InterpreterImp *, PointerHash<JSObject *> > InterpreterMap;
static inline InterpreterMap &interpreterMap()
{
@@ -402,7 +402,7 @@
return *map;
}
-InterpreterImp::InterpreterImp(Interpreter *interp, ObjectImp *glob)
+InterpreterImp::InterpreterImp(Interpreter *interp, JSObject *glob)
: globExec(interp, 0)
, _context(0)
{
@@ -439,28 +439,28 @@
// Contructor prototype objects (Object.prototype, Array.prototype etc)
- FunctionPrototypeImp *funcProto = new FunctionPrototypeImp(&globExec);
+ FunctionPrototype *funcProto = new FunctionPrototype(&globExec);
b_FunctionPrototype = funcProto;
- ObjectPrototypeImp *objProto = new ObjectPrototypeImp(&globExec, funcProto);
+ ObjectPrototype *objProto = new ObjectPrototype(&globExec, funcProto);
b_ObjectPrototype = objProto;
funcProto->setPrototype(b_ObjectPrototype);
- ArrayPrototypeImp *arrayProto = new ArrayPrototypeImp(&globExec, objProto);
+ ArrayPrototype *arrayProto = new ArrayPrototype(&globExec, objProto);
b_ArrayPrototype = arrayProto;
- StringPrototypeImp *stringProto = new StringPrototypeImp(&globExec, objProto);
+ StringPrototype *stringProto = new StringPrototype(&globExec, objProto);
b_StringPrototype = stringProto;
- BooleanPrototypeImp *booleanProto = new BooleanPrototypeImp(&globExec, objProto, funcProto);
+ BooleanPrototype *booleanProto = new BooleanPrototype(&globExec, objProto, funcProto);
b_BooleanPrototype = booleanProto;
- NumberPrototypeImp *numberProto = new NumberPrototypeImp(&globExec, objProto, funcProto);
+ NumberPrototype *numberProto = new NumberPrototype(&globExec, objProto, funcProto);
b_NumberPrototype = numberProto;
- DatePrototypeImp *dateProto = new DatePrototypeImp(&globExec, objProto);
+ DatePrototype *dateProto = new DatePrototype(&globExec, objProto);
b_DatePrototype = dateProto;
- RegExpPrototypeImp *regexpProto = new RegExpPrototypeImp(&globExec, objProto, funcProto);
+ RegExpPrototype *regexpProto = new RegExpPrototype(&globExec, objProto, funcProto);
b_RegExpPrototype = regexpProto;
- ErrorPrototypeImp *errorProto = new ErrorPrototypeImp(&globExec, objProto, funcProto);
+ ErrorPrototype *errorProto = new ErrorPrototype(&globExec, objProto, funcProto);
b_ErrorPrototype = errorProto;
- static_cast<ObjectImp*>(global)->setPrototype(b_ObjectPrototype);
+ static_cast<JSObject*>(global)->setPrototype(b_ObjectPrototype);
// Constructors (Object, Array, etc.)
b_Object = new ObjectObjectImp(&globExec, objProto, funcProto);
@@ -474,12 +474,12 @@
b_Error = new ErrorObjectImp(&globExec, funcProto, errorProto);
// Error object prototypes
- b_evalErrorPrototype = new NativeErrorPrototypeImp(&globExec, errorProto, EvalError, "EvalError", "EvalError");
- b_rangeErrorPrototype = new NativeErrorPrototypeImp(&globExec, errorProto, RangeError, "RangeError", "RangeError");
- b_referenceErrorPrototype = new NativeErrorPrototypeImp(&globExec, errorProto, ReferenceError, "ReferenceError", "ReferenceError");
- b_syntaxErrorPrototype = new NativeErrorPrototypeImp(&globExec, errorProto, SyntaxError, "SyntaxError", "SyntaxError");
- b_typeErrorPrototype = new NativeErrorPrototypeImp(&globExec, errorProto, TypeError, "TypeError", "TypeError");
- b_uriErrorPrototype = new NativeErrorPrototypeImp(&globExec, errorProto, URIError, "URIError", "URIError");
+ b_evalErrorPrototype = new NativeErrorPrototype(&globExec, errorProto, EvalError, "EvalError", "EvalError");
+ b_rangeErrorPrototype = new NativeErrorPrototype(&globExec, errorProto, RangeError, "RangeError", "RangeError");
+ b_referenceErrorPrototype = new NativeErrorPrototype(&globExec, errorProto, ReferenceError, "ReferenceError", "ReferenceError");
+ b_syntaxErrorPrototype = new NativeErrorPrototype(&globExec, errorProto, SyntaxError, "SyntaxError", "SyntaxError");
+ b_typeErrorPrototype = new NativeErrorPrototype(&globExec, errorProto, TypeError, "TypeError", "TypeError");
+ b_uriErrorPrototype = new NativeErrorPrototype(&globExec, errorProto, URIError, "URIError", "URIError");
// Error objects
b_evalError = new NativeErrorImp(&globExec, funcProto, b_evalErrorPrototype);
@@ -597,7 +597,7 @@
return progNode;
}
-Completion InterpreterImp::evaluate(const UString &code, ValueImp *thisV, const UString &sourceURL, int startingLineNumber)
+Completion InterpreterImp::evaluate(const UString &code, JSValue *thisV, const UString &sourceURL, int startingLineNumber)
{
JSLock lock;
@@ -626,7 +626,7 @@
// no program node means a syntax error occurred
if (!progNode) {
- ObjectImp *err = Error::create(&globExec, SyntaxError, errMsg, errLine, sid, &sourceURL);
+ JSObject *err = Error::create(&globExec, SyntaxError, errMsg, errLine, sid, &sourceURL);
return Completion(Throw,err);
}
@@ -634,8 +634,8 @@
recursion++;
- ObjectImp *globalObj = globalObject();
- ObjectImp *thisObj = globalObject();
+ JSObject *globalObj = globalObject();
+ JSObject *thisObj = globalObject();
if (thisV) {
// "this" must be an object... use same rules as Function.prototype.apply()
@@ -747,7 +747,7 @@
b_uriErrorPrototype = builtins._internal->b_uriErrorPrototype;
}
-InterpreterImp *InterpreterImp::interpreterWithGlobalObject(ObjectImp *global)
+InterpreterImp *InterpreterImp::interpreterWithGlobalObject(JSObject *global)
{
return interpreterMap().get(global);
}
@@ -761,8 +761,8 @@
{
}
-InternalFunctionImp::InternalFunctionImp(FunctionPrototypeImp *funcProto)
- : ObjectImp(funcProto)
+InternalFunctionImp::InternalFunctionImp(FunctionPrototype *funcProto)
+ : JSObject(funcProto)
{
}
@@ -771,18 +771,18 @@
return true;
}
-bool InternalFunctionImp::hasInstance(ExecState *exec, ValueImp *value)
+bool InternalFunctionImp::hasInstance(ExecState *exec, JSValue *value)
{
if (!value->isObject())
return false;
- ValueImp *prot = get(exec,prototypePropertyName);
+ JSValue *prot = get(exec,prototypePropertyName);
if (!prot->isObject() && !prot->isNull()) {
throwError(exec, TypeError, "Invalid prototype encountered in instanceof operation.");
return false;
}
- ObjectImp *v = static_cast<ObjectImp *>(value);
+ JSObject *v = static_cast<JSObject *>(value);
while ((v = v->prototype()->getObject())) {
if (v == prot)
return true;
@@ -792,7 +792,7 @@
// ------------------------------ global functions -----------------------------
-double roundValue(ExecState *exec, ValueImp *v)
+double roundValue(ExecState *exec, JSValue *v)
{
double d = v->toNumber(exec);
double ad = fabs(d);
@@ -803,12 +803,12 @@
#ifndef NDEBUG
#include <stdio.h>
-void printInfo(ExecState *exec, const char *s, ValueImp *o, int lineno)
+void printInfo(ExecState *exec, const char *s, JSValue *o, int lineno)
{
if (!o)
fprintf(stderr, "KJS: %s: (null)", s);
else {
- ValueImp *v = o;
+ JSValue *v = o;
UString name;
switch (v->type()) {
@@ -831,7 +831,7 @@
name = "Number";
break;
case ObjectType:
- name = static_cast<ObjectImp *>(v)->className();
+ name = static_cast<JSObject *>(v)->className();
if (name.isNull())
name = "(unknown class)";
break;
1.47 +126 -126 JavaScriptCore/kjs/internal.h
Index: internal.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/internal.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- internal.h 1 Dec 2005 10:31:59 -0000 1.46
+++ internal.h 11 Dec 2005 02:05:44 -0000 1.47
@@ -40,7 +40,7 @@
class Node;
class ProgramNode;
class FunctionBodyNode;
- class FunctionPrototypeImp;
+ class FunctionPrototype;
class FunctionImp;
class Debugger;
@@ -48,76 +48,76 @@
// Primitive impls
// ---------------------------------------------------------------------------
- class UndefinedImp : public AllocatedValueImp {
+ class UndefinedImp : public JSCell {
public:
Type type() const { return UndefinedType; }
- ValueImp *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
+ JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
bool toBoolean(ExecState *exec) const;
double toNumber(ExecState *exec) const;
UString toString(ExecState *exec) const;
- ObjectImp *toObject(ExecState *exec) const;
+ JSObject *toObject(ExecState *exec) const;
};
- class NullImp : public AllocatedValueImp {
+ class NullImp : public JSCell {
public:
Type type() const { return NullType; }
- ValueImp *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
+ JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
bool toBoolean(ExecState *exec) const;
double toNumber(ExecState *exec) const;
UString toString(ExecState *exec) const;
- ObjectImp *toObject(ExecState *exec) const;
+ JSObject *toObject(ExecState *exec) const;
};
- class BooleanImp : public AllocatedValueImp {
+ class BooleanImp : public JSCell {
public:
BooleanImp(bool v = false) : val(v) { }
bool value() const { return val; }
Type type() const { return BooleanType; }
- ValueImp *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
+ JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
bool toBoolean(ExecState *exec) const;
double toNumber(ExecState *exec) const;
UString toString(ExecState *exec) const;
- ObjectImp *toObject(ExecState *exec) const;
+ JSObject *toObject(ExecState *exec) const;
private:
bool val;
};
- class StringImp : public AllocatedValueImp {
+ class StringImp : public JSCell {
public:
StringImp(const UString& v) : val(v) { }
UString value() const { return val; }
Type type() const { return StringType; }
- ValueImp *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
+ JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
bool toBoolean(ExecState *exec) const;
double toNumber(ExecState *exec) const;
UString toString(ExecState *exec) const;
- ObjectImp *toObject(ExecState *exec) const;
+ JSObject *toObject(ExecState *exec) const;
private:
UString val;
};
- class NumberImp : public AllocatedValueImp {
+ class NumberImp : public JSCell {
friend class ConstantValues;
friend class InterpreterImp;
- friend ValueImp *jsNumber(double);
+ friend JSValue *jsNumber(double);
public:
double value() const { return val; }
Type type() const { return NumberType; }
- ValueImp *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
+ JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
bool toBoolean(ExecState *exec) const;
double toNumber(ExecState *exec) const;
UString toString(ExecState *exec) const;
- ObjectImp *toObject(ExecState *exec) const;
+ JSObject *toObject(ExecState *exec) const;
private:
NumberImp(double v) : val(v) { }
@@ -204,48 +204,48 @@
class SavedBuiltinsInternal {
friend class InterpreterImp;
private:
- ProtectedPtr<ObjectImp> b_Object;
- ProtectedPtr<ObjectImp> b_Function;
- ProtectedPtr<ObjectImp> b_Array;
- ProtectedPtr<ObjectImp> b_Boolean;
- ProtectedPtr<ObjectImp> b_String;
- ProtectedPtr<ObjectImp> b_Number;
- ProtectedPtr<ObjectImp> b_Date;
- ProtectedPtr<ObjectImp> b_RegExp;
- ProtectedPtr<ObjectImp> b_Error;
-
- ProtectedPtr<ObjectImp> b_ObjectPrototype;
- ProtectedPtr<ObjectImp> b_FunctionPrototype;
- ProtectedPtr<ObjectImp> b_ArrayPrototype;
- ProtectedPtr<ObjectImp> b_BooleanPrototype;
- ProtectedPtr<ObjectImp> b_StringPrototype;
- ProtectedPtr<ObjectImp> b_NumberPrototype;
- ProtectedPtr<ObjectImp> b_DatePrototype;
- ProtectedPtr<ObjectImp> b_RegExpPrototype;
- ProtectedPtr<ObjectImp> b_ErrorPrototype;
-
- ProtectedPtr<ObjectImp> b_evalError;
- ProtectedPtr<ObjectImp> b_rangeError;
- ProtectedPtr<ObjectImp> b_referenceError;
- ProtectedPtr<ObjectImp> b_syntaxError;
- ProtectedPtr<ObjectImp> b_typeError;
- ProtectedPtr<ObjectImp> b_uriError;
-
- ProtectedPtr<ObjectImp> b_evalErrorPrototype;
- ProtectedPtr<ObjectImp> b_rangeErrorPrototype;
- ProtectedPtr<ObjectImp> b_referenceErrorPrototype;
- ProtectedPtr<ObjectImp> b_syntaxErrorPrototype;
- ProtectedPtr<ObjectImp> b_typeErrorPrototype;
- ProtectedPtr<ObjectImp> b_uriErrorPrototype;
+ ProtectedPtr<JSObject> b_Object;
+ ProtectedPtr<JSObject> b_Function;
+ ProtectedPtr<JSObject> b_Array;
+ ProtectedPtr<JSObject> b_Boolean;
+ ProtectedPtr<JSObject> b_String;
+ ProtectedPtr<JSObject> b_Number;
+ ProtectedPtr<JSObject> b_Date;
+ ProtectedPtr<JSObject> b_RegExp;
+ ProtectedPtr<JSObject> b_Error;
+
+ ProtectedPtr<JSObject> b_ObjectPrototype;
+ ProtectedPtr<JSObject> b_FunctionPrototype;
+ ProtectedPtr<JSObject> b_ArrayPrototype;
+ ProtectedPtr<JSObject> b_BooleanPrototype;
+ ProtectedPtr<JSObject> b_StringPrototype;
+ ProtectedPtr<JSObject> b_NumberPrototype;
+ ProtectedPtr<JSObject> b_DatePrototype;
+ ProtectedPtr<JSObject> b_RegExpPrototype;
+ ProtectedPtr<JSObject> b_ErrorPrototype;
+
+ ProtectedPtr<JSObject> b_evalError;
+ ProtectedPtr<JSObject> b_rangeError;
+ ProtectedPtr<JSObject> b_referenceError;
+ ProtectedPtr<JSObject> b_syntaxError;
+ ProtectedPtr<JSObject> b_typeError;
+ ProtectedPtr<JSObject> b_uriError;
+
+ ProtectedPtr<JSObject> b_evalErrorPrototype;
+ ProtectedPtr<JSObject> b_rangeErrorPrototype;
+ ProtectedPtr<JSObject> b_referenceErrorPrototype;
+ ProtectedPtr<JSObject> b_syntaxErrorPrototype;
+ ProtectedPtr<JSObject> b_typeErrorPrototype;
+ ProtectedPtr<JSObject> b_uriErrorPrototype;
};
class InterpreterImp {
friend class Collector;
public:
- InterpreterImp(Interpreter *interp, ObjectImp *glob);
+ InterpreterImp(Interpreter *interp, JSObject *glob);
~InterpreterImp();
- ObjectImp *globalObject() { return global; }
+ JSObject *globalObject() { return global; }
Interpreter *interpreter() const { return m_interpreter; }
void initGlobalObject();
@@ -254,43 +254,43 @@
ExecState *globalExec() { return &globExec; }
bool checkSyntax(const UString &code);
- Completion evaluate(const UString &code, ValueImp *thisV, const UString &sourceURL, int startingLineNumber);
+ Completion evaluate(const UString &code, JSValue *thisV, const UString &sourceURL, int startingLineNumber);
Debugger *debugger() const { return dbg; }
void setDebugger(Debugger *d) { dbg = d; }
- ObjectImp *builtinObject() const { return b_Object; }
- ObjectImp *builtinFunction() const { return b_Function; }
- ObjectImp *builtinArray() const { return b_Array; }
- ObjectImp *builtinBoolean() const { return b_Boolean; }
- ObjectImp *builtinString() const { return b_String; }
- ObjectImp *builtinNumber() const { return b_Number; }
- ObjectImp *builtinDate() const { return b_Date; }
- ObjectImp *builtinRegExp() const { return b_RegExp; }
- ObjectImp *builtinError() const { return b_Error; }
-
- ObjectImp *builtinObjectPrototype() const { return b_ObjectPrototype; }
- ObjectImp *builtinFunctionPrototype() const { return b_FunctionPrototype; }
- ObjectImp *builtinArrayPrototype() const { return b_ArrayPrototype; }
- ObjectImp *builtinBooleanPrototype() const { return b_BooleanPrototype; }
- ObjectImp *builtinStringPrototype() const { return b_StringPrototype; }
- ObjectImp *builtinNumberPrototype() const { return b_NumberPrototype; }
- ObjectImp *builtinDatePrototype() const { return b_DatePrototype; }
- ObjectImp *builtinRegExpPrototype() const { return b_RegExpPrototype; }
- ObjectImp *builtinErrorPrototype() const { return b_ErrorPrototype; }
-
- ObjectImp *builtinEvalError() const { return b_evalError; }
- ObjectImp *builtinRangeError() const { return b_rangeError; }
- ObjectImp *builtinReferenceError() const { return b_referenceError; }
- ObjectImp *builtinSyntaxError() const { return b_syntaxError; }
- ObjectImp *builtinTypeError() const { return b_typeError; }
- ObjectImp *builtinURIError() const { return b_uriError; }
-
- ObjectImp *builtinEvalErrorPrototype() const { return b_evalErrorPrototype; }
- ObjectImp *builtinRangeErrorPrototype() const { return b_rangeErrorPrototype; }
- ObjectImp *builtinReferenceErrorPrototype() const { return b_referenceErrorPrototype; }
- ObjectImp *builtinSyntaxErrorPrototype() const { return b_syntaxErrorPrototype; }
- ObjectImp *builtinTypeErrorPrototype() const { return b_typeErrorPrototype; }
- ObjectImp *builtinURIErrorPrototype() const { return b_uriErrorPrototype; }
+ JSObject *builtinObject() const { return b_Object; }
+ JSObject *builtinFunction() const { return b_Function; }
+ JSObject *builtinArray() const { return b_Array; }
+ JSObject *builtinBoolean() const { return b_Boolean; }
+ JSObject *builtinString() const { return b_String; }
+ JSObject *builtinNumber() const { return b_Number; }
+ JSObject *builtinDate() const { return b_Date; }
+ JSObject *builtinRegExp() const { return b_RegExp; }
+ JSObject *builtinError() const { return b_Error; }
+
+ JSObject *builtinObjectPrototype() const { return b_ObjectPrototype; }
+ JSObject *builtinFunctionPrototype() const { return b_FunctionPrototype; }
+ JSObject *builtinArrayPrototype() const { return b_ArrayPrototype; }
+ JSObject *builtinBooleanPrototype() const { return b_BooleanPrototype; }
+ JSObject *builtinStringPrototype() const { return b_StringPrototype; }
+ JSObject *builtinNumberPrototype() const { return b_NumberPrototype; }
+ JSObject *builtinDatePrototype() const { return b_DatePrototype; }
+ JSObject *builtinRegExpPrototype() const { return b_RegExpPrototype; }
+ JSObject *builtinErrorPrototype() const { return b_ErrorPrototype; }
+
+ JSObject *builtinEvalError() const { return b_evalError; }
+ JSObject *builtinRangeError() const { return b_rangeError; }
+ JSObject *builtinReferenceError() const { return b_referenceError; }
+ JSObject *builtinSyntaxError() const { return b_syntaxError; }
+ JSObject *builtinTypeError() const { return b_typeError; }
+ JSObject *builtinURIError() const { return b_uriError; }
+
+ JSObject *builtinEvalErrorPrototype() const { return b_evalErrorPrototype; }
+ JSObject *builtinRangeErrorPrototype() const { return b_rangeErrorPrototype; }
+ JSObject *builtinReferenceErrorPrototype() const { return b_referenceErrorPrototype; }
+ JSObject *builtinSyntaxErrorPrototype() const { return b_syntaxErrorPrototype; }
+ JSObject *builtinTypeErrorPrototype() const { return b_typeErrorPrototype; }
+ JSObject *builtinURIErrorPrototype() const { return b_uriErrorPrototype; }
void setCompatMode(Interpreter::CompatMode mode) { m_compatMode = mode; }
Interpreter::CompatMode compatMode() const { return m_compatMode; }
@@ -300,7 +300,7 @@
InterpreterImp *nextInterpreter() const { return next; }
InterpreterImp *prevInterpreter() const { return prev; }
- static InterpreterImp *interpreterWithGlobalObject(ObjectImp *);
+ static InterpreterImp *interpreterWithGlobalObject(JSObject *);
void setContext(ContextImp *c) { _context = c; }
ContextImp *context() const { return _context; }
@@ -311,46 +311,46 @@
private:
void clear();
Interpreter *m_interpreter;
- ObjectImp *global;
+ JSObject *global;
Debugger *dbg;
// Built-in properties of the object prototype. These are accessible
// from here even if they are replaced by js code (e.g. assigning to
// Array.prototype)
- ProtectedPtr<ObjectImp> b_Object;
- ProtectedPtr<ObjectImp> b_Function;
- ProtectedPtr<ObjectImp> b_Array;
- ProtectedPtr<ObjectImp> b_Boolean;
- ProtectedPtr<ObjectImp> b_String;
- ProtectedPtr<ObjectImp> b_Number;
- ProtectedPtr<ObjectImp> b_Date;
- ProtectedPtr<ObjectImp> b_RegExp;
- ProtectedPtr<ObjectImp> b_Error;
-
- ProtectedPtr<ObjectImp> b_ObjectPrototype;
- ProtectedPtr<ObjectImp> b_FunctionPrototype;
- ProtectedPtr<ObjectImp> b_ArrayPrototype;
- ProtectedPtr<ObjectImp> b_BooleanPrototype;
- ProtectedPtr<ObjectImp> b_StringPrototype;
- ProtectedPtr<ObjectImp> b_NumberPrototype;
- ProtectedPtr<ObjectImp> b_DatePrototype;
- ProtectedPtr<ObjectImp> b_RegExpPrototype;
- ProtectedPtr<ObjectImp> b_ErrorPrototype;
-
- ProtectedPtr<ObjectImp> b_evalError;
- ProtectedPtr<ObjectImp> b_rangeError;
- ProtectedPtr<ObjectImp> b_referenceError;
- ProtectedPtr<ObjectImp> b_syntaxError;
- ProtectedPtr<ObjectImp> b_typeError;
- ProtectedPtr<ObjectImp> b_uriError;
-
- ProtectedPtr<ObjectImp> b_evalErrorPrototype;
- ProtectedPtr<ObjectImp> b_rangeErrorPrototype;
- ProtectedPtr<ObjectImp> b_referenceErrorPrototype;
- ProtectedPtr<ObjectImp> b_syntaxErrorPrototype;
- ProtectedPtr<ObjectImp> b_typeErrorPrototype;
- ProtectedPtr<ObjectImp> b_uriErrorPrototype;
+ ProtectedPtr<JSObject> b_Object;
+ ProtectedPtr<JSObject> b_Function;
+ ProtectedPtr<JSObject> b_Array;
+ ProtectedPtr<JSObject> b_Boolean;
+ ProtectedPtr<JSObject> b_String;
+ ProtectedPtr<JSObject> b_Number;
+ ProtectedPtr<JSObject> b_Date;
+ ProtectedPtr<JSObject> b_RegExp;
+ ProtectedPtr<JSObject> b_Error;
+
+ ProtectedPtr<JSObject> b_ObjectPrototype;
+ ProtectedPtr<JSObject> b_FunctionPrototype;
+ ProtectedPtr<JSObject> b_ArrayPrototype;
+ ProtectedPtr<JSObject> b_BooleanPrototype;
+ ProtectedPtr<JSObject> b_StringPrototype;
+ ProtectedPtr<JSObject> b_NumberPrototype;
+ ProtectedPtr<JSObject> b_DatePrototype;
+ ProtectedPtr<JSObject> b_RegExpPrototype;
+ ProtectedPtr<JSObject> b_ErrorPrototype;
+
+ ProtectedPtr<JSObject> b_evalError;
+ ProtectedPtr<JSObject> b_rangeError;
+ ProtectedPtr<JSObject> b_referenceError;
+ ProtectedPtr<JSObject> b_syntaxError;
+ ProtectedPtr<JSObject> b_typeError;
+ ProtectedPtr<JSObject> b_uriError;
+
+ ProtectedPtr<JSObject> b_evalErrorPrototype;
+ ProtectedPtr<JSObject> b_rangeErrorPrototype;
+ ProtectedPtr<JSObject> b_referenceErrorPrototype;
+ ProtectedPtr<JSObject> b_syntaxErrorPrototype;
+ ProtectedPtr<JSObject> b_typeErrorPrototype;
+ ProtectedPtr<JSObject> b_uriErrorPrototype;
ExecState globExec;
Interpreter::CompatMode m_compatMode;
@@ -382,22 +382,22 @@
- class InternalFunctionImp : public ObjectImp {
+ class InternalFunctionImp : public JSObject {
public:
InternalFunctionImp();
- InternalFunctionImp(FunctionPrototypeImp *funcProto);
+ InternalFunctionImp(FunctionPrototype *funcProto);
bool implementsHasInstance() const;
- bool hasInstance(ExecState *exec, ValueImp *value);
+ bool hasInstance(ExecState *exec, JSValue *value);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
// helper function for toInteger, toInt32, toUInt32 and toUInt16
- double roundValue(ExecState *, ValueImp *);
+ double roundValue(ExecState *, JSValue *);
#ifndef NDEBUG
- void printInfo(ExecState *exec, const char *s, ValueImp *, int lineno = -1);
+ void printInfo(ExecState *exec, const char *s, JSValue *, int lineno = -1);
#endif
inline LabelStack::~LabelStack()
1.34 +38 -38 JavaScriptCore/kjs/interpreter.cpp
Index: interpreter.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/interpreter.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- interpreter.cpp 27 Nov 2005 07:54:44 -0000 1.33
+++ interpreter.cpp 11 Dec 2005 02:05:44 -0000 1.34
@@ -51,12 +51,12 @@
return rep->scopeChain();
}
-ObjectImp *Context::variableObject() const
+JSObject *Context::variableObject() const
{
return rep->variableObject();
}
-ObjectImp *Context::thisValue() const
+JSObject *Context::thisValue() const
{
return rep->thisValue();
}
@@ -68,7 +68,7 @@
// ------------------------------ Interpreter ----------------------------------
-Interpreter::Interpreter(ObjectImp *global)
+Interpreter::Interpreter(JSObject *global)
: rep(0)
, m_argumentsPropertyName(&argumentsPropertyName)
, m_specialPrototypePropertyName(&specialPrototypePropertyName)
@@ -81,7 +81,7 @@
, m_argumentsPropertyName(&argumentsPropertyName)
, m_specialPrototypePropertyName(&specialPrototypePropertyName)
{
- rep = new InterpreterImp(this, new ObjectImp);
+ rep = new InterpreterImp(this, new JSObject);
}
Interpreter::~Interpreter()
@@ -89,7 +89,7 @@
delete rep;
}
-ObjectImp *Interpreter::globalObject() const
+JSObject *Interpreter::globalObject() const
{
return rep->globalObject();
}
@@ -109,12 +109,12 @@
return rep->checkSyntax(code);
}
-Completion Interpreter::evaluate(const UString &code, ValueImp *thisV, const UString &)
+Completion Interpreter::evaluate(const UString &code, JSValue *thisV, const UString &)
{
return evaluate(UString(), 0, code, thisV);
}
-Completion Interpreter::evaluate(const UString &sourceURL, int startingLineNumber, const UString &code, ValueImp *thisV)
+Completion Interpreter::evaluate(const UString &sourceURL, int startingLineNumber, const UString &code, JSValue *thisV)
{
Completion comp = rep->evaluate(code,thisV, sourceURL, startingLineNumber);
@@ -133,152 +133,152 @@
return comp;
}
-ObjectImp *Interpreter::builtinObject() const
+JSObject *Interpreter::builtinObject() const
{
return rep->builtinObject();
}
-ObjectImp *Interpreter::builtinFunction() const
+JSObject *Interpreter::builtinFunction() const
{
return rep->builtinFunction();
}
-ObjectImp *Interpreter::builtinArray() const
+JSObject *Interpreter::builtinArray() const
{
return rep->builtinArray();
}
-ObjectImp *Interpreter::builtinBoolean() const
+JSObject *Interpreter::builtinBoolean() const
{
return rep->builtinBoolean();
}
-ObjectImp *Interpreter::builtinString() const
+JSObject *Interpreter::builtinString() const
{
return rep->builtinString();
}
-ObjectImp *Interpreter::builtinNumber() const
+JSObject *Interpreter::builtinNumber() const
{
return rep->builtinNumber();
}
-ObjectImp *Interpreter::builtinDate() const
+JSObject *Interpreter::builtinDate() const
{
return rep->builtinDate();
}
-ObjectImp *Interpreter::builtinRegExp() const
+JSObject *Interpreter::builtinRegExp() const
{
return rep->builtinRegExp();
}
-ObjectImp *Interpreter::builtinError() const
+JSObject *Interpreter::builtinError() const
{
return rep->builtinError();
}
-ObjectImp *Interpreter::builtinObjectPrototype() const
+JSObject *Interpreter::builtinObjectPrototype() const
{
return rep->builtinObjectPrototype();
}
-ObjectImp *Interpreter::builtinFunctionPrototype() const
+JSObject *Interpreter::builtinFunctionPrototype() const
{
return rep->builtinFunctionPrototype();
}
-ObjectImp *Interpreter::builtinArrayPrototype() const
+JSObject *Interpreter::builtinArrayPrototype() const
{
return rep->builtinArrayPrototype();
}
-ObjectImp *Interpreter::builtinBooleanPrototype() const
+JSObject *Interpreter::builtinBooleanPrototype() const
{
return rep->builtinBooleanPrototype();
}
-ObjectImp *Interpreter::builtinStringPrototype() const
+JSObject *Interpreter::builtinStringPrototype() const
{
return rep->builtinStringPrototype();
}
-ObjectImp *Interpreter::builtinNumberPrototype() const
+JSObject *Interpreter::builtinNumberPrototype() const
{
return rep->builtinNumberPrototype();
}
-ObjectImp *Interpreter::builtinDatePrototype() const
+JSObject *Interpreter::builtinDatePrototype() const
{
return rep->builtinDatePrototype();
}
-ObjectImp *Interpreter::builtinRegExpPrototype() const
+JSObject *Interpreter::builtinRegExpPrototype() const
{
return rep->builtinRegExpPrototype();
}
-ObjectImp *Interpreter::builtinErrorPrototype() const
+JSObject *Interpreter::builtinErrorPrototype() const
{
return rep->builtinErrorPrototype();
}
-ObjectImp *Interpreter::builtinEvalError() const
+JSObject *Interpreter::builtinEvalError() const
{
return rep->builtinEvalError();
}
-ObjectImp *Interpreter::builtinRangeError() const
+JSObject *Interpreter::builtinRangeError() const
{
return rep->builtinRangeError();
}
-ObjectImp *Interpreter::builtinReferenceError() const
+JSObject *Interpreter::builtinReferenceError() const
{
return rep->builtinReferenceError();
}
-ObjectImp *Interpreter::builtinSyntaxError() const
+JSObject *Interpreter::builtinSyntaxError() const
{
return rep->builtinSyntaxError();
}
-ObjectImp *Interpreter::builtinTypeError() const
+JSObject *Interpreter::builtinTypeError() const
{
return rep->builtinTypeError();
}
-ObjectImp *Interpreter::builtinURIError() const
+JSObject *Interpreter::builtinURIError() const
{
return rep->builtinURIError();
}
-ObjectImp *Interpreter::builtinEvalErrorPrototype() const
+JSObject *Interpreter::builtinEvalErrorPrototype() const
{
return rep->builtinEvalErrorPrototype();
}
-ObjectImp *Interpreter::builtinRangeErrorPrototype() const
+JSObject *Interpreter::builtinRangeErrorPrototype() const
{
return rep->builtinRangeErrorPrototype();
}
-ObjectImp *Interpreter::builtinReferenceErrorPrototype() const
+JSObject *Interpreter::builtinReferenceErrorPrototype() const
{
return rep->builtinReferenceErrorPrototype();
}
-ObjectImp *Interpreter::builtinSyntaxErrorPrototype() const
+JSObject *Interpreter::builtinSyntaxErrorPrototype() const
{
return rep->builtinSyntaxErrorPrototype();
}
-ObjectImp *Interpreter::builtinTypeErrorPrototype() const
+JSObject *Interpreter::builtinTypeErrorPrototype() const
{
return rep->builtinTypeErrorPrototype();
}
-ObjectImp *Interpreter::builtinURIErrorPrototype() const
+JSObject *Interpreter::builtinURIErrorPrototype() const
{
return rep->builtinURIErrorPrototype();
}
@@ -321,7 +321,7 @@
}
-void *Interpreter::createLanguageInstanceForValue(ExecState *exec, int language, ObjectImp *value, const Bindings::RootObject *origin, const Bindings::RootObject *current)
+void *Interpreter::createLanguageInstanceForValue(ExecState *exec, int language, JSObject *value, const Bindings::RootObject *origin, const Bindings::RootObject *current)
{
return Bindings::Instance::createLanguageInstanceForValue (exec, (Bindings::Instance::BindingLanguage)language, value, origin, current);
}
1.31 +45 -45 JavaScriptCore/kjs/interpreter.h
Index: interpreter.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/interpreter.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- interpreter.h 11 Dec 2005 00:37:51 -0000 1.30
+++ interpreter.h 11 Dec 2005 02:05:44 -0000 1.31
@@ -31,7 +31,7 @@
class ContextImp;
class InterpreterImp;
- class RuntimeMethodImp;
+ class RuntimeMethod;
class ScopeChain;
namespace Bindings {
@@ -77,7 +77,7 @@
*
* @return The execution context's variable object
*/
- ObjectImp *variableObject() const;
+ JSObject *variableObject() const;
/**
* Returns the "this" value for the execution context. This is the value
@@ -94,7 +94,7 @@
*
* @return The execution context's "this" value
*/
- ObjectImp *thisValue() const;
+ JSObject *thisValue() const;
/**
* Returns the context from which the current context was invoked. For
@@ -151,7 +151,7 @@
*
* @param global The object to use as the global object for this interpreter
*/
- Interpreter(ObjectImp *global);
+ Interpreter(JSObject *global);
/**
* Creates a new interpreter. A global object will be created and
* initialized with the standard global properties.
@@ -163,7 +163,7 @@
* Returns the object that is used as the global object during all script
* execution performed by this interpreter
*/
- ObjectImp *globalObject() const;
+ JSObject *globalObject() const;
void initGlobalObject();
@@ -203,10 +203,10 @@
* execution. This should either be jsNull() or an Object.
* @return A completion object representing the result of the execution.
*/
- Completion evaluate(const UString &sourceURL, int startingLineNumber, const UString &code, ValueImp *thisV = NULL);
+ Completion evaluate(const UString &sourceURL, int startingLineNumber, const UString &code, JSValue *thisV = NULL);
// Overload of evaluate to keep JavaScriptGlue both source and binary compatible.
- Completion evaluate(const UString &code, ValueImp *thisV = NULL, const UString &sourceFilename = UString());
+ Completion evaluate(const UString &code, JSValue *thisV = NULL, const UString &sourceFilename = UString());
/**
* @internal
@@ -224,109 +224,109 @@
*
* @return The builtin "Object" object
*/
- ObjectImp *builtinObject() const;
+ JSObject *builtinObject() const;
/**
* Returns the builtin "Function" object.
*/
- ObjectImp *builtinFunction() const;
+ JSObject *builtinFunction() const;
/**
* Returns the builtin "Array" object.
*/
- ObjectImp *builtinArray() const;
+ JSObject *builtinArray() const;
/**
* Returns the builtin "Boolean" object.
*/
- ObjectImp *builtinBoolean() const;
+ JSObject *builtinBoolean() const;
/**
* Returns the builtin "String" object.
*/
- ObjectImp *builtinString() const;
+ JSObject *builtinString() const;
/**
* Returns the builtin "Number" object.
*/
- ObjectImp *builtinNumber() const;
+ JSObject *builtinNumber() const;
/**
* Returns the builtin "Date" object.
*/
- ObjectImp *builtinDate() const;
+ JSObject *builtinDate() const;
/**
* Returns the builtin "RegExp" object.
*/
- ObjectImp *builtinRegExp() const;
+ JSObject *builtinRegExp() const;
/**
* Returns the builtin "Error" object.
*/
- ObjectImp *builtinError() const;
+ JSObject *builtinError() const;
/**
* Returns the builtin "Object.prototype" object.
*/
- ObjectImp *builtinObjectPrototype() const;
+ JSObject *builtinObjectPrototype() const;
/**
* Returns the builtin "Function.prototype" object.
*/
- ObjectImp *builtinFunctionPrototype() const;
+ JSObject *builtinFunctionPrototype() const;
/**
* Returns the builtin "Array.prototype" object.
*/
- ObjectImp *builtinArrayPrototype() const;
+ JSObject *builtinArrayPrototype() const;
/**
* Returns the builtin "Boolean.prototype" object.
*/
- ObjectImp *builtinBooleanPrototype() const;
+ JSObject *builtinBooleanPrototype() const;
/**
* Returns the builtin "String.prototype" object.
*/
- ObjectImp *builtinStringPrototype() const;
+ JSObject *builtinStringPrototype() const;
/**
* Returns the builtin "Number.prototype" object.
*/
- ObjectImp *builtinNumberPrototype() const;
+ JSObject *builtinNumberPrototype() const;
/**
* Returns the builtin "Date.prototype" object.
*/
- ObjectImp *builtinDatePrototype() const;
+ JSObject *builtinDatePrototype() const;
/**
* Returns the builtin "RegExp.prototype" object.
*/
- ObjectImp *builtinRegExpPrototype() const;
+ JSObject *builtinRegExpPrototype() const;
/**
* Returns the builtin "Error.prototype" object.
*/
- ObjectImp *builtinErrorPrototype() const;
+ JSObject *builtinErrorPrototype() const;
/**
* The initial value of "Error" global property
*/
- ObjectImp *builtinEvalError() const;
- ObjectImp *builtinRangeError() const;
- ObjectImp *builtinReferenceError() const;
- ObjectImp *builtinSyntaxError() const;
- ObjectImp *builtinTypeError() const;
- ObjectImp *builtinURIError() const;
-
- ObjectImp *builtinEvalErrorPrototype() const;
- ObjectImp *builtinRangeErrorPrototype() const;
- ObjectImp *builtinReferenceErrorPrototype() const;
- ObjectImp *builtinSyntaxErrorPrototype() const;
- ObjectImp *builtinTypeErrorPrototype() const;
- ObjectImp *builtinURIErrorPrototype() const;
+ JSObject *builtinEvalError() const;
+ JSObject *builtinRangeError() const;
+ JSObject *builtinReferenceError() const;
+ JSObject *builtinSyntaxError() const;
+ JSObject *builtinTypeError() const;
+ JSObject *builtinURIError() const;
+
+ JSObject *builtinEvalErrorPrototype() const;
+ JSObject *builtinRangeErrorPrototype() const;
+ JSObject *builtinReferenceErrorPrototype() const;
+ JSObject *builtinSyntaxErrorPrototype() const;
+ JSObject *builtinTypeErrorPrototype() const;
+ JSObject *builtinURIErrorPrototype() const;
enum CompatMode { NativeMode, IECompat, NetscapeCompat };
/**
@@ -375,7 +375,7 @@
* is used to determine if an object is the Window object so we can perform
* security checks.
*/
- virtual bool isGlobalObject(ValueImp *v) { return false; }
+ virtual bool isGlobalObject(JSValue *v) { return false; }
/**
* Find the interpreter for a particular global object. This should really
@@ -384,7 +384,7 @@
* created in an application to correctly implement this method. The only
* override of this method is currently in WebCore.
*/
- virtual Interpreter *interpreterForGlobalObject (const ValueImp *imp) { return 0; }
+ virtual Interpreter *interpreterForGlobalObject (const JSValue *imp) { return 0; }
/**
* Determine if the it is 'safe' to execute code in the target interpreter from an
@@ -394,7 +394,7 @@
*/
virtual bool isSafeScript (const Interpreter *target) { return true; }
- virtual void *createLanguageInstanceForValue (ExecState *exec, int language, ObjectImp *value, const Bindings::RootObject *origin, const Bindings::RootObject *current);
+ virtual void *createLanguageInstanceForValue (ExecState *exec, int language, JSObject *value, const Bindings::RootObject *origin, const Bindings::RootObject *current);
#endif
// This is a workaround to avoid accessing the global variables for these identifiers in
@@ -435,7 +435,7 @@
friend class InterpreterImp;
friend class FunctionImp;
#if APPLE_CHANGES
- friend class RuntimeMethodImp;
+ friend class RuntimeMethod;
#endif
friend class GlobalFuncImp;
@@ -465,9 +465,9 @@
*/
Context context() const { return _context; }
- void setException(ValueImp *e) { _exception = e; }
+ void setException(JSValue *e) { _exception = e; }
void clearException() { _exception = NULL; }
- ValueImp *exception() const { return _exception; }
+ JSValue *exception() const { return _exception; }
bool hadException() const { return _exception; }
private:
@@ -475,7 +475,7 @@
: _interpreter(interp), _context(con), _exception(NULL) { }
Interpreter *_interpreter;
ContextImp *_context;
- ValueImp *_exception;
+ JSValue *_exception;
};
} // namespace
1.18 +8 -8 JavaScriptCore/kjs/list.cpp
Index: list.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/list.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- list.cpp 3 Oct 2005 21:11:49 -0000 1.17
+++ list.cpp 11 Dec 2005 02:05:44 -0000 1.18
@@ -41,10 +41,10 @@
{
ListImpState state;
int capacity;
- ValueImp **overflow;
+ JSValue **overflow;
union {
- ValueImp *values[inlineValuesSize];
+ JSValue *values[inlineValuesSize];
ListImp *nextInFreeList;
};
@@ -239,7 +239,7 @@
}
}
-ValueImp *List::at(int i) const
+JSValue *List::at(int i) const
{
ListImp *imp = static_cast<ListImp *>(_impBase);
if ((unsigned)i >= (unsigned)imp->size)
@@ -254,7 +254,7 @@
_impBase->size = 0;
}
-void List::append(ValueImp *v)
+void List::append(JSValue *v)
{
ListImp *imp = static_cast<ListImp *>(_impBase);
@@ -272,8 +272,8 @@
if (i >= imp->capacity) {
int newCapacity = i * 2;
- ValueImp **newOverflow = new ValueImp * [newCapacity - inlineValuesSize];
- ValueImp **oldOverflow = imp->overflow;
+ JSValue **newOverflow = new JSValue * [newCapacity - inlineValuesSize];
+ JSValue **oldOverflow = imp->overflow;
int oldOverflowSize = i - inlineValuesSize;
for (int j = 0; j != oldOverflowSize; j++)
newOverflow[j] = oldOverflow[j];
@@ -297,7 +297,7 @@
for (int i = 0; i != inlineSize; ++i)
copy.append(imp->values[i]);
- ValueImp **overflow = imp->overflow;
+ JSValue **overflow = imp->overflow;
int overflowSize = size - inlineSize;
for (int i = 0; i != overflowSize; ++i)
copy.append(overflow[i]);
@@ -318,7 +318,7 @@
for (int i = 1; i < inlineSize; ++i)
copy.append(imp->values[i]);
- ValueImp **overflow = imp->overflow;
+ JSValue **overflow = imp->overflow;
int overflowSize = size - inlineSize;
for (int i = 0; i < overflowSize; ++i)
copy.append(overflow[i]);
1.11 +9 -9 JavaScriptCore/kjs/list.h
Index: list.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/list.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- list.h 8 Aug 2005 04:07:28 -0000 1.10
+++ list.h 11 Dec 2005 02:05:44 -0000 1.11
@@ -62,7 +62,7 @@
*
* @param val Pointer to object.
*/
- void append(ValueImp *val);
+ void append(JSValue *val);
/**
* Remove all elements from the list.
*/
@@ -103,11 +103,11 @@
* @return Return the element at position i. KJS::Undefined if the
* index is out of range.
*/
- ValueImp *at(int i) const;
+ JSValue *at(int i) const;
/**
* Equivalent to at.
*/
- ValueImp *operator[](int i) const { return at(i); }
+ JSValue *operator[](int i) const { return at(i); }
/**
* Returns a pointer to a static instance of an empty list. Useful if a
@@ -143,25 +143,25 @@
* Dereference the iterator.
* @return A pointer to the element the iterator operates on.
*/
- ValueImp *operator->() const { return _list->at(_i); }
- ValueImp *operator*() const { return _list->at(_i); }
+ JSValue *operator->() const { return _list->at(_i); }
+ JSValue *operator*() const { return _list->at(_i); }
/**
* Prefix increment operator.
* @return The element after the increment.
*/
- ValueImp *operator++() { return _list->at(++_i); }
+ JSValue *operator++() { return _list->at(++_i); }
/**
* Postfix increment operator.
*/
- ValueImp *operator++(int) { return _list->at(_i++); }
+ JSValue *operator++(int) { return _list->at(_i++); }
/**
* Prefix decrement operator.
*/
- ValueImp *operator--() { return _list->at(--_i); }
+ JSValue *operator--() { return _list->at(--_i); }
/**
* Postfix decrement operator.
*/
- ValueImp *operator--(int) { return _list->at(_i--); }
+ JSValue *operator--(int) { return _list->at(_i--); }
/**
* Compare the iterator with another one.
* @return True if the two iterators operate on the same list element.
1.20 +21 -21 JavaScriptCore/kjs/lookup.h
Index: lookup.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/lookup.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- lookup.h 11 Dec 2005 00:37:51 -0000 1.19
+++ lookup.h 11 Dec 2005 02:05:45 -0000 1.20
@@ -127,16 +127,16 @@
* Helper for getStaticFunctionSlot and getStaticPropertySlot
*/
template <class FuncImp>
- inline ValueImp *staticFunctionGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ inline JSValue *staticFunctionGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
- // Look for cached value in dynamic map of properties (in ObjectImp)
- ObjectImp *thisObj = slot.slotBase();
- ValueImp *cachedVal = thisObj->getDirect(propertyName);
+ // Look for cached value in dynamic map of properties (in JSObject)
+ JSObject *thisObj = slot.slotBase();
+ JSValue *cachedVal = thisObj->getDirect(propertyName);
if (cachedVal)
return cachedVal;
const HashEntry *entry = slot.staticEntry();
- ValueImp *val = new FuncImp(exec, entry->value, entry->params);
+ JSValue *val = new FuncImp(exec, entry->value, entry->params);
thisObj->putDirect(propertyName, val, entry->attr);
return val;
}
@@ -146,7 +146,7 @@
* Helper for getStaticValueSlot and getStaticPropertySlot
*/
template <class ThisImp>
- inline ValueImp *staticValueGetter(ExecState *exec, const Identifier&, const PropertySlot& slot)
+ inline JSValue *staticValueGetter(ExecState *exec, const Identifier&, const PropertySlot& slot)
{
ThisImp *thisObj = static_cast<ThisImp *>(slot.slotBase());
const HashEntry *entry = slot.staticEntry();
@@ -197,7 +197,7 @@
*/
template <class FuncImp, class ParentImp>
inline bool getStaticFunctionSlot(ExecState *exec, const HashTable *table,
- ObjectImp* thisObj, const Identifier& propertyName, PropertySlot& slot)
+ JSObject* thisObj, const Identifier& propertyName, PropertySlot& slot)
{
const HashEntry* entry = Lookup::findEntry(table, propertyName);
@@ -235,7 +235,7 @@
*/
template <class ThisImp, class ParentImp>
inline void lookupPut(ExecState *exec, const Identifier &propertyName,
- ValueImp *value, int attr,
+ JSValue *value, int attr,
const HashTable* table, ThisImp* thisObj)
{
const HashEntry* entry = Lookup::findEntry(table, propertyName);
@@ -243,7 +243,7 @@
if (!entry) // not found: forward to parent
thisObj->ParentImp::put(exec, propertyName, value, attr);
else if (entry->attr & Function) // function: put as override property
- thisObj->ObjectImp::put(exec, propertyName, value, attr);
+ thisObj->JSObject::put(exec, propertyName, value, attr);
else if (entry->attr & ReadOnly) // readonly! Can't put!
#ifdef KJS_VERBOSE
fprintf(stderr,"WARNING: Attempt to change value of readonly property '%s'\n",propertyName.ascii());
@@ -262,15 +262,15 @@
* that cached object. Note that the object constructor must take 1 argument, exec.
*/
template <class ClassCtor>
- inline ObjectImp *cacheGlobalObject(ExecState *exec, const Identifier &propertyName)
+ inline JSObject *cacheGlobalObject(ExecState *exec, const Identifier &propertyName)
{
- ObjectImp *globalObject = static_cast<ObjectImp *>(exec->lexicalInterpreter()->globalObject());
- ValueImp *obj = globalObject->getDirect(propertyName);
+ JSObject *globalObject = static_cast<JSObject *>(exec->lexicalInterpreter()->globalObject());
+ JSValue *obj = globalObject->getDirect(propertyName);
if (obj) {
assert(obj->isObject());
- return static_cast<ObjectImp *>(obj);
+ return static_cast<JSObject *>(obj);
}
- ObjectImp *newObject = new ClassCtor(exec);
+ JSObject *newObject = new ClassCtor(exec);
globalObject->put(exec, propertyName, newObject, Internal);
return newObject;
}
@@ -292,16 +292,16 @@
* then the last line will use IMPLEMENT_PROTOTYPE_WITH_PARENT, with DOMNodeProto as last argument.
*/
#define DEFINE_PROTOTYPE(ClassName,ClassProto) \
- class ClassProto : public ObjectImp { \
- friend ObjectImp *cacheGlobalObject<ClassProto>(ExecState *exec, const Identifier &propertyName); \
+ class ClassProto : public JSObject { \
+ friend JSObject *cacheGlobalObject<ClassProto>(ExecState *exec, const Identifier &propertyName); \
public: \
- static ObjectImp *self(ExecState *exec) \
+ static JSObject *self(ExecState *exec) \
{ \
return cacheGlobalObject<ClassProto>(exec, "[[" ClassName ".prototype]]"); \
} \
protected: \
ClassProto( ExecState *exec ) \
- : ObjectImp( exec->lexicalInterpreter()->builtinObjectPrototype() ) {} \
+ : JSObject( exec->lexicalInterpreter()->builtinObjectPrototype() ) {} \
\
public: \
virtual const ClassInfo *classInfo() const { return &info; } \
@@ -313,13 +313,13 @@
#define IMPLEMENT_PROTOTYPE(ClassProto,ClassFunc) \
bool ClassProto::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) \
{ \
- return getStaticFunctionSlot<ClassFunc,ObjectImp>(exec, &ClassProto##Table, this, propertyName, slot); \
+ return getStaticFunctionSlot<ClassFunc,JSObject>(exec, &ClassProto##Table, this, propertyName, slot); \
}
#define IMPLEMENT_PROTOTYPE_WITH_PARENT(ClassProto,ClassFunc,ParentProto) \
bool ClassProto::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) \
{ \
- if (getStaticFunctionSlot<ClassFunc,ObjectImp>(exec, &ClassProto##Table, this, propertyName, slot)) \
+ if (getStaticFunctionSlot<ClassFunc,JSObject>(exec, &ClassProto##Table, this, propertyName, slot)) \
return true; \
return ParentProto::self(exec)->getOwnPropertySlot(exec, propertyName, slot); \
}
@@ -332,7 +332,7 @@
put(exec, lengthPropertyName, jsNumber(len), DontDelete|ReadOnly|DontEnum); \
} \
/* Macro user needs to implement the callAsFunction function. */ \
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args); \
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args); \
private: \
int id; \
};
1.22 +6 -6 JavaScriptCore/kjs/math_object.cpp
Index: math_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/math_object.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- math_object.cpp 11 Dec 2005 00:37:51 -0000 1.21
+++ math_object.cpp 11 Dec 2005 02:05:45 -0000 1.22
@@ -101,8 +101,8 @@
*/
MathObjectImp::MathObjectImp(ExecState * /*exec*/,
- ObjectPrototypeImp *objProto)
- : ObjectImp(objProto)
+ ObjectPrototype *objProto)
+ : JSObject(objProto)
{
}
@@ -110,10 +110,10 @@
bool MathObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot)
{
- return getStaticPropertySlot<MathFuncImp, MathObjectImp, ObjectImp>(exec, &mathTable, this, propertyName, slot);
+ return getStaticPropertySlot<MathFuncImp, MathObjectImp, JSObject>(exec, &mathTable, this, propertyName, slot);
}
-ValueImp *MathObjectImp::getValueProperty(ExecState *, int token) const
+JSValue *MathObjectImp::getValueProperty(ExecState *, int token) const
{
double d = -42; // ;)
switch (token) {
@@ -152,7 +152,7 @@
MathFuncImp::MathFuncImp(ExecState *exec, int i, int l)
: InternalFunctionImp(
- static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
+ static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
), id(i)
{
putDirect(lengthPropertyName, l, DontDelete|ReadOnly|DontEnum);
@@ -163,7 +163,7 @@
return true;
}
-ValueImp *MathFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *MathFuncImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
double arg = args[0]->toNumber(exec);
double arg2 = args[1]->toNumber(exec);
1.9 +4 -4 JavaScriptCore/kjs/math_object.h
Index: math_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/math_object.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- math_object.h 8 Aug 2005 04:07:28 -0000 1.8
+++ math_object.h 11 Dec 2005 02:05:45 -0000 1.9
@@ -27,12 +27,12 @@
namespace KJS {
- class MathObjectImp : public ObjectImp {
+ class MathObjectImp : public JSObject {
public:
MathObjectImp(ExecState *exec,
- ObjectPrototypeImp *objProto);
+ ObjectPrototype *objProto);
bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
enum { Euler, Ln2, Ln10, Log2E, Log10E, Pi, Sqrt1_2, Sqrt2,
@@ -44,7 +44,7 @@
public:
MathFuncImp(ExecState *exec, int i, int l);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
private:
int id;
};
1.90 +218 -218 JavaScriptCore/kjs/nodes.cpp
Index: nodes.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/nodes.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- nodes.cpp 11 Dec 2005 00:37:51 -0000 1.89
+++ nodes.cpp 11 Dec 2005 02:05:45 -0000 1.90
@@ -60,7 +60,7 @@
#define KJS_CHECKEXCEPTION \
if (exec->hadException()) { \
setExceptionDetailsIfNeeded(exec); \
- ValueImp *ex = exec->exception(); \
+ JSValue *ex = exec->exception(); \
exec->clearException(); \
return Completion(Throw, ex); \
} \
@@ -116,12 +116,12 @@
return Completion(Throw, Error::create(exec, e, message, lineNo(), sourceId(), &sourceURL));
}
-ValueImp *Node::throwError(ExecState *exec, ErrorType e, const char *msg)
+JSValue *Node::throwError(ExecState *exec, ErrorType e, const char *msg)
{
return KJS::throwError(exec, e, msg, lineNo(), sourceId(), &sourceURL);
}
-ValueImp *Node::throwError(ExecState *exec, ErrorType e, const char *msg, ValueImp *v, Node *expr)
+JSValue *Node::throwError(ExecState *exec, ErrorType e, const char *msg, JSValue *v, Node *expr)
{
UString message = msg;
substitute(message, v->toString(exec));
@@ -130,14 +130,14 @@
}
-ValueImp *Node::throwError(ExecState *exec, ErrorType e, const char *msg, const Identifier &label)
+JSValue *Node::throwError(ExecState *exec, ErrorType e, const char *msg, const Identifier &label)
{
UString message = msg;
substitute(message, label.ustring());
return KJS::throwError(exec, e, message, lineNo(), sourceId(), &sourceURL);
}
-ValueImp *Node::throwError(ExecState *exec, ErrorType e, const char *msg, ValueImp *v, Node *e1, Node *e2)
+JSValue *Node::throwError(ExecState *exec, ErrorType e, const char *msg, JSValue *v, Node *e1, Node *e2)
{
UString message = msg;
substitute(message, v->toString(exec));
@@ -146,7 +146,7 @@
return KJS::throwError(exec, e, message, lineNo(), sourceId(), &sourceURL);
}
-ValueImp *Node::throwError(ExecState *exec, ErrorType e, const char *msg, ValueImp *v, Node *expr, const Identifier &label)
+JSValue *Node::throwError(ExecState *exec, ErrorType e, const char *msg, JSValue *v, Node *expr, const Identifier &label)
{
UString message = msg;
substitute(message, v->toString(exec));
@@ -155,7 +155,7 @@
return KJS::throwError(exec, e, message, lineNo(), sourceId(), &sourceURL);
}
-ValueImp *Node::throwError(ExecState *exec, ErrorType e, const char *msg, ValueImp *v, const Identifier &label)
+JSValue *Node::throwError(ExecState *exec, ErrorType e, const char *msg, JSValue *v, const Identifier &label)
{
UString message = msg;
substitute(message, v->toString(exec));
@@ -163,16 +163,16 @@
return KJS::throwError(exec, e, message, lineNo(), sourceId(), &sourceURL);
}
-ValueImp *Node::throwUndefinedVariableError(ExecState *exec, const Identifier &ident)
+JSValue *Node::throwUndefinedVariableError(ExecState *exec, const Identifier &ident)
{
return throwError(exec, ReferenceError, "Can't find variable: %s", ident);
}
void Node::setExceptionDetailsIfNeeded(ExecState *exec)
{
- ValueImp *exceptionValue = exec->exception();
+ JSValue *exceptionValue = exec->exception();
if (exceptionValue->isObject()) {
- ObjectImp *exception = static_cast<ObjectImp *>(exceptionValue);
+ JSObject *exception = static_cast<JSObject *>(exceptionValue);
if (!exception->hasProperty(exec, "line") && !exception->hasProperty(exec, "sourceURL")) {
exception->put(exec, "line", jsNumber(line));
exception->put(exec, "sourceURL", jsString(sourceURL));
@@ -214,48 +214,48 @@
// ------------------------------ NullNode -------------------------------------
-ValueImp *NullNode::evaluate(ExecState *)
+JSValue *NullNode::evaluate(ExecState *)
{
return jsNull();
}
// ------------------------------ BooleanNode ----------------------------------
-ValueImp *BooleanNode::evaluate(ExecState *)
+JSValue *BooleanNode::evaluate(ExecState *)
{
return jsBoolean(value);
}
// ------------------------------ NumberNode -----------------------------------
-ValueImp *NumberNode::evaluate(ExecState *)
+JSValue *NumberNode::evaluate(ExecState *)
{
return jsNumber(value);
}
// ------------------------------ StringNode -----------------------------------
-ValueImp *StringNode::evaluate(ExecState *)
+JSValue *StringNode::evaluate(ExecState *)
{
return jsString(value);
}
// ------------------------------ RegExpNode -----------------------------------
-ValueImp *RegExpNode::evaluate(ExecState *exec)
+JSValue *RegExpNode::evaluate(ExecState *exec)
{
List list;
list.append(jsString(pattern));
list.append(jsString(flags));
- ObjectImp *reg = exec->lexicalInterpreter()->imp()->builtinRegExp();
+ JSObject *reg = exec->lexicalInterpreter()->imp()->builtinRegExp();
return reg->construct(exec,list);
}
// ------------------------------ ThisNode -------------------------------------
// ECMA 11.1.1
-ValueImp *ThisNode::evaluate(ExecState *exec)
+JSValue *ThisNode::evaluate(ExecState *exec)
{
return exec->context().imp()->thisValue();
}
@@ -263,7 +263,7 @@
// ------------------------------ ResolveNode ----------------------------------
// ECMA 11.1.2 & 10.1.4
-ValueImp *ResolveNode::evaluate(ExecState *exec)
+JSValue *ResolveNode::evaluate(ExecState *exec)
{
const ScopeChain& chain = exec->context().imp()->scopeChain();
ScopeChainIterator iter = chain.begin();
@@ -274,7 +274,7 @@
PropertySlot slot;
do {
- ObjectImp *o = *iter;
+ JSObject *o = *iter;
if (o->getPropertySlot(exec, ident, slot))
return slot.getValue(exec, ident);
@@ -288,7 +288,7 @@
// ------------------------------ GroupNode ------------------------------------
// ECMA 11.1.6
-ValueImp *GroupNode::evaluate(ExecState *exec)
+JSValue *GroupNode::evaluate(ExecState *exec)
{
return group->evaluate(exec);
}
@@ -305,12 +305,12 @@
// ------------------------------ ElementNode ----------------------------------
// ECMA 11.1.4
-ValueImp *ElementNode::evaluate(ExecState *exec)
+JSValue *ElementNode::evaluate(ExecState *exec)
{
- ObjectImp *array = exec->lexicalInterpreter()->builtinArray()->construct(exec, List::empty());
+ JSObject *array = exec->lexicalInterpreter()->builtinArray()->construct(exec, List::empty());
int length = 0;
for (ElementNode *n = this; n; n = n->list.get()) {
- ValueImp *val = n->node->evaluate(exec);
+ JSValue *val = n->node->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
length += n->elision;
array->put(exec, length++, val);
@@ -321,18 +321,18 @@
// ------------------------------ ArrayNode ------------------------------------
// ECMA 11.1.4
-ValueImp *ArrayNode::evaluate(ExecState *exec)
+JSValue *ArrayNode::evaluate(ExecState *exec)
{
- ObjectImp *array;
+ JSObject *array;
int length;
if (element) {
- array = static_cast<ObjectImp*>(element->evaluate(exec));
+ array = static_cast<JSObject*>(element->evaluate(exec));
KJS_CHECKEXCEPTIONVALUE
length = opt ? array->get(exec,lengthPropertyName)->toInt32(exec) : 0;
} else {
- ValueImp *newArr = exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty());
- array = static_cast<ObjectImp*>(newArr);
+ JSValue *newArr = exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty());
+ array = static_cast<JSObject*>(newArr);
length = 0;
}
@@ -345,7 +345,7 @@
// ------------------------------ ObjectLiteralNode ----------------------------
// ECMA 11.1.5
-ValueImp *ObjectLiteralNode::evaluate(ExecState *exec)
+JSValue *ObjectLiteralNode::evaluate(ExecState *exec)
{
if (list)
return list->evaluate(exec);
@@ -356,14 +356,14 @@
// ------------------------------ PropertyValueNode ----------------------------
// ECMA 11.1.5
-ValueImp *PropertyValueNode::evaluate(ExecState *exec)
+JSValue *PropertyValueNode::evaluate(ExecState *exec)
{
- ObjectImp *obj = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
+ JSObject *obj = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
for (PropertyValueNode *p = this; p; p = p->list.get()) {
- ValueImp *n = p->name->evaluate(exec);
+ JSValue *n = p->name->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v = p->assign->evaluate(exec);
+ JSValue *v = p->assign->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
obj->put(exec, Identifier(n->toString(exec)), v);
@@ -375,9 +375,9 @@
// ------------------------------ PropertyNode ---------------------------------
// ECMA 11.1.5
-ValueImp *PropertyNode::evaluate(ExecState *)
+JSValue *PropertyNode::evaluate(ExecState *)
{
- ValueImp *s;
+ JSValue *s;
if (str.isNull()) {
s = jsString(UString::from(numeric));
@@ -391,13 +391,13 @@
// ------------------------------ BracketAccessorNode --------------------------------
// ECMA 11.2.1a
-ValueImp *BracketAccessorNode::evaluate(ExecState *exec)
+JSValue *BracketAccessorNode::evaluate(ExecState *exec)
{
- ValueImp *v1 = expr1->evaluate(exec);
+ JSValue *v1 = expr1->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = expr2->evaluate(exec);
+ JSValue *v2 = expr2->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *o = v1->toObject(exec);
+ JSObject *o = v1->toObject(exec);
uint32_t i;
if (v2->getUInt32(i))
return o->get(exec, i);
@@ -407,9 +407,9 @@
// ------------------------------ DotAccessorNode --------------------------------
// ECMA 11.2.1b
-ValueImp *DotAccessorNode::evaluate(ExecState *exec)
+JSValue *DotAccessorNode::evaluate(ExecState *exec)
{
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return v->toObject(exec)->get(exec, ident);
@@ -417,7 +417,7 @@
// ------------------------------ ArgumentListNode -----------------------------
-ValueImp *ArgumentListNode::evaluate(ExecState *)
+JSValue *ArgumentListNode::evaluate(ExecState *)
{
assert(0);
return 0; // dummy, see evaluateList()
@@ -429,7 +429,7 @@
List l;
for (ArgumentListNode *n = this; n; n = n->list.get()) {
- ValueImp *v = n->expr->evaluate(exec);
+ JSValue *v = n->expr->evaluate(exec);
KJS_CHECKEXCEPTIONLIST
l.append(v);
}
@@ -439,7 +439,7 @@
// ------------------------------ ArgumentsNode --------------------------------
-ValueImp *ArgumentsNode::evaluate(ExecState *)
+JSValue *ArgumentsNode::evaluate(ExecState *)
{
assert(0);
return 0; // dummy, see evaluateList()
@@ -458,9 +458,9 @@
// ECMA 11.2.2
-ValueImp *NewExprNode::evaluate(ExecState *exec)
+JSValue *NewExprNode::evaluate(ExecState *exec)
{
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
List argList;
@@ -473,7 +473,7 @@
return throwError(exec, TypeError, "Value %s (result of expression %s) is not an object. Cannot be used with new.", v, expr.get());
}
- ObjectImp *constr = static_cast<ObjectImp*>(v);
+ JSObject *constr = static_cast<JSObject*>(v);
if (!constr->implementsConstruct()) {
return throwError(exec, TypeError, "Value %s (result of expression %s) is not a constructor. Cannot be used with new.", v, expr.get());
}
@@ -482,16 +482,16 @@
}
// ECMA 11.2.3
-ValueImp *FunctionCallValueNode::evaluate(ExecState *exec)
+JSValue *FunctionCallValueNode::evaluate(ExecState *exec)
{
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
if (!v->isObject()) {
return throwError(exec, TypeError, "Value %s (result of expression %s) is not object.", v, expr.get());
}
- ObjectImp *func = static_cast<ObjectImp*>(v);
+ JSObject *func = static_cast<JSObject*>(v);
if (!func->implementsCall()) {
return throwError(exec, TypeError, "Object %s (result of expression %s) does not allow calls.", v, expr.get());
@@ -500,13 +500,13 @@
List argList = args->evaluateList(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *thisObj = exec->dynamicInterpreter()->globalObject();
+ JSObject *thisObj = exec->dynamicInterpreter()->globalObject();
return func->call(exec, thisObj, argList);
}
// ECMA 11.2.3
-ValueImp *FunctionCallResolveNode::evaluate(ExecState *exec)
+JSValue *FunctionCallResolveNode::evaluate(ExecState *exec)
{
const ScopeChain& chain = exec->context().imp()->scopeChain();
ScopeChainIterator iter = chain.begin();
@@ -516,18 +516,18 @@
assert(iter != end);
PropertySlot slot;
- ObjectImp *base;
+ JSObject *base;
do {
base = *iter;
if (base->getPropertySlot(exec, ident, slot)) {
- ValueImp *v = slot.getValue(exec, ident);
+ JSValue *v = slot.getValue(exec, ident);
KJS_CHECKEXCEPTIONVALUE
if (!v->isObject()) {
return throwError(exec, TypeError, "Value %s (result of expression %s) is not object.", v, ident);
}
- ObjectImp *func = static_cast<ObjectImp*>(v);
+ JSObject *func = static_cast<JSObject*>(v);
if (!func->implementsCall()) {
return throwError(exec, TypeError, "Object %s (result of expression %s) does not allow calls.", v, ident);
@@ -536,7 +536,7 @@
List argList = args->evaluateList(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *thisObj = base;
+ JSObject *thisObj = base;
// ECMA 11.2.3 says that in this situation the this value should be null.
// However, section 10.2.3 says that in the case where the value provided
// by the caller is null, the global object should be used. It also says
@@ -555,18 +555,18 @@
}
// ECMA 11.2.3
-ValueImp *FunctionCallBracketNode::evaluate(ExecState *exec)
+JSValue *FunctionCallBracketNode::evaluate(ExecState *exec)
{
- ValueImp *baseVal = base->evaluate(exec);
+ JSValue *baseVal = base->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *subscriptVal = subscript->evaluate(exec);
+ JSValue *subscriptVal = subscript->evaluate(exec);
- ObjectImp *baseObj = baseVal->toObject(exec);
+ JSObject *baseObj = baseVal->toObject(exec);
uint32_t i;
PropertySlot slot;
- ValueImp *funcVal;
+ JSValue *funcVal;
if (subscriptVal->getUInt32(i)) {
if (baseObj->getPropertySlot(exec, i, slot))
funcVal = slot.getValue(exec, i);
@@ -586,7 +586,7 @@
return throwError(exec, TypeError, "Value %s (result of expression %s[%s]) is not object.", funcVal, base.get(), subscript.get());
}
- ObjectImp *func = static_cast<ObjectImp*>(funcVal);
+ JSObject *func = static_cast<JSObject*>(funcVal);
if (!func->implementsCall()) {
return throwError(exec, TypeError, "Object %s (result of expression %s[%s]) does not allow calls.", funcVal, base.get(), subscript.get());
@@ -595,7 +595,7 @@
List argList = args->evaluateList(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *thisObj = baseObj;
+ JSObject *thisObj = baseObj;
assert(thisObj);
assert(thisObj->isObject());
assert(!thisObj->isActivation());
@@ -614,19 +614,19 @@
}
// ECMA 11.2.3
-ValueImp *FunctionCallDotNode::evaluate(ExecState *exec)
+JSValue *FunctionCallDotNode::evaluate(ExecState *exec)
{
- ValueImp *baseVal = base->evaluate(exec);
+ JSValue *baseVal = base->evaluate(exec);
- ObjectImp *baseObj = baseVal->toObject(exec);
+ JSObject *baseObj = baseVal->toObject(exec);
PropertySlot slot;
- ValueImp *funcVal = baseObj->getPropertySlot(exec, ident, slot) ? slot.getValue(exec, ident) : jsUndefined();
+ JSValue *funcVal = baseObj->getPropertySlot(exec, ident, slot) ? slot.getValue(exec, ident) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
if (!funcVal->isObject())
return throwError(exec, TypeError, dotExprNotAnObjectString(), funcVal, base.get(), ident);
- ObjectImp *func = static_cast<ObjectImp*>(funcVal);
+ JSObject *func = static_cast<JSObject*>(funcVal);
if (!func->implementsCall())
return throwError(exec, TypeError, dotExprDoesNotAllowCallsString(), funcVal, base.get(), ident);
@@ -634,7 +634,7 @@
List argList = args->evaluateList(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *thisObj = baseObj;
+ JSObject *thisObj = baseObj;
assert(thisObj);
assert(thisObj->isObject());
assert(!thisObj->isActivation());
@@ -646,7 +646,7 @@
// ------------------------------ PostfixResolveNode ----------------------------------
-ValueImp *PostfixResolveNode::evaluate(ExecState *exec)
+JSValue *PostfixResolveNode::evaluate(ExecState *exec)
{
const ScopeChain& chain = exec->context().imp()->scopeChain();
ScopeChainIterator iter = chain.begin();
@@ -656,11 +656,11 @@
assert(iter != end);
PropertySlot slot;
- ObjectImp *base;
+ JSObject *base;
do {
base = *iter;
if (base->getPropertySlot(exec, m_ident, slot)) {
- ValueImp *v = slot.getValue(exec, m_ident);
+ JSValue *v = slot.getValue(exec, m_ident);
double n = v->toNumber(exec);
@@ -678,19 +678,19 @@
// ------------------------------ PostfixBracketNode ----------------------------------
-ValueImp *PostfixBracketNode::evaluate(ExecState *exec)
+JSValue *PostfixBracketNode::evaluate(ExecState *exec)
{
- ValueImp *baseValue = m_base->evaluate(exec);
+ JSValue *baseValue = m_base->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *subscript = m_subscript->evaluate(exec);
+ JSValue *subscript = m_subscript->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *base = baseValue->toObject(exec);
+ JSObject *base = baseValue->toObject(exec);
uint32_t propertyIndex;
if (subscript->getUInt32(propertyIndex)) {
PropertySlot slot;
- ValueImp *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();
+ JSValue *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
double n = v->toNumber(exec);
@@ -703,7 +703,7 @@
Identifier propertyName(subscript->toString(exec));
PropertySlot slot;
- ValueImp *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();
+ JSValue *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
double n = v->toNumber(exec);
@@ -716,14 +716,14 @@
// ------------------------------ PostfixDotNode ----------------------------------
-ValueImp *PostfixDotNode::evaluate(ExecState *exec)
+JSValue *PostfixDotNode::evaluate(ExecState *exec)
{
- ValueImp *baseValue = m_base->evaluate(exec);
+ JSValue *baseValue = m_base->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *base = baseValue->toObject(exec);
+ JSObject *base = baseValue->toObject(exec);
PropertySlot slot;
- ValueImp *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();
+ JSValue *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
double n = v->toNumber(exec);
@@ -737,7 +737,7 @@
// ECMA 11.4.1
// ------------------------------ DeleteResolveNode -----------------------------------
-ValueImp *DeleteResolveNode::evaluate(ExecState *exec)
+JSValue *DeleteResolveNode::evaluate(ExecState *exec)
{
const ScopeChain& chain = exec->context().imp()->scopeChain();
ScopeChainIterator iter = chain.begin();
@@ -747,7 +747,7 @@
assert(iter != end);
PropertySlot slot;
- ObjectImp *base;
+ JSObject *base;
do {
base = *iter;
if (base->getPropertySlot(exec, m_ident, slot)) {
@@ -761,14 +761,14 @@
}
// ------------------------------ DeleteBracketNode -----------------------------------
-ValueImp *DeleteBracketNode::evaluate(ExecState *exec)
+JSValue *DeleteBracketNode::evaluate(ExecState *exec)
{
- ValueImp *baseValue = m_base->evaluate(exec);
+ JSValue *baseValue = m_base->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *subscript = m_subscript->evaluate(exec);
+ JSValue *subscript = m_subscript->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *base = baseValue->toObject(exec);
+ JSObject *base = baseValue->toObject(exec);
uint32_t propertyIndex;
if (subscript->getUInt32(propertyIndex))
@@ -779,17 +779,17 @@
}
// ------------------------------ DeleteDotNode -----------------------------------
-ValueImp *DeleteDotNode::evaluate(ExecState *exec)
+JSValue *DeleteDotNode::evaluate(ExecState *exec)
{
- ValueImp *baseValue = m_base->evaluate(exec);
- ObjectImp *base = baseValue->toObject(exec);
+ JSValue *baseValue = m_base->evaluate(exec);
+ JSObject *base = baseValue->toObject(exec);
KJS_CHECKEXCEPTIONVALUE
return jsBoolean(base->deleteProperty(exec, m_ident));
}
// ------------------------------ DeleteValueNode -----------------------------------
-ValueImp *DeleteValueNode::evaluate(ExecState *exec)
+JSValue *DeleteValueNode::evaluate(ExecState *exec)
{
m_expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
@@ -801,7 +801,7 @@
// ------------------------------ VoidNode -------------------------------------
// ECMA 11.4.2
-ValueImp *VoidNode::evaluate(ExecState *exec)
+JSValue *VoidNode::evaluate(ExecState *exec)
{
expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
@@ -813,7 +813,7 @@
// ------------------------------ TypeOfValueNode -----------------------------------
-static ValueImp *typeStringForValue(ValueImp *v)
+static JSValue *typeStringForValue(JSValue *v)
{
switch (v->type()) {
case UndefinedType:
@@ -827,14 +827,14 @@
case StringType:
return jsString("string");
default:
- if (v->isObject() && static_cast<ObjectImp*>(v)->implementsCall())
+ if (v->isObject() && static_cast<JSObject*>(v)->implementsCall())
return jsString("function");
else
return jsString("object");
}
}
-ValueImp *TypeOfResolveNode::evaluate(ExecState *exec)
+JSValue *TypeOfResolveNode::evaluate(ExecState *exec)
{
const ScopeChain& chain = exec->context().imp()->scopeChain();
ScopeChainIterator iter = chain.begin();
@@ -844,11 +844,11 @@
assert(iter != end);
PropertySlot slot;
- ObjectImp *base;
+ JSObject *base;
do {
base = *iter;
if (base->getPropertySlot(exec, m_ident, slot)) {
- ValueImp *v = slot.getValue(exec, m_ident);
+ JSValue *v = slot.getValue(exec, m_ident);
return typeStringForValue(v);
}
@@ -860,9 +860,9 @@
// ------------------------------ TypeOfValueNode -----------------------------------
-ValueImp *TypeOfValueNode::evaluate(ExecState *exec)
+JSValue *TypeOfValueNode::evaluate(ExecState *exec)
{
- ValueImp *v = m_expr->evaluate(exec);
+ JSValue *v = m_expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return typeStringForValue(v);
@@ -872,7 +872,7 @@
// ------------------------------ PrefixResolveNode ----------------------------------
-ValueImp *PrefixResolveNode::evaluate(ExecState *exec)
+JSValue *PrefixResolveNode::evaluate(ExecState *exec)
{
const ScopeChain& chain = exec->context().imp()->scopeChain();
ScopeChainIterator iter = chain.begin();
@@ -882,16 +882,16 @@
assert(iter != end);
PropertySlot slot;
- ObjectImp *base;
+ JSObject *base;
do {
base = *iter;
if (base->getPropertySlot(exec, m_ident, slot)) {
- ValueImp *v = slot.getValue(exec, m_ident);
+ JSValue *v = slot.getValue(exec, m_ident);
double n = v->toNumber(exec);
double newValue = (m_oper == OpPlusPlus) ? n + 1 : n - 1;
- ValueImp *n2 = jsNumber(newValue);
+ JSValue *n2 = jsNumber(newValue);
base->put(exec, m_ident, n2);
return n2;
@@ -905,25 +905,25 @@
// ------------------------------ PrefixBracketNode ----------------------------------
-ValueImp *PrefixBracketNode::evaluate(ExecState *exec)
+JSValue *PrefixBracketNode::evaluate(ExecState *exec)
{
- ValueImp *baseValue = m_base->evaluate(exec);
+ JSValue *baseValue = m_base->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *subscript = m_subscript->evaluate(exec);
+ JSValue *subscript = m_subscript->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *base = baseValue->toObject(exec);
+ JSObject *base = baseValue->toObject(exec);
uint32_t propertyIndex;
if (subscript->getUInt32(propertyIndex)) {
PropertySlot slot;
- ValueImp *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();
+ JSValue *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
double n = v->toNumber(exec);
double newValue = (m_oper == OpPlusPlus) ? n + 1 : n - 1;
- ValueImp *n2 = jsNumber(newValue);
+ JSValue *n2 = jsNumber(newValue);
base->put(exec, propertyIndex, n2);
return n2;
@@ -931,13 +931,13 @@
Identifier propertyName(subscript->toString(exec));
PropertySlot slot;
- ValueImp *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();
+ JSValue *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
double n = v->toNumber(exec);
double newValue = (m_oper == OpPlusPlus) ? n + 1 : n - 1;
- ValueImp *n2 = jsNumber(newValue);
+ JSValue *n2 = jsNumber(newValue);
base->put(exec, propertyName, n2);
return n2;
@@ -945,20 +945,20 @@
// ------------------------------ PrefixDotNode ----------------------------------
-ValueImp *PrefixDotNode::evaluate(ExecState *exec)
+JSValue *PrefixDotNode::evaluate(ExecState *exec)
{
- ValueImp *baseValue = m_base->evaluate(exec);
+ JSValue *baseValue = m_base->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *base = baseValue->toObject(exec);
+ JSObject *base = baseValue->toObject(exec);
PropertySlot slot;
- ValueImp *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();
+ JSValue *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
double n = v->toNumber(exec);
double newValue = (m_oper == OpPlusPlus) ? n + 1 : n - 1;
- ValueImp *n2 = jsNumber(newValue);
+ JSValue *n2 = jsNumber(newValue);
base->put(exec, m_ident, n2);
return n2;
@@ -967,9 +967,9 @@
// ------------------------------ UnaryPlusNode --------------------------------
// ECMA 11.4.6
-ValueImp *UnaryPlusNode::evaluate(ExecState *exec)
+JSValue *UnaryPlusNode::evaluate(ExecState *exec)
{
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return jsNumber(v->toNumber(exec));
@@ -978,9 +978,9 @@
// ------------------------------ NegateNode -----------------------------------
// ECMA 11.4.7
-ValueImp *NegateNode::evaluate(ExecState *exec)
+JSValue *NegateNode::evaluate(ExecState *exec)
{
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
double n = v->toNumber(exec);
@@ -990,9 +990,9 @@
// ------------------------------ BitwiseNotNode -------------------------------
// ECMA 11.4.8
-ValueImp *BitwiseNotNode::evaluate(ExecState *exec)
+JSValue *BitwiseNotNode::evaluate(ExecState *exec)
{
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return jsNumber(~v->toInt32(exec));
}
@@ -1000,9 +1000,9 @@
// ------------------------------ LogicalNotNode -------------------------------
// ECMA 11.4.9
-ValueImp *LogicalNotNode::evaluate(ExecState *exec)
+JSValue *LogicalNotNode::evaluate(ExecState *exec)
{
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return jsBoolean(!v->toBoolean(exec));
}
@@ -1010,12 +1010,12 @@
// ------------------------------ MultNode -------------------------------------
// ECMA 11.5
-ValueImp *MultNode::evaluate(ExecState *exec)
+JSValue *MultNode::evaluate(ExecState *exec)
{
- ValueImp *v1 = term1->evaluate(exec);
+ JSValue *v1 = term1->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = term2->evaluate(exec);
+ JSValue *v2 = term2->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return mult(exec, v1, v2, oper);
@@ -1024,12 +1024,12 @@
// ------------------------------ AddNode --------------------------------------
// ECMA 11.6
-ValueImp *AddNode::evaluate(ExecState *exec)
+JSValue *AddNode::evaluate(ExecState *exec)
{
- ValueImp *v1 = term1->evaluate(exec);
+ JSValue *v1 = term1->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = term2->evaluate(exec);
+ JSValue *v2 = term2->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return add(exec, v1, v2, oper);
@@ -1038,11 +1038,11 @@
// ------------------------------ ShiftNode ------------------------------------
// ECMA 11.7
-ValueImp *ShiftNode::evaluate(ExecState *exec)
+JSValue *ShiftNode::evaluate(ExecState *exec)
{
- ValueImp *v1 = term1->evaluate(exec);
+ JSValue *v1 = term1->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = term2->evaluate(exec);
+ JSValue *v2 = term2->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
unsigned int i2 = v2->toUInt32(exec);
i2 &= 0x1f;
@@ -1063,11 +1063,11 @@
// ------------------------------ RelationalNode -------------------------------
// ECMA 11.8
-ValueImp *RelationalNode::evaluate(ExecState *exec)
+JSValue *RelationalNode::evaluate(ExecState *exec)
{
- ValueImp *v1 = expr1->evaluate(exec);
+ JSValue *v1 = expr1->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = expr2->evaluate(exec);
+ JSValue *v2 = expr2->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
bool b;
@@ -1088,14 +1088,14 @@
if (!v2->isObject())
return throwError(exec, TypeError,
"Value %s (result of expression %s) is not an object. Cannot be used with IN expression.", v2, expr2.get());
- ObjectImp *o2(static_cast<ObjectImp*>(v2));
+ JSObject *o2(static_cast<JSObject*>(v2));
b = o2->hasProperty(exec, Identifier(v1->toString(exec)));
} else {
if (!v2->isObject())
return throwError(exec, TypeError,
"Value %s (result of expression %s) is not an object. Cannot be used with instanceof operator.", v2, expr2.get());
- ObjectImp *o2(static_cast<ObjectImp*>(v2));
+ JSObject *o2(static_cast<JSObject*>(v2));
if (!o2->implementsHasInstance()) {
// According to the spec, only some types of objects "implement" the [[HasInstance]] property.
// But we are supposed to throw an exception where the object does not "have" the [[HasInstance]]
@@ -1114,11 +1114,11 @@
// ------------------------------ EqualNode ------------------------------------
// ECMA 11.9
-ValueImp *EqualNode::evaluate(ExecState *exec)
+JSValue *EqualNode::evaluate(ExecState *exec)
{
- ValueImp *v1 = expr1->evaluate(exec);
+ JSValue *v1 = expr1->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = expr2->evaluate(exec);
+ JSValue *v2 = expr2->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
bool result;
@@ -1137,11 +1137,11 @@
// ------------------------------ BitOperNode ----------------------------------
// ECMA 11.10
-ValueImp *BitOperNode::evaluate(ExecState *exec)
+JSValue *BitOperNode::evaluate(ExecState *exec)
{
- ValueImp *v1 = expr1->evaluate(exec);
+ JSValue *v1 = expr1->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = expr2->evaluate(exec);
+ JSValue *v2 = expr2->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
int i1 = v1->toInt32(exec);
int i2 = v2->toInt32(exec);
@@ -1159,15 +1159,15 @@
// ------------------------------ BinaryLogicalNode ----------------------------
// ECMA 11.11
-ValueImp *BinaryLogicalNode::evaluate(ExecState *exec)
+JSValue *BinaryLogicalNode::evaluate(ExecState *exec)
{
- ValueImp *v1 = expr1->evaluate(exec);
+ JSValue *v1 = expr1->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
bool b1 = v1->toBoolean(exec);
if ((!b1 && oper == OpAnd) || (b1 && oper == OpOr))
return v1;
- ValueImp *v2 = expr2->evaluate(exec);
+ JSValue *v2 = expr2->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return v2;
@@ -1176,9 +1176,9 @@
// ------------------------------ ConditionalNode ------------------------------
// ECMA 11.12
-ValueImp *ConditionalNode::evaluate(ExecState *exec)
+JSValue *ConditionalNode::evaluate(ExecState *exec)
{
- ValueImp *v = logical->evaluate(exec);
+ JSValue *v = logical->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
bool b = v->toBoolean(exec);
@@ -1195,12 +1195,12 @@
#if __GNUC__
// gcc refuses to inline this without the always_inline, but inlining it does help
-static inline ValueImp *valueForReadModifyAssignment(ExecState * exec, ValueImp *v1, ValueImp *v2, Operator oper) __attribute__((always_inline));
+static inline JSValue *valueForReadModifyAssignment(ExecState * exec, JSValue *v1, JSValue *v2, Operator oper) __attribute__((always_inline));
#endif
-static inline ValueImp *valueForReadModifyAssignment(ExecState * exec, ValueImp *v1, ValueImp *v2, Operator oper)
+static inline JSValue *valueForReadModifyAssignment(ExecState * exec, JSValue *v1, JSValue *v2, Operator oper)
{
- ValueImp *v;
+ JSValue *v;
int i1;
int i2;
unsigned int ui;
@@ -1263,7 +1263,7 @@
// ------------------------------ AssignResolveNode -----------------------------------
-ValueImp *AssignResolveNode::evaluate(ExecState *exec)
+JSValue *AssignResolveNode::evaluate(ExecState *exec)
{
const ScopeChain& chain = exec->context().imp()->scopeChain();
ScopeChainIterator iter = chain.begin();
@@ -1273,7 +1273,7 @@
assert(iter != end);
PropertySlot slot;
- ObjectImp *base;
+ JSObject *base;
do {
base = *iter;
if (base->getPropertySlot(exec, m_ident, slot))
@@ -1286,14 +1286,14 @@
return throwUndefinedVariableError(exec, m_ident);
found:
- ValueImp *v;
+ JSValue *v;
if (m_oper == OpEqual) {
v = m_right->evaluate(exec);
} else {
- ValueImp *v1 = slot.getValue(exec, m_ident);
+ JSValue *v1 = slot.getValue(exec, m_ident);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = m_right->evaluate(exec);
+ JSValue *v2 = m_right->evaluate(exec);
v = valueForReadModifyAssignment(exec, v1, v2, m_oper);
}
@@ -1305,21 +1305,21 @@
// ------------------------------ AssignDotNode -----------------------------------
-ValueImp *AssignDotNode::evaluate(ExecState *exec)
+JSValue *AssignDotNode::evaluate(ExecState *exec)
{
- ValueImp *baseValue = m_base->evaluate(exec);
+ JSValue *baseValue = m_base->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *base = baseValue->toObject(exec);
+ JSObject *base = baseValue->toObject(exec);
- ValueImp *v;
+ JSValue *v;
if (m_oper == OpEqual) {
v = m_right->evaluate(exec);
} else {
PropertySlot slot;
- ValueImp *v1 = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();
+ JSValue *v1 = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = m_right->evaluate(exec);
+ JSValue *v2 = m_right->evaluate(exec);
v = valueForReadModifyAssignment(exec, v1, v2, m_oper);
}
@@ -1331,25 +1331,25 @@
// ------------------------------ AssignBracketNode -----------------------------------
-ValueImp *AssignBracketNode::evaluate(ExecState *exec)
+JSValue *AssignBracketNode::evaluate(ExecState *exec)
{
- ValueImp *baseValue = m_base->evaluate(exec);
+ JSValue *baseValue = m_base->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *subscript = m_subscript->evaluate(exec);
+ JSValue *subscript = m_subscript->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ObjectImp *base = baseValue->toObject(exec);
+ JSObject *base = baseValue->toObject(exec);
uint32_t propertyIndex;
if (subscript->getUInt32(propertyIndex)) {
- ValueImp *v;
+ JSValue *v;
if (m_oper == OpEqual) {
v = m_right->evaluate(exec);
} else {
PropertySlot slot;
- ValueImp *v1 = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();
+ JSValue *v1 = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = m_right->evaluate(exec);
+ JSValue *v2 = m_right->evaluate(exec);
v = valueForReadModifyAssignment(exec, v1, v2, m_oper);
}
@@ -1360,15 +1360,15 @@
}
Identifier propertyName(subscript->toString(exec));
- ValueImp *v;
+ JSValue *v;
if (m_oper == OpEqual) {
v = m_right->evaluate(exec);
} else {
PropertySlot slot;
- ValueImp *v1 = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();
+ JSValue *v1 = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v2 = m_right->evaluate(exec);
+ JSValue *v2 = m_right->evaluate(exec);
v = valueForReadModifyAssignment(exec, v1, v2, m_oper);
}
@@ -1381,11 +1381,11 @@
// ------------------------------ CommaNode ------------------------------------
// ECMA 11.14
-ValueImp *CommaNode::evaluate(ExecState *exec)
+JSValue *CommaNode::evaluate(ExecState *exec)
{
expr1->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
- ValueImp *v = expr2->evaluate(exec);
+ JSValue *v = expr2->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return v;
@@ -1414,7 +1414,7 @@
if (c.complType() != Normal)
return c;
- ValueImp *v = c.value();
+ JSValue *v = c.value();
for (StatListNode *n = list.get(); n; n = n->list.get()) {
Completion c2 = n->statement->execute(exec);
@@ -1439,7 +1439,7 @@
// ------------------------------ AssignExprNode -------------------------------
// ECMA 12.2
-ValueImp *AssignExprNode::evaluate(ExecState *exec)
+JSValue *AssignExprNode::evaluate(ExecState *exec)
{
return expr->evaluate(exec);
}
@@ -1453,11 +1453,11 @@
}
// ECMA 12.2
-ValueImp *VarDeclNode::evaluate(ExecState *exec)
+JSValue *VarDeclNode::evaluate(ExecState *exec)
{
- ObjectImp *variable = exec->context().imp()->variableObject();
+ JSObject *variable = exec->context().imp()->variableObject();
- ValueImp *val;
+ JSValue *val;
if (init) {
val = init->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
@@ -1486,7 +1486,7 @@
void VarDeclNode::processVarDecls(ExecState *exec)
{
- ObjectImp *variable = exec->context().imp()->variableObject();
+ JSObject *variable = exec->context().imp()->variableObject();
// If a variable by this name already exists, don't clobber it -
// it might be a function parameter
@@ -1503,7 +1503,7 @@
// ------------------------------ VarDeclListNode ------------------------------
// ECMA 12.2
-ValueImp *VarDeclListNode::evaluate(ExecState *exec)
+JSValue *VarDeclListNode::evaluate(ExecState *exec)
{
for (VarDeclListNode *n = this; n; n = n->list.get()) {
n->var->evaluate(exec);
@@ -1581,7 +1581,7 @@
{
KJS_BREAKPOINT;
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTION
return Completion(Normal, v);
@@ -1594,7 +1594,7 @@
{
KJS_BREAKPOINT;
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTION
bool b = v->toBoolean(exec);
@@ -1625,7 +1625,7 @@
{
KJS_BREAKPOINT;
- ValueImp *bv;
+ JSValue *bv;
Completion c;
do {
@@ -1660,10 +1660,10 @@
{
KJS_BREAKPOINT;
- ValueImp *bv;
+ JSValue *bv;
Completion c;
bool b(false);
- ValueImp *value = 0;
+ JSValue *value = 0;
while (1) {
bv = expr->evaluate(exec);
@@ -1703,7 +1703,7 @@
// ECMA 12.6.3
Completion ForNode::execute(ExecState *exec)
{
- ValueImp *v, *cval = 0;
+ JSValue *v, *cval = 0;
if (expr1) {
v = expr1->evaluate(exec);
@@ -1765,9 +1765,9 @@
// ECMA 12.6.4
Completion ForInNode::execute(ExecState *exec)
{
- ValueImp *e;
- ValueImp *retval = 0;
- ObjectImp *v;
+ JSValue *e;
+ JSValue *retval = 0;
+ JSObject *v;
Completion c;
ReferenceList propList;
@@ -1799,7 +1799,7 @@
continue;
}
- ValueImp *str = jsString(name.ustring());
+ JSValue *str = jsString(name.ustring());
if (lexpr->isResolveNode()) {
const Identifier &ident = static_cast<ResolveNode *>(lexpr.get())->identifier();
@@ -1812,7 +1812,7 @@
assert(iter != end);
PropertySlot slot;
- ObjectImp *o;
+ JSObject *o;
do {
o = *iter;
if (o->getPropertySlot(exec, ident, slot))
@@ -1825,18 +1825,18 @@
o->put(exec, ident, str);
} else if (lexpr->isDotAccessorNode()) {
const Identifier& ident = static_cast<DotAccessorNode *>(lexpr.get())->identifier();
- ValueImp *v = static_cast<DotAccessorNode *>(lexpr.get())->base()->evaluate(exec);
+ JSValue *v = static_cast<DotAccessorNode *>(lexpr.get())->base()->evaluate(exec);
KJS_CHECKEXCEPTION
- ObjectImp *o = v->toObject(exec);
+ JSObject *o = v->toObject(exec);
o->put(exec, ident, str);
} else {
assert(lexpr->isBracketAccessorNode());
- ValueImp *v = static_cast<BracketAccessorNode *>(lexpr.get())->base()->evaluate(exec);
+ JSValue *v = static_cast<BracketAccessorNode *>(lexpr.get())->base()->evaluate(exec);
KJS_CHECKEXCEPTION
- ValueImp *v2 = static_cast<BracketAccessorNode *>(lexpr.get())->subscript()->evaluate(exec);
+ JSValue *v2 = static_cast<BracketAccessorNode *>(lexpr.get())->subscript()->evaluate(exec);
KJS_CHECKEXCEPTION
- ObjectImp *o = v->toObject(exec);
+ JSObject *o = v->toObject(exec);
uint32_t i;
if (v2->getUInt32(i))
@@ -1920,7 +1920,7 @@
if (!value)
return Completion(ReturnValue, jsUndefined());
- ValueImp *v = value->evaluate(exec);
+ JSValue *v = value->evaluate(exec);
KJS_CHECKEXCEPTION
return Completion(ReturnValue, v);
@@ -1933,9 +1933,9 @@
{
KJS_BREAKPOINT;
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTION
- ObjectImp *o = v->toObject(exec);
+ JSObject *o = v->toObject(exec);
KJS_CHECKEXCEPTION
exec->context().imp()->pushScope(o);
Completion res = statement->execute(exec);
@@ -1952,9 +1952,9 @@
// ------------------------------ CaseClauseNode -------------------------------
// ECMA 12.11
-ValueImp *CaseClauseNode::evaluate(ExecState *exec)
+JSValue *CaseClauseNode::evaluate(ExecState *exec)
{
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTIONVALUE
return v;
@@ -1977,7 +1977,7 @@
// ------------------------------ ClauseListNode -------------------------------
-ValueImp *ClauseListNode::evaluate(ExecState *)
+JSValue *ClauseListNode::evaluate(ExecState *)
{
// should never be called
assert(false);
@@ -2014,7 +2014,7 @@
}
}
-ValueImp *CaseBlockNode::evaluate(ExecState *)
+JSValue *CaseBlockNode::evaluate(ExecState *)
{
// should never be called
assert(false);
@@ -2022,9 +2022,9 @@
}
// ECMA 12.11
-Completion CaseBlockNode::evalBlock(ExecState *exec, ValueImp *input)
+Completion CaseBlockNode::evalBlock(ExecState *exec, JSValue *input)
{
- ValueImp *v;
+ JSValue *v;
Completion res;
ClauseListNode *a = list1.get();
ClauseListNode *b = list2.get();
@@ -2101,7 +2101,7 @@
{
KJS_BREAKPOINT;
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTION
exec->context().imp()->seenLabels()->pushSwitch();
@@ -2145,7 +2145,7 @@
{
KJS_BREAKPOINT;
- ValueImp *v = expr->evaluate(exec);
+ JSValue *v = expr->evaluate(exec);
KJS_CHECKEXCEPTION
return Completion(Throw, v);
@@ -2161,7 +2161,7 @@
Completion c = tryBlock->execute(exec);
if (catchBlock && c.complType() == Throw) {
- ObjectImp *obj = new ObjectImp;
+ JSObject *obj = new JSObject;
obj->put(exec, exceptionIdent, c.value(), DontDelete);
exec->context().imp()->pushScope(obj);
c = catchBlock->execute(exec);
@@ -2189,7 +2189,7 @@
// ------------------------------ ParameterNode --------------------------------
// ECMA 13
-ValueImp *ParameterNode::evaluate(ExecState *)
+JSValue *ParameterNode::evaluate(ExecState *)
{
return jsUndefined();
}
@@ -2218,7 +2218,7 @@
// TODO: let this be an object with [[Class]] property "Function"
FunctionImp *func = new DeclaredFunctionImp(exec, ident, body.get(), context->scopeChain());
- ObjectImp *proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
+ JSObject *proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
proto->put(exec, constructorPropertyName, func, ReadOnly|DontDelete|DontEnum);
func->put(exec, prototypePropertyName, proto, Internal|DontDelete);
@@ -2234,7 +2234,7 @@
if (body) {
// hack the scope so that the function gets put as a property of func, and it's scope
// contains the func as well as our current scope
- ObjectImp *oldVar = context->variableObject();
+ JSObject *oldVar = context->variableObject();
context->setVariableObject(func);
context->pushScope(func);
body->processFuncDecl(exec);
@@ -2251,22 +2251,22 @@
// ------------------------------ FuncExprNode ---------------------------------
// ECMA 13
-ValueImp *FuncExprNode::evaluate(ExecState *exec)
+JSValue *FuncExprNode::evaluate(ExecState *exec)
{
ContextImp *context = exec->context().imp();
bool named = !ident.isNull();
- ObjectImp *functionScopeObject = 0;
+ JSObject *functionScopeObject = 0;
if (named) {
// named FunctionExpressions can recursively call themselves,
// but they won't register with the current scope chain and should
// be contained as single property in an anonymous object.
- functionScopeObject = new ObjectImp;
+ functionScopeObject = new JSObject;
context->pushScope(functionScopeObject);
}
FunctionImp *func = new DeclaredFunctionImp(exec, ident, body.get(), context->scopeChain());
- ObjectImp *proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
+ JSObject *proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
proto->put(exec, constructorPropertyName, func, ReadOnly|DontDelete|DontEnum);
func->put(exec, prototypePropertyName, proto, Internal|DontDelete);
1.43 +69 -69 JavaScriptCore/kjs/nodes.h
Index: nodes.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/nodes.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- nodes.h 11 Dec 2005 00:37:51 -0000 1.42
+++ nodes.h 11 Dec 2005 02:05:45 -0000 1.43
@@ -75,7 +75,7 @@
Node();
virtual ~Node();
- virtual ValueImp *evaluate(ExecState *exec) = 0;
+ virtual JSValue *evaluate(ExecState *exec) = 0;
UString toString() const;
virtual void streamTo(SourceStream &s) const = 0;
virtual void processVarDecls(ExecState *) {}
@@ -98,14 +98,14 @@
Completion createErrorCompletion(ExecState *, ErrorType, const char *msg);
Completion createErrorCompletion(ExecState *, ErrorType, const char *msg, const Identifier &);
- ValueImp *throwError(ExecState *, ErrorType, const char *msg);
- ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp *, Node *);
- ValueImp *throwError(ExecState *, ErrorType, const char *msg, const Identifier &);
- ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp *, const Identifier &);
- ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp *, Node *, Node *);
- ValueImp *throwError(ExecState *, ErrorType, const char *msg, ValueImp *, Node *, const Identifier &);
+ JSValue *throwError(ExecState *, ErrorType, const char *msg);
+ JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *);
+ JSValue *throwError(ExecState *, ErrorType, const char *msg, const Identifier &);
+ JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, const Identifier &);
+ JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *, Node *);
+ JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *, const Identifier &);
- ValueImp *throwUndefinedVariableError(ExecState *, const Identifier &);
+ JSValue *throwUndefinedVariableError(ExecState *, const Identifier &);
void setExceptionDetailsIfNeeded(ExecState *);
@@ -134,7 +134,7 @@
protected:
LabelStack ls;
private:
- ValueImp *evaluate(ExecState */*exec*/) { return jsUndefined(); }
+ JSValue *evaluate(ExecState */*exec*/) { return jsUndefined(); }
int l0, l1;
int sid;
bool breakPoint;
@@ -143,14 +143,14 @@
class NullNode : public Node {
public:
NullNode() {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
};
class BooleanNode : public Node {
public:
BooleanNode(bool v) : value(v) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
bool value;
@@ -159,7 +159,7 @@
class NumberNode : public Node {
public:
NumberNode(double v) : value(v) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
double value;
@@ -168,7 +168,7 @@
class StringNode : public Node {
public:
StringNode(const UString *v) { value = *v; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
UString value;
@@ -178,7 +178,7 @@
public:
RegExpNode(const UString &p, const UString &f)
: pattern(p), flags(f) { }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
UString pattern, flags;
@@ -187,14 +187,14 @@
class ThisNode : public Node {
public:
ThisNode() {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
};
class ResolveNode : public Node {
public:
ResolveNode(const Identifier &s) : ident(s) { }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
virtual bool isLocation() const { return true; }
@@ -208,7 +208,7 @@
class GroupNode : public Node {
public:
GroupNode(Node *g) : group(g) { }
- virtual ValueImp *evaluate(ExecState *exec);
+ virtual JSValue *evaluate(ExecState *exec);
virtual Node *nodeInsideAllParens();
virtual void streamTo(SourceStream &s) const;
virtual bool isGroupNode() const { return true; }
@@ -222,7 +222,7 @@
ElementNode(int e, Node *n) : list(this), elision(e), node(n) { }
ElementNode(ElementNode *l, int e, Node *n)
: list(l->list), elision(e), node(n) { l->list = this; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
friend class ArrayNode;
@@ -238,7 +238,7 @@
: element(ele->list), elision(0), opt(false) { ele->list = 0; }
ArrayNode(int eli, ElementNode *ele)
: element(ele->list), elision(eli), opt(true) { ele->list = 0; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<ElementNode> element;
@@ -253,7 +253,7 @@
: name(n), assign(a), list(this) { }
PropertyValueNode(PropertyNode *n, Node *a, PropertyValueNode *l)
: name(n), assign(a), list(l->list) { l->list = this; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
friend class ObjectLiteralNode;
@@ -266,7 +266,7 @@
public:
ObjectLiteralNode() : list(0) { }
ObjectLiteralNode(PropertyValueNode *l) : list(l->list) { l->list = 0; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<PropertyValueNode> list;
@@ -276,7 +276,7 @@
public:
PropertyNode(double d) : numeric(d) { }
PropertyNode(const Identifier &s) : str(s) { }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
double numeric;
@@ -286,7 +286,7 @@
class BracketAccessorNode : public Node {
public:
BracketAccessorNode(Node *e1, Node *e2) : expr1(e1), expr2(e2) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
virtual bool isLocation() const { return true; }
@@ -302,7 +302,7 @@
class DotAccessorNode : public Node {
public:
DotAccessorNode(Node *e, const Identifier &s) : expr(e), ident(s) { }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
virtual bool isLocation() const { return true; }
@@ -321,7 +321,7 @@
ArgumentListNode(Node *e) : list(this), expr(e) { }
ArgumentListNode(ArgumentListNode *l, Node *e)
: list(l->list), expr(e) { l->list = this; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
List evaluateList(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
@@ -335,7 +335,7 @@
ArgumentsNode() : list(0) { }
ArgumentsNode(ArgumentListNode *l)
: list(l->list) { l->list = 0; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
List evaluateList(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
@@ -346,7 +346,7 @@
public:
NewExprNode(Node *e) : expr(e), args(0) {}
NewExprNode(Node *e, ArgumentsNode *a) : expr(e), args(a) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr;
@@ -356,7 +356,7 @@
class FunctionCallValueNode : public Node {
public:
FunctionCallValueNode(Node *e, ArgumentsNode *a) : expr(e), args(a) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr;
@@ -366,7 +366,7 @@
class FunctionCallResolveNode : public Node {
public:
FunctionCallResolveNode(const Identifier& i, ArgumentsNode *a) : ident(i), args(a) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
Identifier ident;
@@ -376,7 +376,7 @@
class FunctionCallBracketNode : public Node {
public:
FunctionCallBracketNode(Node *b, Node *s, ArgumentsNode *a) : base(b), subscript(s), args(a) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
protected:
RefPtr<Node> base;
@@ -393,7 +393,7 @@
class FunctionCallDotNode : public Node {
public:
FunctionCallDotNode(Node *b, const Identifier &i, ArgumentsNode *a) : base(b), ident(i), args(a) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
protected:
RefPtr<Node> base;
@@ -410,7 +410,7 @@
class PostfixResolveNode : public Node {
public:
PostfixResolveNode(const Identifier& i, Operator o) : m_ident(i), m_oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
Identifier m_ident;
@@ -420,7 +420,7 @@
class PostfixBracketNode : public Node {
public:
PostfixBracketNode(Node *b, Node *s, Operator o) : m_base(b), m_subscript(s), m_oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> m_base;
@@ -431,7 +431,7 @@
class PostfixDotNode : public Node {
public:
PostfixDotNode(Node *b, const Identifier& i, Operator o) : m_base(b), m_ident(i), m_oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> m_base;
@@ -442,7 +442,7 @@
class DeleteResolveNode : public Node {
public:
DeleteResolveNode(const Identifier& i) : m_ident(i) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
Identifier m_ident;
@@ -451,7 +451,7 @@
class DeleteBracketNode : public Node {
public:
DeleteBracketNode(Node *base, Node *subscript) : m_base(base), m_subscript(subscript) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> m_base;
@@ -461,7 +461,7 @@
class DeleteDotNode : public Node {
public:
DeleteDotNode(Node *base, const Identifier& i) : m_base(base), m_ident(i) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> m_base;
@@ -471,7 +471,7 @@
class DeleteValueNode : public Node {
public:
DeleteValueNode(Node *e) : m_expr(e) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> m_expr;
@@ -480,7 +480,7 @@
class VoidNode : public Node {
public:
VoidNode(Node *e) : expr(e) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr;
@@ -489,7 +489,7 @@
class TypeOfResolveNode : public Node {
public:
TypeOfResolveNode(const Identifier& i) : m_ident(i) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
Identifier m_ident;
@@ -498,7 +498,7 @@
class TypeOfValueNode : public Node {
public:
TypeOfValueNode(Node *e) : m_expr(e) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> m_expr;
@@ -507,7 +507,7 @@
class PrefixResolveNode : public Node {
public:
PrefixResolveNode(const Identifier& i, Operator o) : m_ident(i), m_oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
Identifier m_ident;
@@ -517,7 +517,7 @@
class PrefixBracketNode : public Node {
public:
PrefixBracketNode(Node *b, Node *s, Operator o) : m_base(b), m_subscript(s), m_oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> m_base;
@@ -528,7 +528,7 @@
class PrefixDotNode : public Node {
public:
PrefixDotNode(Node *b, const Identifier& i, Operator o) : m_base(b), m_ident(i), m_oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> m_base;
@@ -539,7 +539,7 @@
class UnaryPlusNode : public Node {
public:
UnaryPlusNode(Node *e) : expr(e) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr;
@@ -548,7 +548,7 @@
class NegateNode : public Node {
public:
NegateNode(Node *e) : expr(e) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr;
@@ -557,7 +557,7 @@
class BitwiseNotNode : public Node {
public:
BitwiseNotNode(Node *e) : expr(e) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr;
@@ -566,7 +566,7 @@
class LogicalNotNode : public Node {
public:
LogicalNotNode(Node *e) : expr(e) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr;
@@ -575,7 +575,7 @@
class MultNode : public Node {
public:
MultNode(Node *t1, Node *t2, char op) : term1(t1), term2(t2), oper(op) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> term1;
@@ -586,7 +586,7 @@
class AddNode : public Node {
public:
AddNode(Node *t1, Node *t2, char op) : term1(t1), term2(t2), oper(op) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> term1;
@@ -598,7 +598,7 @@
public:
ShiftNode(Node *t1, Operator o, Node *t2)
: term1(t1), term2(t2), oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> term1;
@@ -610,7 +610,7 @@
public:
RelationalNode(Node *e1, Operator o, Node *e2) :
expr1(e1), expr2(e2), oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr1;
@@ -622,7 +622,7 @@
public:
EqualNode(Node *e1, Operator o, Node *e2)
: expr1(e1), expr2(e2), oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr1;
@@ -634,7 +634,7 @@
public:
BitOperNode(Node *e1, Operator o, Node *e2) :
expr1(e1), expr2(e2), oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr1;
@@ -649,7 +649,7 @@
public:
BinaryLogicalNode(Node *e1, Operator o, Node *e2) :
expr1(e1), expr2(e2), oper(o) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr1;
@@ -664,7 +664,7 @@
public:
ConditionalNode(Node *l, Node *e1, Node *e2) :
logical(l), expr1(e1), expr2(e2) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> logical;
@@ -676,7 +676,7 @@
public:
AssignResolveNode(const Identifier &ident, Operator oper, Node *right)
: m_ident(ident), m_oper(oper), m_right(right) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
protected:
Identifier m_ident;
@@ -688,7 +688,7 @@
public:
AssignBracketNode(Node *base, Node *subscript, Operator oper, Node *right)
: m_base(base), m_subscript(subscript), m_oper(oper), m_right(right) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
protected:
RefPtr<Node> m_base;
@@ -701,7 +701,7 @@
public:
AssignDotNode(Node *base, const Identifier& ident, Operator oper, Node *right)
: m_base(base), m_ident(ident), m_oper(oper), m_right(right) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
protected:
RefPtr<Node> m_base;
@@ -713,7 +713,7 @@
class CommaNode : public Node {
public:
CommaNode(Node *e1, Node *e2) : expr1(e1), expr2(e2) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr1;
@@ -737,7 +737,7 @@
class AssignExprNode : public Node {
public:
AssignExprNode(Node *e) : expr(e) {}
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
RefPtr<Node> expr;
@@ -747,7 +747,7 @@
public:
enum Type { Variable, Constant };
VarDeclNode(const Identifier &id, AssignExprNode *in, Type t);
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void processVarDecls(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
@@ -762,7 +762,7 @@
VarDeclListNode(VarDeclNode *v) : list(this), var(v) {}
VarDeclListNode(VarDeclListNode *l, VarDeclNode *v)
: list(l->list), var(v) { l->list = this; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
virtual void processVarDecls(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
@@ -920,7 +920,7 @@
CaseClauseNode(Node *e) : expr(e), list(0) { }
CaseClauseNode(Node *e, StatListNode *l)
: expr(e), list(l->list) { l->list = 0; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
Completion evalStatements(ExecState *exec);
virtual void processVarDecls(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
@@ -935,7 +935,7 @@
ClauseListNode(CaseClauseNode *c) : cl(c), nx(this) { }
ClauseListNode(ClauseListNode *n, CaseClauseNode *c)
: cl(c), nx(n->nx) { n->nx = this; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
CaseClauseNode *clause() const { return cl.get(); }
ClauseListNode *next() const { return nx.get(); }
virtual void processVarDecls(ExecState *exec);
@@ -949,8 +949,8 @@
class CaseBlockNode : public Node {
public:
CaseBlockNode(ClauseListNode *l1, CaseClauseNode *d, ClauseListNode *l2);
- ValueImp *evaluate(ExecState *exec);
- Completion evalBlock(ExecState *exec, ValueImp *input);
+ JSValue *evaluate(ExecState *exec);
+ Completion evalBlock(ExecState *exec, JSValue *input);
virtual void processVarDecls(ExecState *exec);
virtual void streamTo(SourceStream &s) const;
private:
@@ -1010,7 +1010,7 @@
ParameterNode(const Identifier &i) : id(i), next(this) { }
ParameterNode(ParameterNode *list, const Identifier &i)
: id(i), next(list->next) { list->next = this; }
- ValueImp *evaluate(ExecState *exec);
+ JSValue *evaluate(ExecState *exec);
Identifier ident() { return id; }
ParameterNode *nextParam() { return next.get(); }
virtual void streamTo(SourceStream &s) const;
@@ -1034,7 +1034,7 @@
: ident(i), param(0), body(b) { }
FuncExprNode(const Identifier &i, ParameterNode *p, FunctionBodyNode *b)
: ident(i), param(p->next), body(b) { p->next = 0; }
- virtual ValueImp *evaluate(ExecState *);
+ virtual JSValue *evaluate(ExecState *);
virtual void streamTo(SourceStream &) const;
private:
Identifier ident;
1.26 +31 -31 JavaScriptCore/kjs/number_object.cpp
Index: number_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/number_object.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- number_object.cpp 11 Dec 2005 00:37:52 -0000 1.25
+++ number_object.cpp 11 Dec 2005 02:05:46 -0000 1.26
@@ -36,47 +36,47 @@
using namespace KJS;
-// ------------------------------ NumberInstanceImp ----------------------------
+// ------------------------------ NumberInstance ----------------------------
-const ClassInfo NumberInstanceImp::info = {"Number", 0, 0, 0};
+const ClassInfo NumberInstance::info = {"Number", 0, 0, 0};
-NumberInstanceImp::NumberInstanceImp(ObjectImp *proto)
- : ObjectImp(proto)
+NumberInstance::NumberInstance(JSObject *proto)
+ : JSObject(proto)
{
}
-// ------------------------------ NumberPrototypeImp ---------------------------
+// ------------------------------ NumberPrototype ---------------------------
// ECMA 15.7.4
-NumberPrototypeImp::NumberPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objProto,
- FunctionPrototypeImp *funcProto)
- : NumberInstanceImp(objProto)
+NumberPrototype::NumberPrototype(ExecState *exec,
+ ObjectPrototype *objProto,
+ FunctionPrototype *funcProto)
+ : NumberInstance(objProto)
{
setInternalValue(jsNumber(0));
// The constructor will be added later, after NumberObjectImp has been constructed
- putDirect(toStringPropertyName, new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToString, 1), DontEnum);
- putDirect(toLocaleStringPropertyName, new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToLocaleString, 0), DontEnum);
- putDirect(valueOfPropertyName, new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ValueOf, 0), DontEnum);
- putDirect(toFixedPropertyName, new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToFixed, 1), DontEnum);
- putDirect(toExponentialPropertyName, new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToExponential, 1), DontEnum);
- putDirect(toPrecisionPropertyName, new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToPrecision, 1), DontEnum);
+ putDirect(toStringPropertyName, new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToString, 1), DontEnum);
+ putDirect(toLocaleStringPropertyName, new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToLocaleString, 0), DontEnum);
+ putDirect(valueOfPropertyName, new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ValueOf, 0), DontEnum);
+ putDirect(toFixedPropertyName, new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToFixed, 1), DontEnum);
+ putDirect(toExponentialPropertyName, new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToExponential, 1), DontEnum);
+ putDirect(toPrecisionPropertyName, new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToPrecision, 1), DontEnum);
}
-// ------------------------------ NumberProtoFuncImp ---------------------------
+// ------------------------------ NumberProtoFunc ---------------------------
-NumberProtoFuncImp::NumberProtoFuncImp(ExecState *exec,
- FunctionPrototypeImp *funcProto, int i, int len)
+NumberProtoFunc::NumberProtoFunc(ExecState *exec,
+ FunctionPrototype *funcProto, int i, int len)
: InternalFunctionImp(funcProto), id(i)
{
putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
}
-bool NumberProtoFuncImp::implementsCall() const
+bool NumberProtoFunc::implementsCall() const
{
return true;
}
@@ -126,13 +126,13 @@
}
// ECMA 15.7.4.2 - 15.7.4.7
-ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *NumberProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
// no generic function. "this" has to be a Number object
- if (!thisObj->inherits(&NumberInstanceImp::info))
+ if (!thisObj->inherits(&NumberInstance::info))
return throwError(exec, TypeError);
- ValueImp *v = thisObj->internalValue();
+ JSValue *v = thisObj->internalValue();
switch (id) {
case ToString: {
double dradix = 10;
@@ -158,7 +158,7 @@
return jsNumber(v->toNumber(exec));
case ToFixed:
{
- ValueImp *fractionDigits = args[0];
+ JSValue *fractionDigits = args[0];
double df = fractionDigits->toInteger(exec);
if (!(df >= 0 && df <= 20)) // true for NaN
return throwError(exec, RangeError, "toFixed() digits argument must be between 0 and 20");
@@ -203,7 +203,7 @@
if (isNaN(x) || isInf(x))
return jsString(UString::from(x));
- ValueImp *fractionDigits = args[0];
+ JSValue *fractionDigits = args[0];
double df = fractionDigits->toInteger(exec);
if (!(df >= 0 && df <= 20)) // true for NaN
return throwError(exec, RangeError, "toExponential() argument must between 0 and 20");
@@ -367,8 +367,8 @@
@end
*/
NumberObjectImp::NumberObjectImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
- NumberPrototypeImp *numberProto)
+ FunctionPrototype *funcProto,
+ NumberPrototype *numberProto)
: InternalFunctionImp(funcProto)
{
// Number.Prototype
@@ -383,7 +383,7 @@
return getStaticValueSlot<NumberObjectImp, InternalFunctionImp>(exec, &numberTable, this, propertyName, slot);
}
-ValueImp *NumberObjectImp::getValueProperty(ExecState *, int token) const
+JSValue *NumberObjectImp::getValueProperty(ExecState *, int token) const
{
// ECMA 15.7.3
switch(token) {
@@ -408,10 +408,10 @@
// ECMA 15.7.1
-ObjectImp *NumberObjectImp::construct(ExecState *exec, const List &args)
+JSObject *NumberObjectImp::construct(ExecState *exec, const List &args)
{
- ObjectImp *proto = exec->lexicalInterpreter()->builtinNumberPrototype();
- ObjectImp *obj(new NumberInstanceImp(proto));
+ JSObject *proto = exec->lexicalInterpreter()->builtinNumberPrototype();
+ JSObject *obj(new NumberInstance(proto));
double n;
if (args.isEmpty())
@@ -430,7 +430,7 @@
}
// ECMA 15.7.2
-ValueImp *NumberObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *NumberObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
if (args.isEmpty())
return jsNumber(0);
1.11 +15 -15 JavaScriptCore/kjs/number_object.h
Index: number_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/number_object.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- number_object.h 8 Aug 2005 04:07:28 -0000 1.10
+++ number_object.h 11 Dec 2005 02:05:46 -0000 1.11
@@ -27,9 +27,9 @@
namespace KJS {
- class NumberInstanceImp : public ObjectImp {
+ class NumberInstance : public JSObject {
public:
- NumberInstanceImp(ObjectImp *proto);
+ NumberInstance(JSObject *proto);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
@@ -41,11 +41,11 @@
* The initial value of Number.prototype (and thus all objects created
* with the Number constructor
*/
- class NumberPrototypeImp : public NumberInstanceImp {
+ class NumberPrototype : public NumberInstance {
public:
- NumberPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objProto,
- FunctionPrototypeImp *funcProto);
+ NumberPrototype(ExecState *exec,
+ ObjectPrototype *objProto,
+ FunctionPrototype *funcProto);
};
/**
@@ -54,13 +54,13 @@
* Class to implement all methods that are properties of the
* Number.prototype object
*/
- class NumberProtoFuncImp : public InternalFunctionImp {
+ class NumberProtoFunc : public InternalFunctionImp {
public:
- NumberProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto,
+ NumberProtoFunc(ExecState *exec, FunctionPrototype *funcProto,
int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
enum { ToString, ToLocaleString, ValueOf, ToFixed, ToExponential, ToPrecision };
private:
@@ -75,24 +75,24 @@
class NumberObjectImp : public InternalFunctionImp {
public:
NumberObjectImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
- NumberPrototypeImp *numberProto);
+ FunctionPrototype *funcProto,
+ NumberPrototype *numberProto);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
Completion execute(const List &);
- ObjectImp *construct(const List &);
+ JSObject *construct(const List &);
};
} // namespace
1.58 +70 -70 JavaScriptCore/kjs/object.cpp
Index: object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- object.cpp 11 Dec 2005 00:37:52 -0000 1.57
+++ object.cpp 11 Dec 2005 02:05:46 -0000 1.58
@@ -64,7 +64,7 @@
// ------------------------------ Object ---------------------------------------
-ValueImp *ObjectImp::call(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *JSObject::call(ExecState *exec, JSObject *thisObj, const List &args)
{
assert(implementsCall());
@@ -93,7 +93,7 @@
}
#endif
- ValueImp *ret = callAsFunction(exec,thisObj,args);
+ JSValue *ret = callAsFunction(exec,thisObj,args);
#if KJS_MAX_STACK > 0
--depth;
@@ -112,13 +112,13 @@
return ret;
}
-// ------------------------------ ObjectImp ------------------------------------
+// ------------------------------ JSObject ------------------------------------
-void ObjectImp::mark()
+void JSObject::mark()
{
- AllocatedValueImp::mark();
+ JSCell::mark();
- ValueImp *proto = _proto;
+ JSValue *proto = _proto;
if (!proto->marked())
proto->mark();
@@ -130,17 +130,17 @@
_scope.mark();
}
-Type ObjectImp::type() const
+Type JSObject::type() const
{
return ObjectType;
}
-const ClassInfo *ObjectImp::classInfo() const
+const ClassInfo *JSObject::classInfo() const
{
return 0;
}
-UString ObjectImp::className() const
+UString JSObject::className() const
{
const ClassInfo *ci = classInfo();
if ( ci )
@@ -148,50 +148,50 @@
return "Object";
}
-ValueImp *ObjectImp::get(ExecState *exec, const Identifier &propertyName) const
+JSValue *JSObject::get(ExecState *exec, const Identifier &propertyName) const
{
PropertySlot slot;
- if (const_cast<ObjectImp *>(this)->getPropertySlot(exec, propertyName, slot))
+ if (const_cast<JSObject *>(this)->getPropertySlot(exec, propertyName, slot))
return slot.getValue(exec, propertyName);
return jsUndefined();
}
-ValueImp *ObjectImp::get(ExecState *exec, unsigned propertyName) const
+JSValue *JSObject::get(ExecState *exec, unsigned propertyName) const
{
PropertySlot slot;
- if (const_cast<ObjectImp *>(this)->getPropertySlot(exec, propertyName, slot))
+ if (const_cast<JSObject *>(this)->getPropertySlot(exec, propertyName, slot))
return slot.getValue(exec, propertyName);
return jsUndefined();
}
-bool ObjectImp::getPropertySlot(ExecState *exec, unsigned propertyName, PropertySlot& slot)
+bool JSObject::getPropertySlot(ExecState *exec, unsigned propertyName, PropertySlot& slot)
{
- ObjectImp *imp = this;
+ JSObject *imp = this;
while (true) {
if (imp->getOwnPropertySlot(exec, propertyName, slot))
return true;
- ValueImp *proto = imp->_proto;
+ JSValue *proto = imp->_proto;
if (!proto->isObject())
break;
- imp = static_cast<ObjectImp *>(proto);
+ imp = static_cast<JSObject *>(proto);
}
return false;
}
-bool ObjectImp::getOwnPropertySlot(ExecState *exec, unsigned propertyName, PropertySlot& slot)
+bool JSObject::getOwnPropertySlot(ExecState *exec, unsigned propertyName, PropertySlot& slot)
{
return getOwnPropertySlot(exec, Identifier::from(propertyName), slot);
}
// ECMA 8.6.2.2
-void ObjectImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void JSObject::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
assert(value);
@@ -216,14 +216,14 @@
_prop.put(propertyName,value,attr);
}
-void ObjectImp::put(ExecState *exec, unsigned propertyName,
- ValueImp *value, int attr)
+void JSObject::put(ExecState *exec, unsigned propertyName,
+ JSValue *value, int attr)
{
put(exec, Identifier::from(propertyName), value, attr);
}
// ECMA 8.6.2.3
-bool ObjectImp::canPut(ExecState *, const Identifier &propertyName) const
+bool JSObject::canPut(ExecState *, const Identifier &propertyName) const
{
int attributes;
@@ -237,23 +237,23 @@
}
// ECMA 8.6.2.4
-bool ObjectImp::hasProperty(ExecState *exec, const Identifier &propertyName) const
+bool JSObject::hasProperty(ExecState *exec, const Identifier &propertyName) const
{
PropertySlot slot;
- return const_cast<ObjectImp *>(this)->getPropertySlot(exec, propertyName, slot);
+ return const_cast<JSObject *>(this)->getPropertySlot(exec, propertyName, slot);
}
-bool ObjectImp::hasProperty(ExecState *exec, unsigned propertyName) const
+bool JSObject::hasProperty(ExecState *exec, unsigned propertyName) const
{
PropertySlot slot;
- return const_cast<ObjectImp *>(this)->getPropertySlot(exec, propertyName, slot);
+ return const_cast<JSObject *>(this)->getPropertySlot(exec, propertyName, slot);
}
// ECMA 8.6.2.5
-bool ObjectImp::deleteProperty(ExecState */*exec*/, const Identifier &propertyName)
+bool JSObject::deleteProperty(ExecState */*exec*/, const Identifier &propertyName)
{
int attributes;
- ValueImp *v = _prop.get(propertyName, attributes);
+ JSValue *v = _prop.get(propertyName, attributes);
if (v) {
if ((attributes & DontDelete))
return false;
@@ -268,7 +268,7 @@
return true;
}
-bool ObjectImp::deleteProperty(ExecState *exec, unsigned propertyName)
+bool JSObject::deleteProperty(ExecState *exec, unsigned propertyName)
{
return deleteProperty(exec, Identifier::from(propertyName));
}
@@ -277,13 +277,13 @@
#ifdef __GNUC__
__attribute__((always_inline))
#endif
-ValueImp *tryGetAndCallProperty(ExecState *exec, const ObjectImp *object, const Identifier &propertyName) {
- ValueImp *v = object->get(exec, propertyName);
+JSValue *tryGetAndCallProperty(ExecState *exec, const JSObject *object, const Identifier &propertyName) {
+ JSValue *v = object->get(exec, propertyName);
if (v->isObject()) {
- ObjectImp *o = static_cast<ObjectImp*>(v);
+ JSObject *o = static_cast<JSObject*>(v);
if (o->implementsCall()) { // spec says "not primitive type" but ...
- ObjectImp *thisObj = const_cast<ObjectImp*>(object);
- ValueImp *def = o->call(exec, thisObj, List::empty());
+ JSObject *thisObj = const_cast<JSObject*>(object);
+ JSValue *def = o->call(exec, thisObj, List::empty());
Type defType = def->type();
if (defType == UnspecifiedType || defType == UndefinedType ||
defType == NullType || defType == BooleanType ||
@@ -296,7 +296,7 @@
}
// ECMA 8.6.2.6
-ValueImp *ObjectImp::defaultValue(ExecState *exec, Type hint) const
+JSValue *JSObject::defaultValue(ExecState *exec, Type hint) const
{
Identifier firstPropertyName;
Identifier secondPropertyName;
@@ -309,7 +309,7 @@
secondPropertyName = toStringPropertyName;
}
- ValueImp *v;
+ JSValue *v;
if ((v = tryGetAndCallProperty(exec, this, firstPropertyName)))
return v;
if ((v = tryGetAndCallProperty(exec, this, secondPropertyName)))
@@ -321,7 +321,7 @@
return throwError(exec, TypeError, "No default value");
}
-const HashEntry* ObjectImp::findPropertyHashEntry(const Identifier& propertyName) const
+const HashEntry* JSObject::findPropertyHashEntry(const Identifier& propertyName) const
{
for (const ClassInfo *info = classInfo(); info; info = info->parentClass) {
if (const HashTable *propHashTable = info->propHashTable) {
@@ -332,45 +332,45 @@
return 0;
}
-bool ObjectImp::implementsConstruct() const
+bool JSObject::implementsConstruct() const
{
return false;
}
-ObjectImp *ObjectImp::construct(ExecState */*exec*/, const List &/*args*/)
+JSObject *JSObject::construct(ExecState */*exec*/, const List &/*args*/)
{
assert(false);
return NULL;
}
-ObjectImp *ObjectImp::construct(ExecState *exec, const List &args, const UString &/*sourceURL*/, int /*lineNumber*/)
+JSObject *JSObject::construct(ExecState *exec, const List &args, const UString &/*sourceURL*/, int /*lineNumber*/)
{
return construct(exec, args);
}
-bool ObjectImp::implementsCall() const
+bool JSObject::implementsCall() const
{
return false;
}
-ValueImp *ObjectImp::callAsFunction(ExecState */*exec*/, ObjectImp */*thisObj*/, const List &/*args*/)
+JSValue *JSObject::callAsFunction(ExecState */*exec*/, JSObject */*thisObj*/, const List &/*args*/)
{
assert(false);
return NULL;
}
-bool ObjectImp::implementsHasInstance() const
+bool JSObject::implementsHasInstance() const
{
return false;
}
-bool ObjectImp::hasInstance(ExecState */*exec*/, ValueImp */*value*/)
+bool JSObject::hasInstance(ExecState */*exec*/, JSValue */*value*/)
{
assert(false);
return false;
}
-bool ObjectImp::propertyIsEnumerable(ExecState *exec, const Identifier &propertyName) const
+bool JSObject::propertyIsEnumerable(ExecState *exec, const Identifier &propertyName) const
{
int attributes;
@@ -380,7 +380,7 @@
return !(attributes & DontEnum);
}
-bool ObjectImp::getPropertyAttributes(const Identifier& propertyName, int& attributes) const
+bool JSObject::getPropertyAttributes(const Identifier& propertyName, int& attributes) const
{
if (_prop.get(propertyName, attributes))
return true;
@@ -395,11 +395,11 @@
return false;
}
-ReferenceList ObjectImp::propList(ExecState *exec, bool recursive)
+ReferenceList JSObject::propList(ExecState *exec, bool recursive)
{
ReferenceList list;
if (_proto->isObject() && recursive)
- list = static_cast<ObjectImp*>(_proto)->propList(exec,recursive);
+ list = static_cast<JSObject*>(_proto)->propList(exec,recursive);
_prop.addEnumerablesToReferenceList(list, this);
@@ -420,43 +420,43 @@
return list;
}
-ValueImp *ObjectImp::toPrimitive(ExecState *exec, Type preferredType) const
+JSValue *JSObject::toPrimitive(ExecState *exec, Type preferredType) const
{
return defaultValue(exec,preferredType);
}
-bool ObjectImp::toBoolean(ExecState */*exec*/) const
+bool JSObject::toBoolean(ExecState */*exec*/) const
{
return true;
}
-double ObjectImp::toNumber(ExecState *exec) const
+double JSObject::toNumber(ExecState *exec) const
{
- ValueImp *prim = toPrimitive(exec,NumberType);
+ JSValue *prim = toPrimitive(exec,NumberType);
if (exec->hadException()) // should be picked up soon in nodes.cpp
return 0.0;
return prim->toNumber(exec);
}
-UString ObjectImp::toString(ExecState *exec) const
+UString JSObject::toString(ExecState *exec) const
{
- ValueImp *prim = toPrimitive(exec,StringType);
+ JSValue *prim = toPrimitive(exec,StringType);
if (exec->hadException()) // should be picked up soon in nodes.cpp
return "";
return prim->toString(exec);
}
-ObjectImp *ObjectImp::toObject(ExecState */*exec*/) const
+JSObject *JSObject::toObject(ExecState */*exec*/) const
{
- return const_cast<ObjectImp*>(this);
+ return const_cast<JSObject*>(this);
}
-void ObjectImp::putDirect(const Identifier &propertyName, ValueImp *value, int attr)
+void JSObject::putDirect(const Identifier &propertyName, JSValue *value, int attr)
{
_prop.put(propertyName, value, attr);
}
-void ObjectImp::putDirect(const Identifier &propertyName, int value, int attr)
+void JSObject::putDirect(const Identifier &propertyName, int value, int attr)
{
_prop.put(propertyName, jsNumber(value), attr);
}
@@ -475,10 +475,10 @@
const char * const * const Error::errorNames = errorNamesArr;
-ObjectImp *Error::create(ExecState *exec, ErrorType errtype, const UString &message,
+JSObject *Error::create(ExecState *exec, ErrorType errtype, const UString &message,
int lineno, int sourceId, const UString *sourceURL)
{
- ObjectImp *cons;
+ JSObject *cons;
switch (errtype) {
case EvalError:
cons = exec->lexicalInterpreter()->builtinEvalError();
@@ -508,7 +508,7 @@
args.append(jsString(errorNames[errtype]));
else
args.append(jsString(message));
- ObjectImp *err = static_cast<ObjectImp *>(cons->construct(exec,args));
+ JSObject *err = static_cast<JSObject *>(cons->construct(exec,args));
if (lineno != -1)
err->put(exec, "line", jsNumber(lineno));
@@ -533,35 +533,35 @@
*/
}
-ObjectImp *Error::create(ExecState *exec, ErrorType type, const char *message)
+JSObject *Error::create(ExecState *exec, ErrorType type, const char *message)
{
return create(exec, type, message, -1, -1, NULL);
}
-ObjectImp *throwError(ExecState *exec, ErrorType type)
+JSObject *throwError(ExecState *exec, ErrorType type)
{
- ObjectImp *error = Error::create(exec, type, UString(), -1, -1, NULL);
+ JSObject *error = Error::create(exec, type, UString(), -1, -1, NULL);
exec->setException(error);
return error;
}
-ObjectImp *throwError(ExecState *exec, ErrorType type, const UString &message)
+JSObject *throwError(ExecState *exec, ErrorType type, const UString &message)
{
- ObjectImp *error = Error::create(exec, type, message, -1, -1, NULL);
+ JSObject *error = Error::create(exec, type, message, -1, -1, NULL);
exec->setException(error);
return error;
}
-ObjectImp *throwError(ExecState *exec, ErrorType type, const char *message)
+JSObject *throwError(ExecState *exec, ErrorType type, const char *message)
{
- ObjectImp *error = Error::create(exec, type, message, -1, -1, NULL);
+ JSObject *error = Error::create(exec, type, message, -1, -1, NULL);
exec->setException(error);
return error;
}
-ObjectImp *throwError(ExecState *exec, ErrorType type, const UString &message, int line, int sourceId, const UString *sourceURL)
+JSObject *throwError(ExecState *exec, ErrorType type, const UString &message, int line, int sourceId, const UString *sourceURL)
{
- ObjectImp *error = Error::create(exec, type, message, line, sourceId, sourceURL);
+ JSObject *error = Error::create(exec, type, message, line, sourceId, sourceURL);
exec->setException(error);
return error;
}
1.50 +52 -52 JavaScriptCore/kjs/object.h
Index: object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- object.h 4 Dec 2005 23:28:56 -0000 1.49
+++ object.h 11 Dec 2005 02:05:46 -0000 1.50
@@ -80,20 +80,20 @@
void *dummy;
};
- class ObjectImp : public AllocatedValueImp {
+ class JSObject : public JSCell {
public:
/**
- * Creates a new ObjectImp with the specified prototype
+ * Creates a new JSObject with the specified prototype
*
* @param proto The prototype
*/
- ObjectImp(ObjectImp *proto);
+ JSObject(JSObject *proto);
/**
- * Creates a new ObjectImp with a prototype of jsNull()
+ * Creates a new JSObject with a prototype of jsNull()
* (that is, the ECMAScript "null" value, not a null object pointer).
*/
- ObjectImp();
+ JSObject();
virtual void mark();
virtual Type type() const;
@@ -113,13 +113,13 @@
* class declarations:
*
* \code
- * class BarImp : public ObjectImp {
+ * class BarImp : public JSObject {
* virtual const ClassInfo *classInfo() const { return &info; }
* static const ClassInfo info;
* // ...
* };
*
- * class FooImp : public ObjectImp {
+ * class FooImp : public JSObject {
* virtual const ClassInfo *classInfo() const { return &info; }
* static const ClassInfo info;
* // ...
@@ -143,7 +143,7 @@
* class return a non-NULL pointer for their classInfo() methods (otherwise
* it will return false).
*
- * For example, for two ObjectImp pointers obj1 and obj2, you can check
+ * For example, for two JSObject pointers obj1 and obj2, you can check
* if obj1's class inherits from obj2's class using the following:
*
* if (obj1->inherits(obj2->classInfo())) {
@@ -175,8 +175,8 @@
*
* @return The object's prototype
*/
- ValueImp *prototype() const;
- void setPrototype(ValueImp *proto);
+ JSValue *prototype() const;
+ void setPrototype(JSValue *proto);
/**
* Returns the class name of the object
@@ -208,8 +208,8 @@
*
* @return The specified property, or Undefined
*/
- ValueImp *get(ExecState *exec, const Identifier &propertyName) const;
- ValueImp *get(ExecState *exec, unsigned propertyName) const;
+ JSValue *get(ExecState *exec, const Identifier &propertyName) const;
+ JSValue *get(ExecState *exec, unsigned propertyName) const;
bool getPropertySlot(ExecState *, const Identifier&, PropertySlot&);
bool getPropertySlot(ExecState *, unsigned, PropertySlot&);
@@ -226,8 +226,8 @@
* @param propertyName The name of the property to set
* @param propertyValue The value to set
*/
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- virtual void put(ExecState *exec, unsigned propertyName, ValueImp *value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ virtual void put(ExecState *exec, unsigned propertyName, JSValue *value, int attr = None);
/**
* Used to check whether or not a particular property is allowed to be set
@@ -299,7 +299,7 @@
* Implementation of the [[DefaultValue]] internal property (implemented by
* all Objects)
*/
- virtual ValueImp *defaultValue(ExecState *exec, Type hint) const;
+ virtual JSValue *defaultValue(ExecState *exec, Type hint) const;
/**
* Whether or not the object implements the construct() method. If this
@@ -339,8 +339,8 @@
/**
* Implementation of the [[Construct]] internal property
*/
- virtual ObjectImp *construct(ExecState *exec, const List &args);
- virtual ObjectImp *construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber);
+ virtual JSObject *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber);
/**
* Whether or not the object implements the call() method. If this returns
@@ -369,8 +369,8 @@
* @param args List of arguments to be passed to the function
* @return The return value from the function
*/
- ValueImp *call(ExecState *exec, ObjectImp *thisObj, const List &args);
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ JSValue *call(ExecState *exec, JSObject *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
/**
* Whether or not the object implements the hasInstance() method. If this
@@ -391,7 +391,7 @@
* @return true if value delegates behavior to this object, otherwise
* false
*/
- virtual bool hasInstance(ExecState *exec, ValueImp *value);
+ virtual bool hasInstance(ExecState *exec, JSValue *value);
/**
* Returns the scope of this object. This is used when execution declared
@@ -448,7 +448,7 @@
* @see ECMA 8.6.2
* @return The internal value of the object
*/
- ValueImp *internalValue() const;
+ JSValue *internalValue() const;
/**
* Sets the internal value of the object
@@ -457,24 +457,24 @@
*
* @param v The new internal value
*/
- void setInternalValue(ValueImp *v);
+ void setInternalValue(JSValue *v);
- ValueImp *toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const;
+ JSValue *toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const;
bool toBoolean(ExecState *exec) const;
double toNumber(ExecState *exec) const;
UString toString(ExecState *exec) const;
- ObjectImp *toObject(ExecState *exec) const;
+ JSObject *toObject(ExecState *exec) const;
bool getPropertyAttributes(const Identifier& propertyName, int& attributes) const;
// This get function only looks at the property map.
// This is used e.g. by lookupOrCreateFunction (to cache a function, we don't want
// to look up in the prototype, it might already exist there)
- ValueImp *getDirect(const Identifier& propertyName) const
+ JSValue *getDirect(const Identifier& propertyName) const
{ return _prop.get(propertyName); }
- ValueImp **getDirectLocation(const Identifier& propertyName)
+ JSValue **getDirectLocation(const Identifier& propertyName)
{ return _prop.getLocation(propertyName); }
- void putDirect(const Identifier &propertyName, ValueImp *value, int attr = 0);
+ void putDirect(const Identifier &propertyName, JSValue *value, int attr = 0);
void putDirect(const Identifier &propertyName, int value, int attr = 0);
/**
@@ -492,8 +492,8 @@
PropertyMap _prop;
private:
const HashEntry* findPropertyHashEntry( const Identifier& propertyName ) const;
- ValueImp *_proto;
- ValueImp *_internalValue;
+ JSValue *_proto;
+ JSValue *_internalValue;
ScopeChain _scope;
};
@@ -524,8 +524,8 @@
* @param sourceId Optional source id.
* @param sourceURL Optional source URL.
*/
- static ObjectImp *create(ExecState *, ErrorType, const UString &message, int lineNumber, int sourceId, const UString *sourceURL);
- static ObjectImp *create(ExecState *, ErrorType, const char *message);
+ static JSObject *create(ExecState *, ErrorType, const UString &message, int lineNumber, int sourceId, const UString *sourceURL);
+ static JSObject *create(ExecState *, ErrorType, const char *message);
/**
* Array of error names corresponding to ErrorType
@@ -533,49 +533,49 @@
static const char * const * const errorNames;
};
-ObjectImp *throwError(ExecState *, ErrorType, const UString &message, int lineNumber, int sourceId, const UString *sourceURL);
-ObjectImp *throwError(ExecState *, ErrorType, const UString &message);
-ObjectImp *throwError(ExecState *, ErrorType, const char *message);
-ObjectImp *throwError(ExecState *, ErrorType);
+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);
-inline bool AllocatedValueImp::isObject(const ClassInfo *info) const
+inline bool JSCell::isObject(const ClassInfo *info) const
{
- return isObject() && static_cast<const ObjectImp *>(this)->inherits(info);
+ return isObject() && static_cast<const JSObject *>(this)->inherits(info);
}
-inline ObjectImp::ObjectImp(ObjectImp *proto)
+inline JSObject::JSObject(JSObject *proto)
: _proto(proto), _internalValue(0)
{
assert(proto);
}
-inline ObjectImp::ObjectImp()
+inline JSObject::JSObject()
: _proto(jsNull()), _internalValue(0)
{
}
-inline ValueImp *ObjectImp::internalValue() const
+inline JSValue *JSObject::internalValue() const
{
return _internalValue;
}
-inline void ObjectImp::setInternalValue(ValueImp *v)
+inline void JSObject::setInternalValue(JSValue *v)
{
_internalValue = v;
}
-inline ValueImp *ObjectImp::prototype() const
+inline JSValue *JSObject::prototype() const
{
return _proto;
}
-inline void ObjectImp::setPrototype(ValueImp *proto)
+inline void JSObject::setPrototype(JSValue *proto)
{
assert(proto);
_proto = proto;
}
-inline bool ObjectImp::inherits(const ClassInfo *info) const
+inline bool JSObject::inherits(const ClassInfo *info) const
{
for (const ClassInfo *ci = classInfo(); ci; ci = ci->parentClass)
if (ci == info)
@@ -585,27 +585,27 @@
// It may seem crazy to inline a function this large but it makes a big difference
// since this is function very hot in variable lookup
-inline bool ObjectImp::getPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+inline bool JSObject::getPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
- ObjectImp *object = this;
+ JSObject *object = this;
while (true) {
if (object->getOwnPropertySlot(exec, propertyName, slot))
return true;
- ValueImp *proto = object->_proto;
+ JSValue *proto = object->_proto;
if (!proto->isObject())
return false;
- object = static_cast<ObjectImp *>(proto);
+ object = static_cast<JSObject *>(proto);
}
}
// It may seem crazy to inline a function this large, especially a virtual function,
// but it makes a big difference to property lookup that derived classes can inline their
// base class call to this.
-inline bool ObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+inline bool JSObject::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
- if (ValueImp **location = getDirectLocation(propertyName)) {
+ if (JSValue **location = getDirectLocation(propertyName)) {
slot.setValueSlot(this, location);
return true;
}
@@ -619,12 +619,12 @@
return false;
}
-// FIXME: Put this function in a separate file named something like scope_chain_mark.h -- can't put it in scope_chain.h since it depends on ObjectImp.
+// FIXME: Put this function in a separate file named something like scope_chain_mark.h -- can't put it in scope_chain.h since it depends on JSObject.
inline void ScopeChain::mark()
{
for (ScopeChainNode *n = _node; n; n = n->next) {
- ObjectImp *o = n->object;
+ JSObject *o = n->object;
if (!o->marked())
o->mark();
}
1.18 +25 -25 JavaScriptCore/kjs/object_object.cpp
Index: object_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object_object.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- object_object.cpp 11 Dec 2005 00:37:52 -0000 1.17
+++ object_object.cpp 11 Dec 2005 02:05:46 -0000 1.18
@@ -32,24 +32,24 @@
using namespace KJS;
-// ------------------------------ ObjectPrototypeImp --------------------------------
+// ------------------------------ ObjectPrototype --------------------------------
-ObjectPrototypeImp::ObjectPrototypeImp(ExecState *exec,
- FunctionPrototypeImp *funcProto)
- : ObjectImp() // [[Prototype]] is null
+ObjectPrototype::ObjectPrototype(ExecState *exec,
+ FunctionPrototype *funcProto)
+ : JSObject() // [[Prototype]] is null
{
- putDirect(toStringPropertyName, new ObjectProtoFuncImp(exec, funcProto, ObjectProtoFuncImp::ToString, 0), DontEnum);
- putDirect(toLocaleStringPropertyName, new ObjectProtoFuncImp(exec, funcProto, ObjectProtoFuncImp::ToLocaleString, 0), DontEnum);
- putDirect(valueOfPropertyName, new ObjectProtoFuncImp(exec, funcProto, ObjectProtoFuncImp::ValueOf, 0), DontEnum);
- putDirect("hasOwnProperty", new ObjectProtoFuncImp(exec, funcProto, ObjectProtoFuncImp::HasOwnProperty, 1), DontEnum);
- putDirect("propertyIsEnumerable", new ObjectProtoFuncImp(exec, funcProto, ObjectProtoFuncImp::PropertyIsEnumerable, 1), DontEnum);
+ putDirect(toStringPropertyName, new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::ToString, 0), DontEnum);
+ putDirect(toLocaleStringPropertyName, new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::ToLocaleString, 0), DontEnum);
+ putDirect(valueOfPropertyName, new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::ValueOf, 0), DontEnum);
+ putDirect("hasOwnProperty", new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::HasOwnProperty, 1), DontEnum);
+ putDirect("propertyIsEnumerable", new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::PropertyIsEnumerable, 1), DontEnum);
}
-// ------------------------------ ObjectProtoFuncImp --------------------------------
+// ------------------------------ ObjectProtoFunc --------------------------------
-ObjectProtoFuncImp::ObjectProtoFuncImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
+ObjectProtoFunc::ObjectProtoFunc(ExecState *exec,
+ FunctionPrototype *funcProto,
int i, int len)
: InternalFunctionImp(funcProto), id(i)
{
@@ -57,14 +57,14 @@
}
-bool ObjectProtoFuncImp::implementsCall() const
+bool ObjectProtoFunc::implementsCall() const
{
return true;
}
// ECMA 15.2.4.2, 15.2.4.4, 15.2.4.5, 15.2.4.7
-ValueImp *ObjectProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *ObjectProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
switch (id) {
case ValueOf:
@@ -86,8 +86,8 @@
// ------------------------------ ObjectObjectImp --------------------------------
ObjectObjectImp::ObjectObjectImp(ExecState *exec,
- ObjectPrototypeImp *objProto,
- FunctionPrototypeImp *funcProto)
+ ObjectPrototype *objProto,
+ FunctionPrototype *funcProto)
: InternalFunctionImp(funcProto)
{
// ECMA 15.2.3.1
@@ -104,17 +104,17 @@
}
// ECMA 15.2.2
-ObjectImp *ObjectObjectImp::construct(ExecState *exec, const List &args)
+JSObject *ObjectObjectImp::construct(ExecState *exec, const List &args)
{
// if no arguments have been passed ...
if (args.isEmpty()) {
- ObjectImp *proto = exec->lexicalInterpreter()->builtinObjectPrototype();
- ObjectImp *result(new ObjectImp(proto));
+ JSObject *proto = exec->lexicalInterpreter()->builtinObjectPrototype();
+ JSObject *result(new JSObject(proto));
return result;
}
- ValueImp *arg = *(args.begin());
- if (ObjectImp *obj = arg->getObject())
+ JSValue *arg = *(args.begin());
+ if (JSObject *obj = arg->getObject())
return obj;
switch (arg->type()) {
@@ -126,7 +126,7 @@
assert(!"unhandled switch case in ObjectConstructor");
case NullType:
case UndefinedType:
- return new ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype());
+ return new JSObject(exec->lexicalInterpreter()->builtinObjectPrototype());
}
}
@@ -135,16 +135,16 @@
return true;
}
-ValueImp *ObjectObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *ObjectObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
- ValueImp *result;
+ JSValue *result;
List argList;
// Construct a new Object
if (args.isEmpty()) {
result = construct(exec,argList);
} else {
- ValueImp *arg = args[0];
+ JSValue *arg = args[0];
if (arg->isUndefinedOrNull()) {
argList.append(arg);
result = construct(exec,argList);
1.11 +10 -10 JavaScriptCore/kjs/object_object.h
Index: object_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object_object.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- object_object.h 4 Dec 2005 23:28:56 -0000 1.10
+++ object_object.h 11 Dec 2005 02:05:46 -0000 1.11
@@ -26,7 +26,7 @@
namespace KJS {
- class FunctionPrototypeImp;
+ class FunctionPrototype;
/**
* @internal
@@ -34,9 +34,9 @@
* The initial value of Object.prototype (and thus all objects created
* with the Object constructor
*/
- class ObjectPrototypeImp : public ObjectImp {
+ class ObjectPrototype : public JSObject {
public:
- ObjectPrototypeImp(ExecState *exec, FunctionPrototypeImp *funcProto);
+ ObjectPrototype(ExecState *exec, FunctionPrototype *funcProto);
};
/**
@@ -45,12 +45,12 @@
* Class to implement all methods that are properties of the
* Object.prototype object
*/
- class ObjectProtoFuncImp : public InternalFunctionImp {
+ class ObjectProtoFunc : public InternalFunctionImp {
public:
- ObjectProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len);
+ ObjectProtoFunc(ExecState *exec, FunctionPrototype *funcProto, int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *, ObjectImp *, const List &args);
+ virtual JSValue *callAsFunction(ExecState *, JSObject *, const List &args);
enum { ToString, ToLocaleString, ValueOf, HasOwnProperty, PropertyIsEnumerable };
private:
@@ -66,13 +66,13 @@
public:
ObjectObjectImp(ExecState *exec,
- ObjectPrototypeImp *objProto,
- FunctionPrototypeImp *funcProto);
+ ObjectPrototype *objProto,
+ FunctionPrototype *funcProto);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *, const List &args);
+ virtual JSObject *construct(ExecState *, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *, ObjectImp *, const List &args);
+ virtual JSValue *callAsFunction(ExecState *, JSObject *, const List &args);
};
} // namespace
1.14 +9 -9 JavaScriptCore/kjs/operations.cpp
Index: operations.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/operations.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- operations.cpp 6 Oct 2005 01:13:18 -0000 1.13
+++ operations.cpp 11 Dec 2005 02:05:46 -0000 1.14
@@ -105,7 +105,7 @@
#endif
// ECMA 11.9.3
-bool equal(ExecState *exec, ValueImp *v1, ValueImp *v2)
+bool equal(ExecState *exec, JSValue *v1, JSValue *v2)
{
Type t1 = v1->type();
Type t2 = v2->type();
@@ -155,7 +155,7 @@
return v1 == v2;
}
-bool strictEqual(ExecState *exec, ValueImp *v1, ValueImp *v2)
+bool strictEqual(ExecState *exec, JSValue *v1, JSValue *v2)
{
Type t1 = v1->type();
Type t2 = v2->type();
@@ -182,10 +182,10 @@
return false;
}
-int relation(ExecState *exec, ValueImp *v1, ValueImp *v2)
+int relation(ExecState *exec, JSValue *v1, JSValue *v2)
{
- ValueImp *p1 = v1->toPrimitive(exec,NumberType);
- ValueImp *p2 = v2->toPrimitive(exec,NumberType);
+ JSValue *p1 = v1->toPrimitive(exec,NumberType);
+ JSValue *p2 = v2->toPrimitive(exec,NumberType);
if (p1->isString() && p2->isString())
return p1->toString(exec) < p2->toString(exec) ? 1 : 0;
@@ -210,12 +210,12 @@
}
// ECMA 11.6
-ValueImp *add(ExecState *exec, ValueImp *v1, ValueImp *v2, char oper)
+JSValue *add(ExecState *exec, JSValue *v1, JSValue *v2, char oper)
{
// exception for the Date exception in defaultValue()
Type preferred = oper == '+' ? UnspecifiedType : NumberType;
- ValueImp *p1 = v1->toPrimitive(exec, preferred);
- ValueImp *p2 = v2->toPrimitive(exec, preferred);
+ JSValue *p1 = v1->toPrimitive(exec, preferred);
+ JSValue *p2 = v2->toPrimitive(exec, preferred);
if ((p1->isString() || p2->isString()) && oper == '+') {
return jsString(p1->toString(exec) + p2->toString(exec));
@@ -228,7 +228,7 @@
}
// ECMA 11.5
-ValueImp *mult(ExecState *exec, ValueImp *v1, ValueImp *v2, char oper)
+JSValue *mult(ExecState *exec, JSValue *v1, JSValue *v2, char oper)
{
double n1 = v1->toNumber(exec);
double n2 = v2->toNumber(exec);
1.8 +6 -6 JavaScriptCore/kjs/operations.h
Index: operations.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/operations.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- operations.h 6 Oct 2005 01:13:18 -0000 1.7
+++ operations.h 11 Dec 2005 02:05:47 -0000 1.8
@@ -26,7 +26,7 @@
namespace KJS {
class ExecState;
- class ValueImp;
+ class JSValue;
#if APPLE_CHANGES
inline bool isNaN(double d) { return isnan(d); }
@@ -46,8 +46,8 @@
bool isNegInf(double d);
#endif
- bool equal(ExecState *exec, ValueImp *v1, ValueImp *v2);
- bool strictEqual(ExecState *exec, ValueImp *v1, ValueImp *v2);
+ bool equal(ExecState *exec, JSValue *v1, JSValue *v2);
+ bool strictEqual(ExecState *exec, JSValue *v1, JSValue *v2);
/**
* This operator performs an abstract relational comparison of the two
* arguments that can be of arbitrary type. If possible, conversions to the
@@ -56,7 +56,7 @@
* @return 1 if v1 is "less-than" v2, 0 if the relation is "greater-than-or-
* equal". -1 if the result is undefined.
*/
- int relation(ExecState *exec, ValueImp *v1, ValueImp *v2);
+ int relation(ExecState *exec, JSValue *v1, JSValue *v2);
int maxInt(int d1, int d2);
int minInt(int d1, int d2);
/**
@@ -65,7 +65,7 @@
* @param oper '+' or '-' for an addition or substraction, respectively.
* @return The result of the operation.
*/
- ValueImp *add(ExecState *exec, ValueImp *v1, ValueImp *v2, char oper);
+ JSValue *add(ExecState *exec, JSValue *v1, JSValue *v2, char oper);
/**
* Multiplicative operator. Either multiplies/divides v1 and v2 or
* calculates the remainder from an division.
@@ -73,7 +73,7 @@
* modulo operation.
* @return The result of the operation.
*/
- ValueImp *mult(ExecState *exec, ValueImp *v1, ValueImp *v2, char oper);
+ JSValue *mult(ExecState *exec, JSValue *v1, JSValue *v2, char oper);
};
1.54 +10 -10 JavaScriptCore/kjs/property_map.cpp
Index: property_map.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/property_map.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- property_map.cpp 6 Dec 2005 09:21:05 -0000 1.53
+++ property_map.cpp 11 Dec 2005 02:05:47 -0000 1.54
@@ -90,7 +90,7 @@
class SavedProperty {
public:
Identifier key;
- ProtectedPtr<ValueImp> value;
+ ProtectedPtr<JSValue> value;
int attributes;
};
@@ -153,7 +153,7 @@
_table->sentinelCount = 0;
}
-ValueImp *PropertyMap::get(const Identifier &name, int &attributes) const
+JSValue *PropertyMap::get(const Identifier &name, int &attributes) const
{
assert(!name.isNull());
@@ -194,7 +194,7 @@
return 0;
}
-ValueImp *PropertyMap::get(const Identifier &name) const
+JSValue *PropertyMap::get(const Identifier &name) const
{
assert(!name.isNull());
@@ -231,7 +231,7 @@
return 0;
}
-ValueImp **PropertyMap::getLocation(const Identifier &name)
+JSValue **PropertyMap::getLocation(const Identifier &name)
{
assert(!name.isNull());
@@ -288,7 +288,7 @@
}
#endif
-void PropertyMap::put(const Identifier &name, ValueImp *value, int attributes)
+void PropertyMap::put(const Identifier &name, JSValue *value, int attributes)
{
assert(!name.isNull());
assert(value != 0);
@@ -374,7 +374,7 @@
checkConsistency();
}
-void PropertyMap::insert(UString::Rep *key, ValueImp *value, int attributes, int index)
+void PropertyMap::insert(UString::Rep *key, JSValue *value, int attributes, int index)
{
assert(_table);
@@ -534,7 +534,7 @@
if (!_table) {
#if USE_SINGLE_ENTRY
if (_singleEntry.key) {
- ValueImp *v = _singleEntry.value;
+ JSValue *v = _singleEntry.value;
if (!v->marked())
v->mark();
}
@@ -545,7 +545,7 @@
int minimumKeysToProcess = _table->keyCount;
Entry *entries = _table->entries;
for (int i = 0; i < minimumKeysToProcess; i++) {
- ValueImp *v = entries[i].value;
+ JSValue *v = entries[i].value;
if (v) {
if (!v->marked())
v->mark();
@@ -566,7 +566,7 @@
return 0;
}
-void PropertyMap::addEnumerablesToReferenceList(ReferenceList &list, ObjectImp *base) const
+void PropertyMap::addEnumerablesToReferenceList(ReferenceList &list, JSObject *base) const
{
if (!_table) {
#if USE_SINGLE_ENTRY
@@ -608,7 +608,7 @@
delete [] sortedEnumerables;
}
-void PropertyMap::addSparseArrayPropertiesToReferenceList(ReferenceList &list, ObjectImp *base) const
+void PropertyMap::addSparseArrayPropertiesToReferenceList(ReferenceList &list, JSObject *base) const
{
if (!_table) {
#if USE_SINGLE_ENTRY
1.27 +10 -10 JavaScriptCore/kjs/property_map.h
Index: property_map.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/property_map.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- property_map.h 16 Oct 2005 00:46:23 -0000 1.26
+++ property_map.h 11 Dec 2005 02:05:47 -0000 1.27
@@ -27,9 +27,9 @@
namespace KJS {
- class ObjectImp;
+ class JSObject;
class ReferenceList;
- class ValueImp;
+ class JSValue;
class SavedProperty;
@@ -59,7 +59,7 @@
{
PropertyMapHashTableEntry() : key(0) { }
UString::Rep *key;
- ValueImp *value;
+ JSValue *value;
int attributes;
int index;
};
@@ -74,15 +74,15 @@
void clear();
- void put(const Identifier &name, ValueImp *value, int attributes);
+ void put(const Identifier &name, JSValue *value, int attributes);
void remove(const Identifier &name);
- ValueImp *get(const Identifier &name) const;
- ValueImp *get(const Identifier &name, int &attributes) const;
- ValueImp **getLocation(const Identifier &name);
+ JSValue *get(const Identifier &name) const;
+ JSValue *get(const Identifier &name, int &attributes) const;
+ JSValue **getLocation(const Identifier &name);
void mark() const;
- void addEnumerablesToReferenceList(ReferenceList &, ObjectImp *) const;
- void addSparseArrayPropertiesToReferenceList(ReferenceList &, ObjectImp *) const;
+ void addEnumerablesToReferenceList(ReferenceList &, JSObject *) const;
+ void addSparseArrayPropertiesToReferenceList(ReferenceList &, JSObject *) const;
void save(SavedProperties &) const;
void restore(const SavedProperties &p);
@@ -93,7 +93,7 @@
void rehash();
void rehash(int newTableSize);
- void insert(UString::Rep *, ValueImp *value, int attributes, int index);
+ void insert(UString::Rep *, JSValue *value, int attributes, int index);
void checkConsistency();
1.5 +1 -1 JavaScriptCore/kjs/property_slot.cpp
Index: property_slot.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/property_slot.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- property_slot.cpp 11 Dec 2005 00:37:52 -0000 1.4
+++ property_slot.cpp 11 Dec 2005 02:05:47 -0000 1.5
@@ -26,7 +26,7 @@
namespace KJS {
-ValueImp *PropertySlot::undefinedGetter(ExecState *, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *PropertySlot::undefinedGetter(ExecState *, const Identifier& propertyName, const PropertySlot& slot)
{
return jsUndefined();
}
1.7 +13 -13 JavaScriptCore/kjs/property_slot.h
Index: property_slot.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/property_slot.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- property_slot.h 28 Sep 2005 22:27:39 -0000 1.6
+++ property_slot.h 11 Dec 2005 02:05:47 -0000 1.7
@@ -30,36 +30,36 @@
class HashEntry;
class ExecState;
-class ObjectImp;
+class JSObject;
#define VALUE_SLOT_MARKER ((GetValueFunc)1)
class PropertySlot
{
public:
- typedef ValueImp *(*GetValueFunc)(ExecState *, const Identifier&, const PropertySlot&);
+ typedef JSValue *(*GetValueFunc)(ExecState *, const Identifier&, const PropertySlot&);
- ValueImp *getValue(ExecState *exec, const Identifier& propertyName) const
+ JSValue *getValue(ExecState *exec, const Identifier& propertyName) const
{
if (m_getValue == VALUE_SLOT_MARKER)
return *m_data.valueSlot;
return m_getValue(exec, propertyName, *this);
}
- ValueImp *getValue(ExecState *exec, unsigned propertyName) const
+ JSValue *getValue(ExecState *exec, unsigned propertyName) const
{
if (m_getValue == VALUE_SLOT_MARKER)
return *m_data.valueSlot;
return m_getValue(exec, Identifier::from(propertyName), *this);
}
- void setValueSlot(ObjectImp *slotBase, ValueImp **valueSlot)
+ void setValueSlot(JSObject *slotBase, JSValue **valueSlot)
{
m_slotBase = slotBase;
m_data.valueSlot = valueSlot;
m_getValue = VALUE_SLOT_MARKER;
}
- void setStaticEntry(ObjectImp *slotBase, const HashEntry *staticEntry, GetValueFunc getValue)
+ void setStaticEntry(JSObject *slotBase, const HashEntry *staticEntry, GetValueFunc getValue)
{
assert(getValue);
m_slotBase = slotBase;
@@ -67,14 +67,14 @@
m_getValue = getValue;
}
- void setCustom(ObjectImp *slotBase, GetValueFunc getValue)
+ void setCustom(JSObject *slotBase, GetValueFunc getValue)
{
assert(getValue);
m_slotBase = slotBase;
m_getValue = getValue;
}
- void setCustomIndex(ObjectImp *slotBase, unsigned index, GetValueFunc getValue)
+ void setCustomIndex(JSObject *slotBase, unsigned index, GetValueFunc getValue)
{
assert(getValue);
m_slotBase = slotBase;
@@ -82,25 +82,25 @@
m_getValue = getValue;
}
- void setUndefined(ObjectImp *slotBase)
+ void setUndefined(JSObject *slotBase)
{
m_slotBase = slotBase;
m_getValue = undefinedGetter;
}
- ObjectImp *slotBase() const { return m_slotBase; }
+ JSObject *slotBase() const { return m_slotBase; }
const HashEntry *staticEntry() const { return m_data.staticEntry; }
unsigned index() const { return m_data.index; }
private:
- static ValueImp *undefinedGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *undefinedGetter(ExecState *, const Identifier&, const PropertySlot&);
GetValueFunc m_getValue;
- ObjectImp *m_slotBase;
+ JSObject *m_slotBase;
union {
- ValueImp **valueSlot;
+ JSValue **valueSlot;
const HashEntry *staticEntry;
unsigned index;
} m_data;
1.15 +4 -4 JavaScriptCore/kjs/protect.h
Index: protect.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/protect.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- protect.h 1 Dec 2005 10:31:59 -0000 1.14
+++ protect.h 11 Dec 2005 02:05:47 -0000 1.15
@@ -31,22 +31,22 @@
namespace KJS {
- inline void gcProtect(ValueImp *val)
+ inline void gcProtect(JSValue *val)
{
ProtectedValues::increaseProtectCount(val);
}
- inline void gcUnprotect(ValueImp *val)
+ inline void gcUnprotect(JSValue *val)
{
ProtectedValues::decreaseProtectCount(val);
}
- inline void gcProtectNullTolerant(ValueImp *val)
+ inline void gcProtectNullTolerant(JSValue *val)
{
if (val) gcProtect(val);
}
- inline void gcUnprotectNullTolerant(ValueImp *val)
+ inline void gcUnprotectNullTolerant(JSValue *val)
{
if (val) gcUnprotect(val);
}
1.5 +3 -3 JavaScriptCore/kjs/protected_reference.h
Index: protected_reference.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/protected_reference.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- protected_reference.h 27 Nov 2005 07:54:45 -0000 1.4
+++ protected_reference.h 11 Dec 2005 02:05:47 -0000 1.5
@@ -47,7 +47,7 @@
ProtectedReference& operator=(const Reference &r)
{
JSLock lock;
- ValueImp *old = base;
+ JSValue *old = base;
Reference::operator=(r);
gcProtectNullTolerant(base);
gcUnprotectNullTolerant(old);
@@ -56,8 +56,8 @@
private:
ProtectedReference();
- ProtectedReference(ObjectImp *b, const Identifier& p);
- ProtectedReference(ObjectImp *b, unsigned p);
+ ProtectedReference(JSObject *b, const Identifier& p);
+ ProtectedReference(JSObject *b, unsigned p);
ProtectedReference(const Identifier& p);
ProtectedReference(unsigned p);
};
1.11 +7 -7 JavaScriptCore/kjs/protected_values.cpp
Index: protected_values.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/protected_values.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- protected_values.cpp 27 Nov 2005 07:54:45 -0000 1.10
+++ protected_values.cpp 11 Dec 2005 02:05:48 -0000 1.11
@@ -39,7 +39,7 @@
int ProtectedValues::_tableSizeMask;
int ProtectedValues::_keyCount;
-int ProtectedValues::getProtectCount(ValueImp *k)
+int ProtectedValues::getProtectCount(JSValue *k)
{
assert(k);
assert(JSLock::lockCount() > 0);
@@ -57,7 +57,7 @@
++numProbes;
numCollisions += _table[i].key && _table[i].key != k;
#endif
- while (AllocatedValueImp *key = _table[i].key) {
+ while (JSCell *key = _table[i].key) {
if (key == k) {
return _table[i].value;
}
@@ -68,7 +68,7 @@
}
-void ProtectedValues::increaseProtectCount(ValueImp *k)
+void ProtectedValues::increaseProtectCount(JSValue *k)
{
assert(k);
assert(JSLock::lockCount() > 0);
@@ -86,7 +86,7 @@
++numProbes;
numCollisions += _table[i].key && _table[i].key != k;
#endif
- while (AllocatedValueImp *key = _table[i].key) {
+ while (JSCell *key = _table[i].key) {
if (key == k) {
_table[i].value++;
return;
@@ -102,7 +102,7 @@
expand();
}
-inline void ProtectedValues::insert(AllocatedValueImp *k, int v)
+inline void ProtectedValues::insert(JSCell *k, int v)
{
unsigned hash = pointerHash(k);
@@ -118,7 +118,7 @@
_table[i].value = v;
}
-void ProtectedValues::decreaseProtectCount(ValueImp *k)
+void ProtectedValues::decreaseProtectCount(JSValue *k)
{
assert(k);
assert(JSLock::lockCount() > 0);
@@ -128,7 +128,7 @@
unsigned hash = pointerHash(k);
- AllocatedValueImp *key;
+ JSCell *key;
int i = hash & _tableSizeMask;
#if DUMP_STATISTICS
1.4 +7 -7 JavaScriptCore/kjs/protected_values.h
Index: protected_values.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/protected_values.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- protected_values.h 8 Aug 2005 04:07:29 -0000 1.3
+++ protected_values.h 11 Dec 2005 02:05:48 -0000 1.4
@@ -24,18 +24,18 @@
#define KJS_PROTECTED_VALUES_H
namespace KJS {
- class ValueImp;
- class AllocatedValueImp;
+ class JSValue;
+ class JSCell;
class ProtectedValues {
public:
- static void increaseProtectCount(ValueImp *key);
- static void decreaseProtectCount(ValueImp *key);
+ static void increaseProtectCount(JSValue *key);
+ static void decreaseProtectCount(JSValue *key);
- static int getProtectCount(ValueImp *key);
+ static int getProtectCount(JSValue *key);
private:
- static void insert(AllocatedValueImp *key, int value);
+ static void insert(JSCell *key, int value);
static void expand();
static void shrink();
static void rehash(int newTableSize);
@@ -44,7 +44,7 @@
friend class Collector;
struct KeyValue {
- AllocatedValueImp *key;
+ JSCell *key;
int value;
};
1.19 +9 -9 JavaScriptCore/kjs/reference.cpp
Index: reference.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/reference.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- reference.cpp 16 Oct 2005 00:46:23 -0000 1.18
+++ reference.cpp 11 Dec 2005 02:05:48 -0000 1.19
@@ -29,14 +29,14 @@
// ------------------------------ Reference ------------------------------------
-Reference::Reference(ObjectImp *b, const Identifier& p)
+Reference::Reference(JSObject *b, const Identifier& p)
: base(b),
propertyNameIsNumber(false),
prop(p)
{
}
-Reference::Reference(ObjectImp *b, unsigned p)
+Reference::Reference(JSObject *b, unsigned p)
: base(b),
propertyNameAsNumber(p),
propertyNameIsNumber(true)
@@ -50,9 +50,9 @@
return prop;
}
-ValueImp *Reference::getValue(ExecState *exec) const
+JSValue *Reference::getValue(ExecState *exec) const
{
- ValueImp *o = base;
+ JSValue *o = base;
if (!o || !o->isObject()) {
if (!o || o->isNull())
return throwError(exec, ReferenceError, "Can't find variable: " + getPropertyName(exec).ustring());
@@ -60,13 +60,13 @@
}
if (propertyNameIsNumber)
- return static_cast<ObjectImp*>(o)->get(exec, propertyNameAsNumber);
- return static_cast<ObjectImp*>(o)->get(exec, prop);
+ return static_cast<JSObject*>(o)->get(exec, propertyNameAsNumber);
+ return static_cast<JSObject*>(o)->get(exec, prop);
}
bool Reference::deleteValue(ExecState *exec)
{
- ValueImp *o = base;
+ JSValue *o = base;
Type t = o ? o->type() : NullType;
// The spec doesn't mention what to do if the base is null... just return true
@@ -76,8 +76,8 @@
}
if (propertyNameIsNumber)
- return static_cast<ObjectImp*>(o)->deleteProperty(exec,propertyNameAsNumber);
- return static_cast<ObjectImp*>(o)->deleteProperty(exec,prop);
+ return static_cast<JSObject*>(o)->deleteProperty(exec,propertyNameAsNumber);
+ return static_cast<JSObject*>(o)->deleteProperty(exec,prop);
}
}
1.17 +5 -5 JavaScriptCore/kjs/reference.h
Index: reference.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/reference.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- reference.h 16 Oct 2005 00:46:23 -0000 1.16
+++ reference.h 11 Dec 2005 02:05:48 -0000 1.17
@@ -28,14 +28,14 @@
namespace KJS {
- class ObjectImp;
+ class JSObject;
class Reference {
friend class ReferenceList;
friend class ReferenceListIterator;
public:
- Reference(ObjectImp *b, const Identifier& p);
- Reference(ObjectImp *b, unsigned p);
+ Reference(JSObject *b, const Identifier& p);
+ Reference(JSObject *b, unsigned p);
/**
* Performs the GetPropertyName type conversion operation on this value
@@ -47,7 +47,7 @@
* Performs the GetValue type conversion operation on this value
* (ECMA 8.7.1)
*/
- ValueImp *getValue(ExecState *exec) const;
+ JSValue *getValue(ExecState *exec) const;
/**
* Performs the PutValue type conversion operation on this value
@@ -56,7 +56,7 @@
bool deleteValue(ExecState *exec);
protected:
- ValueImp *base;
+ JSValue *base;
private:
Reference() { }
1.29 +33 -33 JavaScriptCore/kjs/regexp_object.cpp
Index: regexp_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/regexp_object.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- regexp_object.cpp 11 Dec 2005 00:37:52 -0000 1.28
+++ regexp_object.cpp 11 Dec 2005 02:05:48 -0000 1.29
@@ -38,46 +38,46 @@
using namespace KJS;
-// ------------------------------ RegExpPrototypeImp ---------------------------
+// ------------------------------ RegExpPrototype ---------------------------
// ECMA 15.9.4
-const ClassInfo RegExpPrototypeImp::info = {"RegExpPrototype", 0, 0, 0};
+const ClassInfo RegExpPrototype::info = {"RegExpPrototype", 0, 0, 0};
-RegExpPrototypeImp::RegExpPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objProto,
- FunctionPrototypeImp *funcProto)
- : ObjectImp(objProto)
+RegExpPrototype::RegExpPrototype(ExecState *exec,
+ ObjectPrototype *objProto,
+ FunctionPrototype *funcProto)
+ : JSObject(objProto)
{
setInternalValue(jsString(""));
// The constructor will be added later in RegExpObject's constructor (?)
static const Identifier execPropertyName("exec");
- putDirect(execPropertyName, new RegExpProtoFuncImp(exec,funcProto,RegExpProtoFuncImp::Exec, 0), DontEnum);
+ putDirect(execPropertyName, new RegExpProtoFunc(exec,funcProto,RegExpProtoFunc::Exec, 0), DontEnum);
static const Identifier testPropertyName("test");
- putDirect(testPropertyName, new RegExpProtoFuncImp(exec,funcProto,RegExpProtoFuncImp::Test, 0), DontEnum);
- putDirect(toStringPropertyName, new RegExpProtoFuncImp(exec,funcProto,RegExpProtoFuncImp::ToString, 0), DontEnum);
+ putDirect(testPropertyName, new RegExpProtoFunc(exec,funcProto,RegExpProtoFunc::Test, 0), DontEnum);
+ putDirect(toStringPropertyName, new RegExpProtoFunc(exec,funcProto,RegExpProtoFunc::ToString, 0), DontEnum);
}
-// ------------------------------ RegExpProtoFuncImp ---------------------------
+// ------------------------------ RegExpProtoFunc ---------------------------
-RegExpProtoFuncImp::RegExpProtoFuncImp(ExecState *exec,
- FunctionPrototypeImp *funcProto, int i, int len)
+RegExpProtoFunc::RegExpProtoFunc(ExecState *exec,
+ FunctionPrototype *funcProto, int i, int len)
: InternalFunctionImp(funcProto), id(i)
{
putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
}
-bool RegExpProtoFuncImp::implementsCall() const
+bool RegExpProtoFunc::implementsCall() const
{
return true;
}
-ValueImp *RegExpProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *RegExpProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&RegExpImp::info)) {
- if (thisObj->inherits(&RegExpPrototypeImp::info)) {
+ if (thisObj->inherits(&RegExpPrototype::info)) {
switch (id) {
case ToString: return jsString("//");
}
@@ -150,8 +150,8 @@
const ClassInfo RegExpImp::info = {"RegExp", 0, 0, 0};
-RegExpImp::RegExpImp(RegExpPrototypeImp *regexpProto)
- : ObjectImp(regexpProto), reg(0L)
+RegExpImp::RegExpImp(RegExpPrototype *regexpProto)
+ : JSObject(regexpProto), reg(0L)
{
}
@@ -191,8 +191,8 @@
*/
RegExpObjectImp::RegExpObjectImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
- RegExpPrototypeImp *regProto)
+ FunctionPrototype *funcProto,
+ RegExpPrototype *regProto)
: InternalFunctionImp(funcProto), multiline(false), lastInput(""), lastOvector(0), lastNumSubPatterns(0)
{
@@ -236,7 +236,7 @@
return match;
}
-ObjectImp *RegExpObjectImp::arrayOfMatches(ExecState *exec, const UString &result) const
+JSObject *RegExpObjectImp::arrayOfMatches(ExecState *exec, const UString &result) const
{
List list;
// The returned array contains 'result' as first item, followed by the list of matches
@@ -252,13 +252,13 @@
list.append(jsString(substring));
}
}
- ObjectImp *arr = exec->lexicalInterpreter()->builtinArray()->construct(exec, list);
+ JSObject *arr = exec->lexicalInterpreter()->builtinArray()->construct(exec, list);
arr->put(exec, "index", jsNumber(lastOvector[0]));
arr->put(exec, "input", jsString(lastInput));
return arr;
}
-ValueImp *RegExpObjectImp::getBackref(unsigned i) const
+JSValue *RegExpObjectImp::getBackref(unsigned i) const
{
if (lastOvector && i < lastNumSubPatterns + 1) {
UString substring = lastInput.substr(lastOvector[2*i], lastOvector[2*i+1] - lastOvector[2*i] );
@@ -268,7 +268,7 @@
return jsString("");
}
-ValueImp *RegExpObjectImp::getLastMatch() const
+JSValue *RegExpObjectImp::getLastMatch() const
{
if (lastOvector) {
UString substring = lastInput.substr(lastOvector[0], lastOvector[1] - lastOvector[0]);
@@ -278,7 +278,7 @@
return jsString("");
}
-ValueImp *RegExpObjectImp::getLastParen() const
+JSValue *RegExpObjectImp::getLastParen() const
{
int i = lastNumSubPatterns;
if (i > 0) {
@@ -290,7 +290,7 @@
return jsString("");
}
-ValueImp *RegExpObjectImp::getLeftContext() const
+JSValue *RegExpObjectImp::getLeftContext() const
{
if (lastOvector) {
UString substring = lastInput.substr(0, lastOvector[0]);
@@ -300,7 +300,7 @@
return jsString("");
}
-ValueImp *RegExpObjectImp::getRightContext() const
+JSValue *RegExpObjectImp::getRightContext() const
{
if (lastOvector) {
UString s = lastInput;
@@ -316,7 +316,7 @@
return getStaticValueSlot<RegExpObjectImp, InternalFunctionImp>(exec, &RegExpTable, this, propertyName, slot);
}
-ValueImp *RegExpObjectImp::getValueProperty(ExecState *exec, int token) const
+JSValue *RegExpObjectImp::getValueProperty(ExecState *exec, int token) const
{
switch (token) {
case Dollar1:
@@ -356,12 +356,12 @@
return jsString("");
}
-void RegExpObjectImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void RegExpObjectImp::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
lookupPut<RegExpObjectImp, InternalFunctionImp>(exec, propertyName, value, attr, &RegExpTable, this);
}
-void RegExpObjectImp::putValueProperty(ExecState *exec, int token, ValueImp *value, int attr)
+void RegExpObjectImp::putValueProperty(ExecState *exec, int token, JSValue *value, int attr)
{
switch (token) {
case Input:
@@ -381,9 +381,9 @@
}
// ECMA 15.10.4
-ObjectImp *RegExpObjectImp::construct(ExecState *exec, const List &args)
+JSObject *RegExpObjectImp::construct(ExecState *exec, const List &args)
{
- ObjectImp *o = args[0]->getObject();
+ JSObject *o = args[0]->getObject();
if (o && o->inherits(&RegExpImp::info)) {
if (!args[1]->isUndefined())
return throwError(exec, TypeError);
@@ -393,7 +393,7 @@
UString p = args[0]->isUndefined() ? UString("") : args[0]->toString(exec);
UString flags = args[1]->isUndefined() ? UString("") : args[1]->toString(exec);
- RegExpPrototypeImp *proto = static_cast<RegExpPrototypeImp*>(exec->lexicalInterpreter()->builtinRegExpPrototype());
+ RegExpPrototype *proto = static_cast<RegExpPrototype*>(exec->lexicalInterpreter()->builtinRegExpPrototype());
RegExpImp *dat = new RegExpImp(proto);
bool global = (flags.find("g") >= 0);
@@ -426,7 +426,7 @@
}
// ECMA 15.10.3
-ValueImp *RegExpObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/,
+JSValue *RegExpObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/,
const List &args)
{
// TODO: handle RegExp argument case (15.10.3.1)
1.14 +23 -23 JavaScriptCore/kjs/regexp_object.h
Index: regexp_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/regexp_object.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- regexp_object.h 11 Oct 2005 20:43:49 -0000 1.13
+++ regexp_object.h 11 Dec 2005 02:05:48 -0000 1.14
@@ -28,31 +28,31 @@
namespace KJS {
class ExecState;
- class RegExpPrototypeImp : public ObjectImp {
+ class RegExpPrototype : public JSObject {
public:
- RegExpPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objProto,
- FunctionPrototypeImp *funcProto);
+ RegExpPrototype(ExecState *exec,
+ ObjectPrototype *objProto,
+ FunctionPrototype *funcProto);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
- class RegExpProtoFuncImp : public InternalFunctionImp {
+ class RegExpProtoFunc : public InternalFunctionImp {
public:
- RegExpProtoFuncImp(ExecState *exec,
- FunctionPrototypeImp *funcProto, int i, int len);
+ RegExpProtoFunc(ExecState *exec,
+ FunctionPrototype *funcProto, int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
enum { Exec, Test, ToString };
private:
int id;
};
- class RegExpImp : public ObjectImp {
+ class RegExpImp : public JSObject {
public:
- RegExpImp(RegExpPrototypeImp *regexpProto);
+ RegExpImp(RegExpPrototype *regexpProto);
~RegExpImp();
void setRegExp(RegExp *r) { reg = r; }
RegExp* regExp() const { return reg; }
@@ -69,28 +69,28 @@
Input, Multiline, LastMatch, LastParen, LeftContext, RightContext };
RegExpObjectImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
- RegExpPrototypeImp *regProto);
+ FunctionPrototype *funcProto,
+ RegExpPrototype *regProto);
virtual ~RegExpObjectImp();
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
- virtual void put(ExecState *, const Identifier &, ValueImp *, int attr = None);
- void putValueProperty(ExecState *, int token, ValueImp *, int attr);
+ virtual void put(ExecState *, const Identifier &, JSValue *, int attr = None);
+ void putValueProperty(ExecState *, int token, JSValue *, int attr);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
UString performMatch(RegExp *, const UString&, int startOffset = 0, int *endOffset = 0, int **ovector = 0);
- ObjectImp *arrayOfMatches(ExecState *exec, const UString &result) const;
+ JSObject *arrayOfMatches(ExecState *exec, const UString &result) const;
virtual const ClassInfo *classInfo() const { return &info; }
private:
- ValueImp *getBackref(unsigned) const;
- ValueImp *getLastMatch() const;
- ValueImp *getLastParen() const;
- ValueImp *getLeftContext() const;
- ValueImp *getRightContext() const;
+ JSValue *getBackref(unsigned) const;
+ JSValue *getLastMatch() const;
+ JSValue *getLastParen() const;
+ JSValue *getLeftContext() const;
+ JSValue *getRightContext() const;
// Global search cache / settings
bool multiline;
1.14 +10 -10 JavaScriptCore/kjs/scope_chain.h
Index: scope_chain.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/scope_chain.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- scope_chain.h 27 Nov 2005 01:28:30 -0000 1.13
+++ scope_chain.h 11 Dec 2005 02:05:48 -0000 1.14
@@ -26,15 +26,15 @@
namespace KJS {
- class ObjectImp;
+ class JSObject;
class ScopeChainNode {
public:
- ScopeChainNode(ScopeChainNode *n, ObjectImp *o)
+ ScopeChainNode(ScopeChainNode *n, JSObject *o)
: next(n), object(o), refCount(1) { }
ScopeChainNode *next;
- ObjectImp *object;
+ JSObject *object;
int refCount;
};
@@ -42,8 +42,8 @@
public:
ScopeChainIterator(ScopeChainNode *node) : m_node(node) {}
- ObjectImp * const & operator*() const { return m_node->object; }
- ObjectImp * const * operator->() const { return &(operator*()); }
+ JSObject * const & operator*() const { return m_node->object; }
+ JSObject * const * operator->() const { return &(operator*()); }
ScopeChainIterator& operator++() { m_node = m_node->next; return *this; }
@@ -66,15 +66,15 @@
ScopeChain &operator=(const ScopeChain &);
bool isEmpty() const { return !_node; }
- ObjectImp *top() const { return _node->object; }
+ JSObject *top() const { return _node->object; }
- ObjectImp *bottom() const;
+ JSObject *bottom() const;
ScopeChainIterator begin() const { return ScopeChainIterator(_node); }
ScopeChainIterator end() const { return ScopeChainIterator(0); }
void clear() { deref(); _node = 0; }
- void push(ObjectImp *);
+ void push(JSObject *);
void push(const ScopeChain &);
void pop();
@@ -105,7 +105,7 @@
return *this;
}
-inline ObjectImp *ScopeChain::bottom() const
+inline JSObject *ScopeChain::bottom() const
{
ScopeChainNode *last = 0;
for (ScopeChainNode *n = _node; n; n = n->next)
@@ -115,7 +115,7 @@
return last->object;
}
-inline void ScopeChain::push(ObjectImp *o)
+inline void ScopeChain::push(JSObject *o)
{
assert(o);
_node = new ScopeChainNode(_node, o);
1.21 +8 -8 JavaScriptCore/kjs/simple_number.h
Index: simple_number.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/simple_number.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- simple_number.h 14 Oct 2005 21:03:56 -0000 1.20
+++ simple_number.h 11 Dec 2005 02:05:48 -0000 1.21
@@ -46,7 +46,7 @@
namespace KJS {
- class ValueImp;
+ class JSValue;
class SimpleNumber {
public:
@@ -54,11 +54,11 @@
static const unsigned long tagMask = 3; // 11 is the tag mask, since it's 2 bits long.
ALWAYS_INLINE
- static ValueImp *make(double d)
+ static JSValue *make(double d)
{
if (sizeof(float) == sizeof(unsigned long) &&
sizeof(double) == sizeof(unsigned long long) &&
- sizeof(ValueImp *) >= sizeof(unsigned long)) {
+ sizeof(JSValue *) >= sizeof(unsigned long)) {
// 32-bit
union {
unsigned long asBits;
@@ -79,9 +79,9 @@
if (doubleUnion1.asBits != doubleUnion2.asBits)
return 0;
- return reinterpret_cast<ValueImp *>(floatUnion.asBits | tag);
+ return reinterpret_cast<JSValue *>(floatUnion.asBits | tag);
} else if (sizeof(double) == sizeof(unsigned long) &&
- sizeof(ValueImp*) >= sizeof(unsigned long)) {
+ sizeof(JSValue*) >= sizeof(unsigned long)) {
// 64-bit
union {
unsigned long asBits;
@@ -92,20 +92,20 @@
if ((doubleUnion.asBits & tagMask) != 0)
return 0;
- return reinterpret_cast<ValueImp *>(doubleUnion.asBits | tag);
+ return reinterpret_cast<JSValue *>(doubleUnion.asBits | tag);
} else {
// could just return 0 here, but nicer to be explicit about not supporting the platform well
abort();
}
}
- static bool is(const ValueImp *imp)
+ static bool is(const JSValue *imp)
{
return (reinterpret_cast<unsigned long>(imp) & tagMask) == tag;
}
ALWAYS_INLINE
- static double value(const ValueImp *imp)
+ static double value(const JSValue *imp)
{
assert(is(imp));
1.52 +80 -80 JavaScriptCore/kjs/string_object.cpp
Index: string_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/string_object.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- string_object.cpp 11 Dec 2005 00:37:52 -0000 1.51
+++ string_object.cpp 11 Dec 2005 02:05:49 -0000 1.52
@@ -36,34 +36,34 @@
using namespace KJS;
-// ------------------------------ StringInstanceImp ----------------------------
+// ------------------------------ StringInstance ----------------------------
-const ClassInfo StringInstanceImp::info = {"String", 0, 0, 0};
+const ClassInfo StringInstance::info = {"String", 0, 0, 0};
-StringInstanceImp::StringInstanceImp(ObjectImp *proto)
- : ObjectImp(proto)
+StringInstance::StringInstance(JSObject *proto)
+ : JSObject(proto)
{
setInternalValue(jsString(""));
}
-StringInstanceImp::StringInstanceImp(ObjectImp *proto, const UString &string)
- : ObjectImp(proto)
+StringInstance::StringInstance(JSObject *proto, const UString &string)
+ : JSObject(proto)
{
setInternalValue(jsString(string));
}
-ValueImp *StringInstanceImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot &slot)
+JSValue *StringInstance::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot &slot)
{
- return jsNumber(static_cast<StringInstanceImp *>(slot.slotBase())->internalValue()->toString(exec).size());
+ return jsNumber(static_cast<StringInstance *>(slot.slotBase())->internalValue()->toString(exec).size());
}
-ValueImp *StringInstanceImp::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot &slot)
+JSValue *StringInstance::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot &slot)
{
- const UChar c = static_cast<StringInstanceImp *>(slot.slotBase())->internalValue()->toString(exec)[slot.index()];
+ const UChar c = static_cast<StringInstance *>(slot.slotBase())->internalValue()->toString(exec)[slot.index()];
return jsString(UString(&c, 1));
}
-bool StringInstanceImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot)
+bool StringInstance::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot)
{
if (propertyName == lengthPropertyName) {
slot.setCustom(this, lengthGetter);
@@ -81,96 +81,96 @@
return true;
}
- return ObjectImp::getOwnPropertySlot(exec, propertyName, slot);
+ return JSObject::getOwnPropertySlot(exec, propertyName, slot);
}
-void StringInstanceImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void StringInstance::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
if (propertyName == lengthPropertyName)
return;
- ObjectImp::put(exec, propertyName, value, attr);
+ JSObject::put(exec, propertyName, value, attr);
}
-bool StringInstanceImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
+bool StringInstance::deleteProperty(ExecState *exec, const Identifier &propertyName)
{
if (propertyName == lengthPropertyName)
return false;
- return ObjectImp::deleteProperty(exec, propertyName);
+ return JSObject::deleteProperty(exec, propertyName);
}
-// ------------------------------ StringPrototypeImp ---------------------------
-const ClassInfo StringPrototypeImp::info = {"String", &StringInstanceImp::info, &stringTable, 0};
+// ------------------------------ StringPrototype ---------------------------
+const ClassInfo StringPrototype::info = {"String", &StringInstance::info, &stringTable, 0};
/* Source for string_object.lut.h
@begin stringTable 26
- toString StringProtoFuncImp::ToString DontEnum|Function 0
- valueOf StringProtoFuncImp::ValueOf DontEnum|Function 0
- charAt StringProtoFuncImp::CharAt DontEnum|Function 1
- charCodeAt StringProtoFuncImp::CharCodeAt DontEnum|Function 1
- concat StringProtoFuncImp::Concat DontEnum|Function 1
- indexOf StringProtoFuncImp::IndexOf DontEnum|Function 1
- lastIndexOf StringProtoFuncImp::LastIndexOf DontEnum|Function 1
- match StringProtoFuncImp::Match DontEnum|Function 1
- replace StringProtoFuncImp::Replace DontEnum|Function 2
- search StringProtoFuncImp::Search DontEnum|Function 1
- slice StringProtoFuncImp::Slice DontEnum|Function 2
- split StringProtoFuncImp::Split DontEnum|Function 2
- substr StringProtoFuncImp::Substr DontEnum|Function 2
- substring StringProtoFuncImp::Substring DontEnum|Function 2
- toLowerCase StringProtoFuncImp::ToLowerCase DontEnum|Function 0
- toUpperCase StringProtoFuncImp::ToUpperCase DontEnum|Function 0
- toLocaleLowerCase StringProtoFuncImp::ToLocaleLowerCase DontEnum|Function 0
- toLocaleUpperCase StringProtoFuncImp::ToLocaleUpperCase DontEnum|Function 0
+ toString StringProtoFunc::ToString DontEnum|Function 0
+ valueOf StringProtoFunc::ValueOf DontEnum|Function 0
+ charAt StringProtoFunc::CharAt DontEnum|Function 1
+ charCodeAt StringProtoFunc::CharCodeAt DontEnum|Function 1
+ concat StringProtoFunc::Concat DontEnum|Function 1
+ indexOf StringProtoFunc::IndexOf DontEnum|Function 1
+ lastIndexOf StringProtoFunc::LastIndexOf DontEnum|Function 1
+ match StringProtoFunc::Match DontEnum|Function 1
+ replace StringProtoFunc::Replace DontEnum|Function 2
+ search StringProtoFunc::Search DontEnum|Function 1
+ slice StringProtoFunc::Slice DontEnum|Function 2
+ split StringProtoFunc::Split DontEnum|Function 2
+ substr StringProtoFunc::Substr DontEnum|Function 2
+ substring StringProtoFunc::Substring DontEnum|Function 2
+ toLowerCase StringProtoFunc::ToLowerCase DontEnum|Function 0
+ toUpperCase StringProtoFunc::ToUpperCase DontEnum|Function 0
+ toLocaleLowerCase StringProtoFunc::ToLocaleLowerCase DontEnum|Function 0
+ toLocaleUpperCase StringProtoFunc::ToLocaleUpperCase DontEnum|Function 0
#
# Under here: html extension, should only exist if KJS_PURE_ECMA is not defined
# I guess we need to generate two hashtables in the .lut.h file, and use #ifdef
# to select the right one... TODO. #####
- big StringProtoFuncImp::Big DontEnum|Function 0
- small StringProtoFuncImp::Small DontEnum|Function 0
- blink StringProtoFuncImp::Blink DontEnum|Function 0
- bold StringProtoFuncImp::Bold DontEnum|Function 0
- fixed StringProtoFuncImp::Fixed DontEnum|Function 0
- italics StringProtoFuncImp::Italics DontEnum|Function 0
- strike StringProtoFuncImp::Strike DontEnum|Function 0
- sub StringProtoFuncImp::Sub DontEnum|Function 0
- sup StringProtoFuncImp::Sup DontEnum|Function 0
- fontcolor StringProtoFuncImp::Fontcolor DontEnum|Function 1
- fontsize StringProtoFuncImp::Fontsize DontEnum|Function 1
- anchor StringProtoFuncImp::Anchor DontEnum|Function 1
- link StringProtoFuncImp::Link DontEnum|Function 1
+ big StringProtoFunc::Big DontEnum|Function 0
+ small StringProtoFunc::Small DontEnum|Function 0
+ blink StringProtoFunc::Blink DontEnum|Function 0
+ bold StringProtoFunc::Bold DontEnum|Function 0
+ fixed StringProtoFunc::Fixed DontEnum|Function 0
+ italics StringProtoFunc::Italics DontEnum|Function 0
+ strike StringProtoFunc::Strike DontEnum|Function 0
+ sub StringProtoFunc::Sub DontEnum|Function 0
+ sup StringProtoFunc::Sup DontEnum|Function 0
+ fontcolor StringProtoFunc::Fontcolor DontEnum|Function 1
+ fontsize StringProtoFunc::Fontsize DontEnum|Function 1
+ anchor StringProtoFunc::Anchor DontEnum|Function 1
+ link StringProtoFunc::Link DontEnum|Function 1
@end
*/
// ECMA 15.5.4
-StringPrototypeImp::StringPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objProto)
- : StringInstanceImp(objProto)
+StringPrototype::StringPrototype(ExecState *exec,
+ ObjectPrototype *objProto)
+ : StringInstance(objProto)
{
// The constructor will be added later, after StringObjectImp has been built
putDirect(lengthPropertyName, jsNumber(0), DontDelete|ReadOnly|DontEnum);
}
-bool StringPrototypeImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot)
+bool StringPrototype::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot)
{
- return getStaticFunctionSlot<StringProtoFuncImp, StringInstanceImp>(exec, &stringTable, this, propertyName, slot);
+ return getStaticFunctionSlot<StringProtoFunc, StringInstance>(exec, &stringTable, this, propertyName, slot);
}
-// ------------------------------ StringProtoFuncImp ---------------------------
+// ------------------------------ StringProtoFunc ---------------------------
-StringProtoFuncImp::StringProtoFuncImp(ExecState *exec, int i, int len)
+StringProtoFunc::StringProtoFunc(ExecState *exec, int i, int len)
: InternalFunctionImp(
- static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
+ static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
), id(i)
{
putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
}
-bool StringProtoFuncImp::implementsCall() const
+bool StringProtoFunc::implementsCall() const
{
return true;
}
static inline bool regExpIsGlobal(RegExpImp *regExp, ExecState *exec)
{
- ValueImp *globalProperty = regExp->get(exec,"global");
+ JSValue *globalProperty = regExp->get(exec,"global");
return !globalProperty->isUndefined() && globalProperty->toBoolean(exec);
}
@@ -258,9 +258,9 @@
return substitutedReplacement;
}
-static ValueImp *replace(ExecState *exec, const UString &source, ValueImp *pattern, ValueImp *replacement)
+static JSValue *replace(ExecState *exec, const UString &source, JSValue *pattern, JSValue *replacement)
{
- ObjectImp *replacementFunction = 0;
+ JSObject *replacementFunction = 0;
UString replacementString;
if (replacement->isObject() && replacement->toObject(exec)->implementsCall())
@@ -364,13 +364,13 @@
}
// ECMA 15.5.4.2 - 15.5.4.20
-ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *StringProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
- ValueImp *result = NULL;
+ JSValue *result = NULL;
// toString and valueOf are no generic function.
if (id == ToString || id == ValueOf) {
- if (!thisObj || !thisObj->inherits(&StringInstanceImp::info))
+ if (!thisObj || !thisObj->inherits(&StringInstance::info))
return throwError(exec, TypeError);
return jsString(thisObj->internalValue()->toString(exec));
@@ -384,8 +384,8 @@
UString s = thisObj->toString(exec);
int len = s.size();
- ValueImp *a0 = args[0];
- ValueImp *a1 = args[1];
+ JSValue *a0 = args[0];
+ JSValue *a1 = args[1];
switch (id) {
case ToString:
@@ -527,14 +527,14 @@
break;
}
case Split: {
- ObjectImp *constructor = exec->lexicalInterpreter()->builtinArray();
- ObjectImp *res = static_cast<ObjectImp *>(constructor->construct(exec,List::empty()));
+ JSObject *constructor = exec->lexicalInterpreter()->builtinArray();
+ JSObject *res = static_cast<JSObject *>(constructor->construct(exec,List::empty()));
result = res;
u = s;
i = p0 = 0;
uint32_t limit = a1->isUndefined() ? 0xFFFFFFFFU : a1->toUInt32(exec);
- if (a0->isObject() && static_cast<ObjectImp *>(a0)->inherits(&RegExpImp::info)) {
- ObjectImp *obj0 = static_cast<ObjectImp *>(a0);
+ if (a0->isObject() && static_cast<JSObject *>(a0)->inherits(&RegExpImp::info)) {
+ JSObject *obj0 = static_cast<JSObject *>(a0);
RegExp reg(obj0->get(exec,"source")->toString(exec));
if (u.isEmpty() && !reg.match(u, 0).isNull()) {
// empty string matched by regexp -> empty array
@@ -689,8 +689,8 @@
// ------------------------------ StringObjectImp ------------------------------
StringObjectImp::StringObjectImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
- StringPrototypeImp *stringProto)
+ FunctionPrototype *funcProto,
+ StringPrototype *stringProto)
: InternalFunctionImp(funcProto)
{
// ECMA 15.5.3.1 String.prototype
@@ -709,12 +709,12 @@
}
// ECMA 15.5.2
-ObjectImp *StringObjectImp::construct(ExecState *exec, const List &args)
+JSObject *StringObjectImp::construct(ExecState *exec, const List &args)
{
- ObjectImp *proto = exec->lexicalInterpreter()->builtinStringPrototype();
+ JSObject *proto = exec->lexicalInterpreter()->builtinStringPrototype();
if (args.size() == 0)
- return new StringInstanceImp(proto);
- return new StringInstanceImp(proto, args.begin()->toString(exec));
+ return new StringInstance(proto);
+ return new StringInstance(proto, args.begin()->toString(exec));
}
bool StringObjectImp::implementsCall() const
@@ -723,12 +723,12 @@
}
// ECMA 15.5.1
-ValueImp *StringObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *StringObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
if (args.isEmpty())
return jsString("");
else {
- ValueImp *v = args[0];
+ JSValue *v = args[0];
return jsString(v->toString(exec));
}
}
@@ -736,7 +736,7 @@
// ------------------------------ StringObjectFuncImp --------------------------
// ECMA 15.5.3.2 fromCharCode()
-StringObjectFuncImp::StringObjectFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto)
+StringObjectFuncImp::StringObjectFuncImp(ExecState *exec, FunctionPrototype *funcProto)
: InternalFunctionImp(funcProto)
{
putDirect(lengthPropertyName, jsNumber(1), DontDelete|ReadOnly|DontEnum);
@@ -747,7 +747,7 @@
return true;
}
-ValueImp *StringObjectFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *StringObjectFuncImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
UString s;
if (args.size()) {
1.15 +18 -18 JavaScriptCore/kjs/string_object.h
Index: string_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/string_object.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- string_object.h 8 Aug 2005 04:07:29 -0000 1.14
+++ string_object.h 11 Dec 2005 02:05:49 -0000 1.15
@@ -27,20 +27,20 @@
namespace KJS {
- class StringInstanceImp : public ObjectImp {
+ class StringInstance : public JSObject {
public:
- StringInstanceImp(ObjectImp *proto);
- StringInstanceImp(ObjectImp *proto, const UString &string);
+ StringInstance(JSObject *proto);
+ StringInstance(JSObject *proto, const UString &string);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
private:
- static ValueImp *lengthGetter(ExecState *exec, const Identifier&, const PropertySlot &slot);
- static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot &slot);
+ static JSValue *lengthGetter(ExecState *exec, const Identifier&, const PropertySlot &slot);
+ static JSValue *indexGetter(ExecState *exec, const Identifier&, const PropertySlot &slot);
};
/**
@@ -49,10 +49,10 @@
* The initial value of String.prototype (and thus all objects created
* with the String constructor
*/
- class StringPrototypeImp : public StringInstanceImp {
+ class StringPrototype : public StringInstance {
public:
- StringPrototypeImp(ExecState *exec,
- ObjectPrototypeImp *objProto);
+ StringPrototype(ExecState *exec,
+ ObjectPrototype *objProto);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
@@ -64,12 +64,12 @@
* Class to implement all methods that are properties of the
* String.prototype object
*/
- class StringProtoFuncImp : public InternalFunctionImp {
+ class StringProtoFunc : public InternalFunctionImp {
public:
- StringProtoFuncImp(ExecState *exec, int i, int len);
+ StringProtoFunc(ExecState *exec, int i, int len);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
enum { ToString, ValueOf, CharAt, CharCodeAt, Concat, IndexOf, LastIndexOf,
Match, Replace, Search, Slice, Split,
@@ -92,13 +92,13 @@
class StringObjectImp : public InternalFunctionImp {
public:
StringObjectImp(ExecState *exec,
- FunctionPrototypeImp *funcProto,
- StringPrototypeImp *stringProto);
+ FunctionPrototype *funcProto,
+ StringPrototype *stringProto);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
/**
@@ -109,9 +109,9 @@
*/
class StringObjectFuncImp : public InternalFunctionImp {
public:
- StringObjectFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto);
+ StringObjectFuncImp(ExecState *exec, FunctionPrototype *funcProto);
virtual bool implementsCall() const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
} // namespace
1.20 +12 -12 JavaScriptCore/kjs/testkjs.cpp
Index: testkjs.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/testkjs.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- testkjs.cpp 11 Dec 2005 00:37:52 -0000 1.19
+++ testkjs.cpp 11 Dec 2005 02:05:49 -0000 1.20
@@ -35,11 +35,11 @@
using namespace KJS;
-class TestFunctionImp : public ObjectImp {
+class TestFunctionImp : public JSObject {
public:
TestFunctionImp(int i, int length);
virtual bool implementsCall() const { return true; }
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
enum { Print, Debug, Quit, GC };
@@ -47,12 +47,12 @@
int id;
};
-TestFunctionImp::TestFunctionImp(int i, int length) : ObjectImp(), id(i)
+TestFunctionImp::TestFunctionImp(int i, int length) : JSObject(), id(i)
{
putDirect(lengthPropertyName,length,DontDelete|ReadOnly|DontEnum);
}
-ValueImp *TestFunctionImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *TestFunctionImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
switch (id) {
case Print:
@@ -75,21 +75,21 @@
return jsUndefined();
}
-class VersionFunctionImp : public ObjectImp {
+class VersionFunctionImp : public JSObject {
public:
- VersionFunctionImp() : ObjectImp() {}
+ VersionFunctionImp() : JSObject() {}
virtual bool implementsCall() const { return true; }
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
-ValueImp *VersionFunctionImp::callAsFunction(ExecState */*exec*/, ObjectImp */*thisObj*/, const List &/*args*/)
+JSValue *VersionFunctionImp::callAsFunction(ExecState */*exec*/, JSObject */*thisObj*/, const List &/*args*/)
{
// We need this function for compatibility with the Mozilla JS tests but for now
// we don't actually do any version-specific handling
return jsUndefined();
}
-class GlobalImp : public ObjectImp {
+class GlobalImp : public JSObject {
public:
virtual UString className() const { return "global"; }
};
@@ -106,7 +106,7 @@
{
JSLock lock;
- ObjectImp *global(new GlobalImp());
+ JSObject *global(new GlobalImp());
// create interpreter
Interpreter interp(global);
@@ -153,11 +153,11 @@
if (comp.complType() == Throw) {
ExecState *exec = interp.globalExec();
- ValueImp *exVal = comp.value();
+ JSValue *exVal = comp.value();
char *msg = exVal->toString(exec).ascii();
int lineno = -1;
if (exVal->isObject()) {
- ValueImp *lineVal = static_cast<ObjectImp *>(exVal)->get(exec,"line");
+ JSValue *lineVal = static_cast<JSObject *>(exVal)->get(exec,"line");
if (lineVal->isNumber())
lineno = int(lineVal->toNumber(exec));
}
1.33 +32 -32 JavaScriptCore/kjs/value.cpp
Index: value.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/value.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- value.cpp 16 Nov 2005 01:45:12 -0000 1.32
+++ value.cpp 11 Dec 2005 02:05:49 -0000 1.33
@@ -40,40 +40,40 @@
namespace KJS {
-AllocatedValueImp *ConstantValues::undefined = NULL;
-AllocatedValueImp *ConstantValues::null = NULL;
-AllocatedValueImp *ConstantValues::jsTrue = NULL;
-AllocatedValueImp *ConstantValues::jsFalse = NULL;
+JSCell *ConstantValues::undefined = NULL;
+JSCell *ConstantValues::null = NULL;
+JSCell *ConstantValues::jsTrue = NULL;
+JSCell *ConstantValues::jsFalse = NULL;
static const double D16 = 65536.0;
static const double D32 = 4294967296.0;
-void *AllocatedValueImp::operator new(size_t size)
+void *JSCell::operator new(size_t size)
{
return Collector::allocate(size);
}
-bool AllocatedValueImp::getUInt32(unsigned&) const
+bool JSCell::getUInt32(unsigned&) const
{
return false;
}
// ECMA 9.4
-double ValueImp::toInteger(ExecState *exec) const
+double JSValue::toInteger(ExecState *exec) const
{
uint32_t i;
if (getUInt32(i))
return i;
- return roundValue(exec, const_cast<ValueImp*>(this));
+ return roundValue(exec, const_cast<JSValue*>(this));
}
-int32_t ValueImp::toInt32(ExecState *exec) const
+int32_t JSValue::toInt32(ExecState *exec) const
{
uint32_t i;
if (getUInt32(i))
return i;
- double d = roundValue(exec, const_cast<ValueImp*>(this));
+ double d = roundValue(exec, const_cast<JSValue*>(this));
if (isNaN(d) || isInf(d))
return 0;
double d32 = fmod(d, D32);
@@ -86,13 +86,13 @@
return static_cast<int32_t>(d32);
}
-uint32_t ValueImp::toUInt32(ExecState *exec) const
+uint32_t JSValue::toUInt32(ExecState *exec) const
{
uint32_t i;
if (getUInt32(i))
return i;
- double d = roundValue(exec, const_cast<ValueImp*>(this));
+ double d = roundValue(exec, const_cast<JSValue*>(this));
if (isNaN(d) || isInf(d))
return 0;
double d32 = fmod(d, D32);
@@ -103,13 +103,13 @@
return static_cast<uint32_t>(d32);
}
-uint16_t ValueImp::toUInt16(ExecState *exec) const
+uint16_t JSValue::toUInt16(ExecState *exec) const
{
uint32_t i;
if (getUInt32(i))
return i;
- double d = roundValue(exec, const_cast<ValueImp*>(this));
+ double d = roundValue(exec, const_cast<JSValue*>(this));
if (isNaN(d) || isInf(d))
return 0;
double d16 = fmod(d, D16);
@@ -120,14 +120,14 @@
return static_cast<uint16_t>(d16);
}
-ObjectImp *ValueImp::toObject(ExecState *exec) const
+JSObject *JSValue::toObject(ExecState *exec) const
{
if (SimpleNumber::is(this))
return static_cast<const NumberImp *>(this)->NumberImp::toObject(exec);
return downcast()->toObject(exec);
}
-bool AllocatedValueImp::getBoolean(bool &booleanValue) const
+bool JSCell::getBoolean(bool &booleanValue) const
{
if (!isBoolean())
return false;
@@ -135,7 +135,7 @@
return true;
}
-bool AllocatedValueImp::getNumber(double &numericValue) const
+bool JSCell::getNumber(double &numericValue) const
{
if (!isNumber())
return false;
@@ -143,12 +143,12 @@
return true;
}
-double AllocatedValueImp::getNumber() const
+double JSCell::getNumber() const
{
return isNumber() ? static_cast<const NumberImp *>(this)->value() : NaN;
}
-bool AllocatedValueImp::getString(UString &stringValue) const
+bool JSCell::getString(UString &stringValue) const
{
if (!isString())
return false;
@@ -156,34 +156,34 @@
return true;
}
-UString AllocatedValueImp::getString() const
+UString JSCell::getString() const
{
return isString() ? static_cast<const StringImp *>(this)->value() : UString();
}
-ObjectImp *AllocatedValueImp::getObject()
+JSObject *JSCell::getObject()
{
- return isObject() ? static_cast<ObjectImp *>(this) : 0;
+ return isObject() ? static_cast<JSObject *>(this) : 0;
}
-const ObjectImp *AllocatedValueImp::getObject() const
+const JSObject *JSCell::getObject() const
{
- return isObject() ? static_cast<const ObjectImp *>(this) : 0;
+ return isObject() ? static_cast<const JSObject *>(this) : 0;
}
-AllocatedValueImp *jsString(const char *s)
+JSCell *jsString(const char *s)
{
return new StringImp(s ? s : "");
}
-AllocatedValueImp *jsString(const UString &s)
+JSCell *jsString(const UString &s)
{
return s.isNull() ? new StringImp("") : new StringImp(s);
}
-ValueImp *jsNumber(double d)
+JSValue *jsNumber(double d)
{
- ValueImp *v = SimpleNumber::make(d);
+ JSValue *v = SimpleNumber::make(d);
return v ? v : new NumberImp(d);
}
@@ -200,16 +200,16 @@
void ConstantValues::mark()
{
- if (AllocatedValueImp *v = undefined)
+ if (JSCell *v = undefined)
if (!v->marked())
v->mark();
- if (AllocatedValueImp *v = null)
+ if (JSCell *v = null)
if (!v->marked())
v->mark();
- if (AllocatedValueImp *v = jsTrue)
+ if (JSCell *v = jsTrue)
if (!v->marked())
v->mark();
- if (AllocatedValueImp *v = jsFalse)
+ if (JSCell *v = jsFalse)
if (!v->marked())
v->mark();
}
1.39 +77 -77 JavaScriptCore/kjs/value.h
Index: value.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/value.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- value.h 11 Dec 2005 00:37:52 -0000 1.38
+++ value.h 11 Dec 2005 02:05:49 -0000 1.39
@@ -42,7 +42,7 @@
class ClassInfo;
class ExecState;
-class ObjectImp;
+class JSObject;
/**
* Primitive types
@@ -58,20 +58,20 @@
};
/**
- * ValueImp is the base type for all primitives (Undefined, Null, Boolean,
+ * JSValue is the base type for all primitives (Undefined, Null, Boolean,
* String, Number) and objects in ECMAScript.
*
- * Note: you should never inherit from ValueImp as it is for primitive types
+ * Note: you should never inherit from JSValue as it is for primitive types
* only (all of which are provided internally by KJS). Instead, inherit from
- * ObjectImp.
+ * JSObject.
*/
-class ValueImp {
- friend class AllocatedValueImp; // so it can derive from this class
+class JSValue {
+ friend class JSCell; // so it can derive from this class
friend class ProtectedValues; // so it can call downcast()
private:
- ValueImp();
- virtual ~ValueImp();
+ JSValue();
+ virtual ~JSValue();
public:
// Querying the type.
@@ -91,18 +91,18 @@
double getNumber() const; // NaN if not a number
bool getString(UString&) const;
UString getString() const; // null string if not a string
- ObjectImp *getObject(); // NULL if not an object
- const ObjectImp *getObject() const; // NULL if not an object
+ JSObject *getObject(); // NULL if not an object
+ const JSObject *getObject() const; // NULL if not an object
// Extracting integer values.
bool getUInt32(uint32_t&) const;
// Basic conversions.
- ValueImp *toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const;
+ JSValue *toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const;
bool toBoolean(ExecState *exec) const;
double toNumber(ExecState *exec) const;
UString toString(ExecState *exec) const;
- ObjectImp *toObject(ExecState *exec) const;
+ JSObject *toObject(ExecState *exec) const;
// Integer conversions.
double toInteger(ExecState *exec) const;
@@ -116,25 +116,25 @@
private:
// Implementation details.
- AllocatedValueImp *downcast();
- const AllocatedValueImp *downcast() const;
+ JSCell *downcast();
+ const JSCell *downcast() const;
// Give a compile time error if we try to copy one of these.
- ValueImp(const ValueImp&);
- ValueImp& operator=(const ValueImp&);
+ JSValue(const JSValue&);
+ JSValue& operator=(const JSValue&);
};
-class AllocatedValueImp : public ValueImp {
+class JSCell : public JSValue {
friend class Collector;
friend class UndefinedImp;
friend class NullImp;
friend class BooleanImp;
friend class NumberImp;
friend class StringImp;
- friend class ObjectImp;
+ friend class JSObject;
private:
- AllocatedValueImp();
- virtual ~AllocatedValueImp();
+ JSCell();
+ virtual ~JSCell();
public:
// Querying the type.
virtual Type type() const = 0;
@@ -150,18 +150,18 @@
double getNumber() const; // NaN if not a number
bool getString(UString&) const;
UString getString() const; // null string if not a string
- ObjectImp *getObject(); // NULL if not an object
- const ObjectImp *getObject() const; // NULL if not an object
+ JSObject *getObject(); // NULL if not an object
+ const JSObject *getObject() const; // NULL if not an object
// Extracting integer values.
virtual bool getUInt32(uint32_t&) const;
// Basic conversions.
- virtual ValueImp *toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const = 0;
+ virtual JSValue *toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const = 0;
virtual bool toBoolean(ExecState *exec) const = 0;
virtual double toNumber(ExecState *exec) const = 0;
virtual UString toString(ExecState *exec) const = 0;
- virtual ObjectImp *toObject(ExecState *exec) const = 0;
+ virtual JSObject *toObject(ExecState *exec) const = 0;
// Garbage collection.
void *operator new(size_t);
@@ -172,156 +172,156 @@
bool m_marked;
};
-AllocatedValueImp *jsUndefined();
-AllocatedValueImp *jsNull();
+JSCell *jsUndefined();
+JSCell *jsNull();
-AllocatedValueImp *jsBoolean(bool);
+JSCell *jsBoolean(bool);
-ValueImp *jsNumber(double);
-ValueImp *jsNaN();
+JSValue *jsNumber(double);
+JSValue *jsNaN();
-AllocatedValueImp *jsString(const UString &); // returns empty string if passed null string
-AllocatedValueImp *jsString(const char * = ""); // returns empty string if passed 0
+JSCell *jsString(const UString &); // returns empty string if passed null string
+JSCell *jsString(const char * = ""); // returns empty string if passed 0
extern const double NaN;
extern const double Inf;
class ConstantValues {
public:
- static AllocatedValueImp *undefined;
- static AllocatedValueImp *null;
- static AllocatedValueImp *jsFalse;
- static AllocatedValueImp *jsTrue;
+ static JSCell *undefined;
+ static JSCell *null;
+ static JSCell *jsFalse;
+ static JSCell *jsTrue;
static void initIfNeeded();
static void mark();
};
-inline AllocatedValueImp *jsUndefined()
+inline JSCell *jsUndefined()
{
return ConstantValues::undefined;
}
-inline AllocatedValueImp *jsNull()
+inline JSCell *jsNull()
{
return ConstantValues::null;
}
-inline AllocatedValueImp *jsBoolean(bool b)
+inline JSCell *jsBoolean(bool b)
{
return b ? ConstantValues::jsTrue : ConstantValues::jsFalse;
}
-inline ValueImp *jsNaN()
+inline JSValue *jsNaN()
{
return SimpleNumber::make(NaN);
}
-inline ValueImp::ValueImp()
+inline JSValue::JSValue()
{
}
-inline ValueImp::~ValueImp()
+inline JSValue::~JSValue()
{
}
-inline AllocatedValueImp::AllocatedValueImp()
+inline JSCell::JSCell()
: m_marked(false)
{
}
-inline AllocatedValueImp::~AllocatedValueImp()
+inline JSCell::~JSCell()
{
}
-inline bool AllocatedValueImp::isBoolean() const
+inline bool JSCell::isBoolean() const
{
return type() == BooleanType;
}
-inline bool AllocatedValueImp::isNumber() const
+inline bool JSCell::isNumber() const
{
return type() == NumberType;
}
-inline bool AllocatedValueImp::isString() const
+inline bool JSCell::isString() const
{
return type() == StringType;
}
-inline bool AllocatedValueImp::isObject() const
+inline bool JSCell::isObject() const
{
return type() == ObjectType;
}
-inline bool AllocatedValueImp::marked() const
+inline bool JSCell::marked() const
{
return m_marked;
}
-inline void AllocatedValueImp::mark()
+inline void JSCell::mark()
{
m_marked = true;
}
-inline AllocatedValueImp *ValueImp::downcast()
+inline JSCell *JSValue::downcast()
{
assert(!SimpleNumber::is(this));
- return static_cast<AllocatedValueImp *>(this);
+ return static_cast<JSCell *>(this);
}
-inline const AllocatedValueImp *ValueImp::downcast() const
+inline const JSCell *JSValue::downcast() const
{
assert(!SimpleNumber::is(this));
- return static_cast<const AllocatedValueImp *>(this);
+ return static_cast<const JSCell *>(this);
}
-inline bool ValueImp::isUndefined() const
+inline bool JSValue::isUndefined() const
{
return this == jsUndefined();
}
-inline bool ValueImp::isNull() const
+inline bool JSValue::isNull() const
{
return this == jsNull();
}
-inline bool ValueImp::isUndefinedOrNull() const
+inline bool JSValue::isUndefinedOrNull() const
{
return this == jsUndefined() || this == jsNull();
}
-inline bool ValueImp::isBoolean() const
+inline bool JSValue::isBoolean() const
{
return !SimpleNumber::is(this) && downcast()->isBoolean();
}
-inline bool ValueImp::isNumber() const
+inline bool JSValue::isNumber() const
{
return SimpleNumber::is(this) || downcast()->isNumber();
}
-inline bool ValueImp::isString() const
+inline bool JSValue::isString() const
{
return !SimpleNumber::is(this) && downcast()->isString();
}
-inline bool ValueImp::isObject() const
+inline bool JSValue::isObject() const
{
return !SimpleNumber::is(this) && downcast()->isObject();
}
-inline bool ValueImp::isObject(const ClassInfo *c) const
+inline bool JSValue::isObject(const ClassInfo *c) const
{
return !SimpleNumber::is(this) && downcast()->isObject(c);
}
-inline bool ValueImp::getBoolean(bool& v) const
+inline bool JSValue::getBoolean(bool& v) const
{
return !SimpleNumber::is(this) && downcast()->getBoolean(v);
}
-inline bool ValueImp::getNumber(double& v) const
+inline bool JSValue::getNumber(double& v) const
{
if (SimpleNumber::is(this)) {
v = SimpleNumber::value(this);
@@ -330,32 +330,32 @@
return downcast()->getNumber(v);
}
-inline double ValueImp::getNumber() const
+inline double JSValue::getNumber() const
{
return SimpleNumber::is(this) ? SimpleNumber::value(this) : downcast()->getNumber();
}
-inline bool ValueImp::getString(UString& s) const
+inline bool JSValue::getString(UString& s) const
{
return !SimpleNumber::is(this) && downcast()->getString(s);
}
-inline UString ValueImp::getString() const
+inline UString JSValue::getString() const
{
return SimpleNumber::is(this) ? UString() : downcast()->getString();
}
-inline ObjectImp *ValueImp::getObject()
+inline JSObject *JSValue::getObject()
{
return SimpleNumber::is(this) ? 0 : downcast()->getObject();
}
-inline const ObjectImp *ValueImp::getObject() const
+inline const JSObject *JSValue::getObject() const
{
return SimpleNumber::is(this) ? 0 : downcast()->getObject();
}
-inline bool ValueImp::getUInt32(uint32_t& v) const
+inline bool JSValue::getUInt32(uint32_t& v) const
{
if (SimpleNumber::is(this)) {
double d = SimpleNumber::value(this);
@@ -367,28 +367,28 @@
return downcast()->getUInt32(v);
}
-inline void ValueImp::mark()
+inline void JSValue::mark()
{
if (!SimpleNumber::is(this))
downcast()->mark();
}
-inline bool ValueImp::marked() const
+inline bool JSValue::marked() const
{
return SimpleNumber::is(this) || downcast()->marked();
}
-inline Type ValueImp::type() const
+inline Type JSValue::type() const
{
return SimpleNumber::is(this) ? NumberType : downcast()->type();
}
-inline ValueImp *ValueImp::toPrimitive(ExecState *exec, Type preferredType) const
+inline JSValue *JSValue::toPrimitive(ExecState *exec, Type preferredType) const
{
- return SimpleNumber::is(this) ? const_cast<ValueImp *>(this) : downcast()->toPrimitive(exec, preferredType);
+ return SimpleNumber::is(this) ? const_cast<JSValue *>(this) : downcast()->toPrimitive(exec, preferredType);
}
-inline bool ValueImp::toBoolean(ExecState *exec) const
+inline bool JSValue::toBoolean(ExecState *exec) const
{
if (SimpleNumber::is(this)) {
double d = SimpleNumber::value(this);
@@ -398,12 +398,12 @@
return downcast()->toBoolean(exec);
}
-inline double ValueImp::toNumber(ExecState *exec) const
+inline double JSValue::toNumber(ExecState *exec) const
{
return SimpleNumber::is(this) ? SimpleNumber::value(this) : downcast()->toNumber(exec);
}
-inline UString ValueImp::toString(ExecState *exec) const
+inline UString JSValue::toString(ExecState *exec) const
{
if (SimpleNumber::is(this)) {
double d = SimpleNumber::value(this);
1.507 +8 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.506
retrieving revision 1.507
diff -u -r1.506 -r1.507
--- ChangeLog 11 Dec 2005 01:44:27 -0000 1.506
+++ ChangeLog 11 Dec 2005 02:05:59 -0000 1.507
@@ -1,3 +1,11 @@
+2005-12-10 Darin Adler <darin at apple.com>
+
+ Rubber stamped by Maciej.
+
+ - updated for KJS class renaming
+
+ * many files and functions
+
2005-12-10 Maciej Stachowiak <mjs at apple.com>
Reviewed by Darin and Eric.
1.4 +5 -5 WebCore/khtml/ecma/XSLTProcessor.cpp
Index: XSLTProcessor.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/XSLTProcessor.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSLTProcessor.cpp 1 Dec 2005 10:32:08 -0000 1.3
+++ XSLTProcessor.cpp 11 Dec 2005 02:06:04 -0000 1.4
@@ -68,7 +68,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *XSLTProcessorProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *XSLTProcessorProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::XSLTProcessor::info))
return throwError(exec, TypeError);
@@ -76,7 +76,7 @@
switch (id) {
case XSLTProcessor::ImportStylesheet:
{
- ValueImp *nodeVal = args[0];
+ JSValue *nodeVal = args[0];
if (nodeVal->isObject(&DOMNode::info)) {
DOMNode *node = static_cast<DOMNode *>(nodeVal);
processor.importStylesheet(node->impl());
@@ -87,8 +87,8 @@
}
case XSLTProcessor::TransformToFragment:
{
- ValueImp *nodeVal = args[0];
- ValueImp *docVal = args[1];
+ JSValue *nodeVal = args[0];
+ JSValue *docVal = args[1];
if (nodeVal->isObject(&DOMNode::info) && docVal->isObject(&DOMDocument::info)) {
DOMNode *node = static_cast<DOMNode *>(nodeVal);
DOMDocument *doc = static_cast<DOMDocument *>(docVal);
@@ -100,7 +100,7 @@
}
case XSLTProcessor::TransformToDocument:
{
- ValueImp *nodeVal = args[0];
+ JSValue *nodeVal = args[0];
if (nodeVal->isObject(&DOMNode::info)) {
DOMNode *node = static_cast<DOMNode *>(nodeVal);
RefPtr<DocumentImpl> resultDocument = processor.transformToDocument(node->impl());
1.4 +2 -2 WebCore/khtml/ecma/XSLTProcessor.h
Index: XSLTProcessor.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/XSLTProcessor.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSLTProcessor.h 1 Dec 2005 10:32:09 -0000 1.3
+++ XSLTProcessor.h 11 Dec 2005 02:06:04 -0000 1.4
@@ -57,11 +57,11 @@
RefPtr<DOM::XSLTProcessorImpl> m_impl;
};
-class XSLTProcessorConstructorImp : public ObjectImp {
+class XSLTProcessorConstructorImp : public JSObject {
public:
XSLTProcessorConstructorImp(ExecState *) { }
virtual bool implementsConstruct() const { return true; }
- virtual ObjectImp *construct(ExecState *exec, const List &args) { return new XSLTProcessor(exec); }
+ virtual JSObject *construct(ExecState *exec, const List &args) { return new XSLTProcessor(exec); }
};
};
1.10 +2 -2 WebCore/khtml/ecma/domparser.cpp
Index: domparser.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/domparser.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- domparser.cpp 11 Dec 2005 00:38:00 -0000 1.9
+++ domparser.cpp 11 Dec 2005 02:06:04 -0000 1.10
@@ -50,7 +50,7 @@
return true;
}
-ObjectImp *DOMParserConstructorImp::construct(ExecState *exec, const List &)
+JSObject *DOMParserConstructorImp::construct(ExecState *exec, const List &)
{
return new DOMParser(exec, doc.get());
}
@@ -69,7 +69,7 @@
}
-ValueImp *DOMParserProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMParserProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&DOMParser::info))
return throwError(exec, TypeError);
1.5 +2 -2 WebCore/khtml/ecma/domparser.h
Index: domparser.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/domparser.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- domparser.h 1 Dec 2005 10:32:09 -0000 1.4
+++ domparser.h 11 Dec 2005 02:06:04 -0000 1.5
@@ -27,11 +27,11 @@
namespace KJS {
- class DOMParserConstructorImp : public ObjectImp {
+ class DOMParserConstructorImp : public JSObject {
public:
DOMParserConstructorImp(ExecState *, DOM::DocumentImpl *d);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
private:
RefPtr<DOM::DocumentImpl> doc;
};
1.50 +8 -8 WebCore/khtml/ecma/kjs_binding.cpp
Index: kjs_binding.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_binding.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- kjs_binding.cpp 11 Dec 2005 00:38:00 -0000 1.49
+++ kjs_binding.cpp 11 Dec 2005 02:06:04 -0000 1.50
@@ -76,7 +76,7 @@
}
-ScriptInterpreter::ScriptInterpreter( ObjectImp *global, KHTMLPart* part )
+ScriptInterpreter::ScriptInterpreter( JSObject *global, KHTMLPart* part )
: Interpreter( global ), m_part( part ),
m_evt( 0L ), m_inlineCode(false), m_timerCallback(false)
{
@@ -216,7 +216,7 @@
}
-bool ScriptInterpreter::isGlobalObject(ValueImp *v)
+bool ScriptInterpreter::isGlobalObject(JSValue *v)
{
return v->isObject(&Window::info);
}
@@ -228,13 +228,13 @@
return KJS::Window::isSafeScript (this, target);
}
-Interpreter *ScriptInterpreter::interpreterForGlobalObject (const ValueImp *imp)
+Interpreter *ScriptInterpreter::interpreterForGlobalObject (const JSValue *imp)
{
const KJS::Window *win = static_cast<const KJS::Window *>(imp);
return win->interpreter();
}
-void *ScriptInterpreter::createLanguageInstanceForValue (ExecState *exec, int language, ObjectImp *value, const Bindings::RootObject *origin, const Bindings::RootObject *current)
+void *ScriptInterpreter::createLanguageInstanceForValue (ExecState *exec, int language, JSObject *value, const Bindings::RootObject *origin, const Bindings::RootObject *current)
{
void *result = 0;
@@ -309,14 +309,14 @@
return QString((QChar*) data(), size());
}
-ValueImp *jsStringOrNull(const DOMString &s)
+JSValue *jsStringOrNull(const DOMString &s)
{
if (s.isNull())
return jsNull();
return jsString(s);
}
-DOMString valueToStringWithNullCheck(ExecState *exec, ValueImp *val)
+DOMString valueToStringWithNullCheck(ExecState *exec, JSValue *val)
{
if (val->isNull())
return DOMString();
@@ -324,7 +324,7 @@
return val->toString(exec).domString();
}
-QVariant ValueToVariant(ExecState* exec, ValueImp *val) {
+QVariant ValueToVariant(ExecState* exec, JSValue *val) {
QVariant res;
switch (val->type()) {
case BooleanType:
@@ -364,7 +364,7 @@
char buffer[100]; // needs to fit 20 characters, plus an integer in ASCII, plus a null character
sprintf(buffer, "%s exception %d", type, code);
- ObjectImp *errorObject = throwError(exec, GeneralError, buffer);
+ JSObject *errorObject = throwError(exec, GeneralError, buffer);
errorObject->put(exec, "code", jsNumber(code));
}
1.37 +14 -14 WebCore/khtml/ecma/kjs_binding.h
Index: kjs_binding.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_binding.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- kjs_binding.h 11 Dec 2005 00:38:00 -0000 1.36
+++ kjs_binding.h 11 Dec 2005 02:06:04 -0000 1.37
@@ -41,9 +41,9 @@
/**
* Base class for all objects in this binding.
*/
- class DOMObject : public ObjectImp {
+ class DOMObject : public JSObject {
protected:
- DOMObject() : ObjectImp() {}
+ DOMObject() : JSObject() {}
public:
virtual UString toString(ExecState *exec) const;
};
@@ -51,13 +51,13 @@
/**
* Base class for all functions in this binding.
*/
- class DOMFunction : public ObjectImp {
+ class DOMFunction : public JSObject {
protected:
- DOMFunction() : ObjectImp() {}
+ DOMFunction() : JSObject() {}
public:
virtual bool implementsCall() const { return true; }
virtual bool toBoolean(ExecState *) const { return true; }
- virtual ValueImp *toPrimitive(ExecState *exec, Type) const { return jsString(toString(exec)); }
+ virtual JSValue *toPrimitive(ExecState *exec, Type) const { return jsString(toString(exec)); }
virtual UString toString(ExecState *) const { return UString("[function]"); }
};
@@ -71,7 +71,7 @@
class ScriptInterpreter : public Interpreter
{
public:
- ScriptInterpreter(ObjectImp *global, KHTMLPart* part);
+ ScriptInterpreter(JSObject *global, KHTMLPart* part);
virtual ~ScriptInterpreter();
static DOMObject* getDOMObject(void* objectHandle);
@@ -103,11 +103,11 @@
DOM::EventImpl *getCurrentEvent() const { return m_evt; }
- virtual bool isGlobalObject(ValueImp *v);
- virtual Interpreter *interpreterForGlobalObject (const ValueImp *imp);
+ virtual bool isGlobalObject(JSValue *v);
+ virtual Interpreter *interpreterForGlobalObject (const JSValue *imp);
virtual bool isSafeScript (const Interpreter *target);
- virtual void *createLanguageInstanceForValue (ExecState *exec, int language, ObjectImp *value, const Bindings::RootObject *origin, const Bindings::RootObject *current);
- void *createObjcInstanceForValue (ExecState *exec, ObjectImp *value, const Bindings::RootObject *origin, const Bindings::RootObject *current);
+ virtual void *createLanguageInstanceForValue (ExecState *exec, int language, JSObject *value, const Bindings::RootObject *origin, const Bindings::RootObject *current);
+ void *createObjcInstanceForValue (ExecState *exec, JSObject *value, const Bindings::RootObject *origin, const Bindings::RootObject *current);
private:
KHTMLPart* m_part;
@@ -121,7 +121,7 @@
* Retrieve from cache, or create, a KJS object around a DOM object
*/
template<class DOMObj, class KJSDOMObj>
- inline ValueImp *cacheDOMObject(ExecState *exec, DOMObj *domObj)
+ inline JSValue *cacheDOMObject(ExecState *exec, DOMObj *domObj)
{
if (!domObj)
return jsNull();
@@ -150,17 +150,17 @@
/**
* Get a String object, or jsNull() if s is null
*/
- ValueImp *jsStringOrNull(const DOM::DOMString&);
+ JSValue *jsStringOrNull(const DOM::DOMString&);
/**
* Get a DOMString object or a null DOMString if the value is null
*/
- DOM::DOMString valueToStringWithNullCheck(ExecState* exec, ValueImp *val);
+ DOM::DOMString valueToStringWithNullCheck(ExecState* exec, JSValue *val);
/**
* Convert a KJS value into a QVariant
*/
- QVariant ValueToVariant(ExecState* exec, ValueImp *val);
+ QVariant ValueToVariant(ExecState* exec, JSValue *val);
} // namespace
1.43 +51 -51 WebCore/khtml/ecma/kjs_css.cpp
Index: kjs_css.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_css.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- kjs_css.cpp 11 Dec 2005 00:38:00 -0000 1.42
+++ kjs_css.cpp 11 Dec 2005 02:06:04 -0000 1.43
@@ -138,13 +138,13 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMCSSStyleDeclaration::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMCSSStyleDeclaration::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMCSSStyleDeclaration *thisObj = static_cast<DOMCSSStyleDeclaration *>(slot.slotBase());
return jsStringOrNull(thisObj->m_impl->item(slot.index()));
}
-ValueImp *DOMCSSStyleDeclaration::cssPropertyGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMCSSStyleDeclaration::cssPropertyGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMCSSStyleDeclaration *thisObj = static_cast<DOMCSSStyleDeclaration *>(slot.slotBase());
@@ -189,7 +189,7 @@
return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
}
-ValueImp *DOMCSSStyleDeclaration::getValueProperty(ExecState *exec, int token)
+JSValue *DOMCSSStyleDeclaration::getValueProperty(ExecState *exec, int token)
{
switch (token) {
case CssText:
@@ -204,7 +204,7 @@
}
}
-void DOMCSSStyleDeclaration::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr )
+void DOMCSSStyleDeclaration::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr )
{
#ifdef KJS_VERBOSE
kdDebug(6070) << "DOMCSSStyleDeclaration::put " << propertyName.qstring() << endl;
@@ -241,7 +241,7 @@
}
}
-ValueImp *DOMCSSStyleDeclarationProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMCSSStyleDeclarationProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSStyleDeclaration::info))
return throwError(exec, TypeError);
@@ -273,7 +273,7 @@
}
}
-ValueImp *getDOMCSSStyleDeclaration(ExecState *exec, CSSStyleDeclarationImpl *s)
+JSValue *getDOMCSSStyleDeclaration(ExecState *exec, CSSStyleDeclarationImpl *s)
{
return cacheDOMObject<CSSStyleDeclarationImpl, DOMCSSStyleDeclaration>(exec, s);
}
@@ -303,7 +303,7 @@
return getStaticValueSlot<DOMStyleSheet, DOMObject>(exec, &DOMStyleSheetTable, this, propertyName, slot);
}
-ValueImp *DOMStyleSheet::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMStyleSheet::getValueProperty(ExecState *exec, int token) const
{
StyleSheetImpl &styleSheet = *m_impl;
switch (token) {
@@ -325,7 +325,7 @@
return NULL;
}
-void DOMStyleSheet::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void DOMStyleSheet::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
if (propertyName == "disabled") {
m_impl->setDisabled(value->toBoolean(exec));
@@ -334,7 +334,7 @@
DOMObject::put(exec, propertyName, value, attr);
}
-ValueImp *getDOMStyleSheet(ExecState *exec, StyleSheetImpl *ss)
+JSValue *getDOMStyleSheet(ExecState *exec, StyleSheetImpl *ss)
{
DOMObject *ret;
if (!ss)
@@ -369,7 +369,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMStyleSheetList::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMStyleSheetList::getValueProperty(ExecState *exec, int token) const
{
switch(token) {
case Length:
@@ -380,13 +380,13 @@
}
}
-ValueImp *DOMStyleSheetList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMStyleSheetList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMStyleSheetList *thisObj = static_cast<DOMStyleSheetList *>(slot.slotBase());
return getDOMStyleSheet(exec, thisObj->m_impl->item(slot.index()));
}
-ValueImp *DOMStyleSheetList::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMStyleSheetList::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMStyleSheetList *thisObj = static_cast<DOMStyleSheetList *>(slot.slotBase());
ElementImpl *element = thisObj->m_doc->getElementById(propertyName.domString());
@@ -432,7 +432,7 @@
return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
}
-ValueImp *getDOMStyleSheetList(ExecState *exec, StyleSheetListImpl *ssl, DocumentImpl *doc)
+JSValue *getDOMStyleSheetList(ExecState *exec, StyleSheetListImpl *ssl, DocumentImpl *doc)
{
// Can't use the cacheDOMObject macro because of the doc argument
DOMObject *ret;
@@ -448,7 +448,7 @@
}
}
-ValueImp *DOMStyleSheetListFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMStyleSheetListFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMStyleSheetList::info))
return throwError(exec, TypeError);
@@ -488,7 +488,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMMediaList::getValueProperty(ExecState *exec, int token)
+JSValue *DOMMediaList::getValueProperty(ExecState *exec, int token)
{
switch (token) {
case MediaText:
@@ -501,7 +501,7 @@
}
}
-ValueImp *DOMMediaList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMMediaList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMMediaList *thisObj = static_cast<DOMMediaList *>(slot.slotBase());
return jsStringOrNull(thisObj->m_impl->item(slot.index()));
@@ -525,7 +525,7 @@
return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
}
-void DOMMediaList::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void DOMMediaList::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
MediaListImpl &mediaList = *m_impl;
if (propertyName == "mediaText")
@@ -534,12 +534,12 @@
DOMObject::put(exec, propertyName, value, attr);
}
-ValueImp *getDOMMediaList(ExecState *exec, MediaListImpl *ml)
+JSValue *getDOMMediaList(ExecState *exec, MediaListImpl *ml)
{
return cacheDOMObject<MediaListImpl, DOMMediaList>(exec, ml);
}
-ValueImp *KJS::DOMMediaListProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *KJS::DOMMediaListProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMMediaList::info))
return throwError(exec, TypeError);
@@ -590,7 +590,7 @@
{
}
-ValueImp *DOMCSSStyleSheet::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMCSSStyleSheet::getValueProperty(ExecState *exec, int token) const
{
switch (token) {
case OwnerRule:
@@ -609,7 +609,7 @@
return getStaticValueSlot<DOMCSSStyleSheet, DOMStyleSheet>(exec, &DOMCSSStyleSheetTable, this, propertyName, slot);
}
-ValueImp *DOMCSSStyleSheetProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMCSSStyleSheetProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSStyleSheet::info))
return throwError(exec, TypeError);
@@ -647,7 +647,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMCSSRuleList::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMCSSRuleList::getValueProperty(ExecState *exec, int token) const
{
switch (token) {
case Length:
@@ -658,7 +658,7 @@
}
}
-ValueImp *DOMCSSRuleList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMCSSRuleList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMCSSRuleList *thisObj = static_cast<DOMCSSRuleList *>(slot.slotBase());
return getDOMCSSRule(exec, thisObj->m_impl->item(slot.index()));
@@ -688,7 +688,7 @@
return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
}
-ValueImp *DOMCSSRuleListFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMCSSRuleListFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSRuleList::info))
return throwError(exec, TypeError);
@@ -701,7 +701,7 @@
}
}
-ValueImp *getDOMCSSRuleList(ExecState *exec, CSSRuleListImpl *rl)
+JSValue *getDOMCSSRuleList(ExecState *exec, CSSRuleListImpl *rl)
{
return cacheDOMObject<CSSRuleListImpl, DOMCSSRuleList>(exec, rl);
}
@@ -790,7 +790,7 @@
return getStaticPropertySlot<DOMCSSRuleFunc, DOMCSSRule, DOMObject>(exec, &DOMCSSRuleTable, this, propertyName, slot);
}
-ValueImp *DOMCSSRule::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMCSSRule::getValueProperty(ExecState *exec, int token) const
{
CSSRuleImpl &cssRule = *m_impl;
switch (token) {
@@ -843,14 +843,14 @@
return jsUndefined();
}
-void DOMCSSRule::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void DOMCSSRule::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
const HashTable* table = classInfo()->propHashTable; // get the right hashtable
const HashEntry* entry = Lookup::findEntry(table, propertyName);
if (entry) {
if (entry->attr & Function) // function: put as override property
{
- ObjectImp::put(exec, propertyName, value, attr);
+ JSObject::put(exec, propertyName, value, attr);
return;
}
else if ((entry->attr & ReadOnly) == 0) // let lookupPut print the warning if not
@@ -862,7 +862,7 @@
lookupPut<DOMCSSRule, DOMObject>(exec, propertyName, value, attr, &DOMCSSRuleTable, this);
}
-void DOMCSSRule::putValueProperty(ExecState *exec, int token, ValueImp *value, int)
+void DOMCSSRule::putValueProperty(ExecState *exec, int token, JSValue *value, int)
{
switch (token) {
// for DOM::CSSRule::STYLE_RULE:
@@ -885,7 +885,7 @@
}
}
-ValueImp *DOMCSSRuleFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMCSSRuleFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSRule::info))
return throwError(exec, TypeError);
@@ -902,7 +902,7 @@
return jsUndefined();
}
-ValueImp *getDOMCSSRule(ExecState *exec, CSSRuleImpl *r)
+JSValue *getDOMCSSRule(ExecState *exec, CSSRuleImpl *r)
{
return cacheDOMObject<CSSRuleImpl, DOMCSSRule>(exec, r);
}
@@ -927,7 +927,7 @@
return getStaticValueSlot<CSSRuleConstructor, DOMObject>(exec, &CSSRuleConstructorTable, this, propertyName, slot);
}
-ValueImp *CSSRuleConstructor::getValueProperty(ExecState *, int token) const
+JSValue *CSSRuleConstructor::getValueProperty(ExecState *, int token) const
{
switch (token) {
case UNKNOWN_RULE:
@@ -948,7 +948,7 @@
return NULL;
}
-ValueImp *getCSSRuleConstructor(ExecState *exec)
+JSValue *getCSSRuleConstructor(ExecState *exec)
{
return cacheGlobalObject<CSSRuleConstructor>( exec, "[[cssRule.constructor]]" );
}
@@ -968,7 +968,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMCSSValue::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMCSSValue::getValueProperty(ExecState *exec, int token) const
{
CSSValueImpl &cssValue = *m_impl;
switch (token) {
@@ -987,7 +987,7 @@
return getStaticValueSlot<DOMCSSValue, DOMObject>(exec, &DOMCSSValueTable, this, propertyName, slot);
}
-void DOMCSSValue::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void DOMCSSValue::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
CSSValueImpl &cssValue = *m_impl;
if (propertyName == "cssText")
@@ -996,7 +996,7 @@
DOMObject::put(exec, propertyName, value, attr);
}
-ValueImp *getDOMCSSValue(ExecState *exec, CSSValueImpl *v)
+JSValue *getDOMCSSValue(ExecState *exec, CSSValueImpl *v)
{
DOMObject *ret;
if (!v)
@@ -1032,7 +1032,7 @@
return getStaticValueSlot<CSSValueConstructor, DOMObject>(exec, &CSSValueConstructorTable, this, propertyName, slot);
}
-ValueImp *CSSValueConstructor::getValueProperty(ExecState *, int token) const
+JSValue *CSSValueConstructor::getValueProperty(ExecState *, int token) const
{
switch (token) {
case CSS_INHERIT:
@@ -1047,7 +1047,7 @@
return NULL;
}
-ValueImp *getCSSValueConstructor(ExecState *exec)
+JSValue *getCSSValueConstructor(ExecState *exec)
{
return cacheGlobalObject<CSSValueConstructor>( exec, "[[cssValue.constructor]]" );
}
@@ -1079,7 +1079,7 @@
setPrototype(DOMCSSPrimitiveValueProto::self(exec));
}
-ValueImp *DOMCSSPrimitiveValue::getValueProperty(ExecState *exec, int token)
+JSValue *DOMCSSPrimitiveValue::getValueProperty(ExecState *exec, int token)
{
assert(token == PrimitiveType);
return jsNumber(static_cast<CSSPrimitiveValueImpl *>(impl())->primitiveType());
@@ -1090,7 +1090,7 @@
return getStaticValueSlot<DOMCSSPrimitiveValue, DOMCSSValue>(exec, &DOMCSSPrimitiveValueTable, this, propertyName, slot);
}
-ValueImp *DOMCSSPrimitiveValueProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMCSSPrimitiveValueProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSPrimitiveValue::info))
return throwError(exec, TypeError);
@@ -1158,13 +1158,13 @@
return getStaticValueSlot<CSSPrimitiveValueConstructor, CSSValueConstructor>(exec, &CSSPrimitiveValueConstructorTable, this, propertyName, slot);
}
-ValueImp *CSSPrimitiveValueConstructor::getValueProperty(ExecState *, int token) const
+JSValue *CSSPrimitiveValueConstructor::getValueProperty(ExecState *, int token) const
{
// We use the token as the value to return directly
return jsNumber(token);
}
-ValueImp *getCSSPrimitiveValueConstructor(ExecState *exec)
+JSValue *getCSSPrimitiveValueConstructor(ExecState *exec)
{
return cacheGlobalObject<CSSPrimitiveValueConstructor>( exec, "[[cssPrimitiveValue.constructor]]" );
}
@@ -1186,13 +1186,13 @@
{
}
-ValueImp *DOMCSSValueList::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMCSSValueList::getValueProperty(ExecState *exec, int token) const
{
assert(token == Length);
return jsNumber(static_cast<CSSValueListImpl *>(impl())->length());
}
-ValueImp *DOMCSSValueList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMCSSValueList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMCSSValueList *thisObj = static_cast<DOMCSSValueList *>(slot.slotBase());
return getDOMCSSValue(exec, static_cast<CSSValueListImpl *>(thisObj->impl())->item(slot.index()));
@@ -1219,7 +1219,7 @@
return DOMCSSValue::getOwnPropertySlot(exec, propertyName, slot);
}
-ValueImp *DOMCSSValueListFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMCSSValueListFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSValue::info))
return throwError(exec, TypeError);
@@ -1253,7 +1253,7 @@
return getStaticValueSlot<DOMRGBColor, DOMObject>(exec, &DOMRGBColorTable, this, propertyName, slot);
}
-ValueImp *DOMRGBColor::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMRGBColor::getValueProperty(ExecState *exec, int token) const
{
int color = m_color;
switch (token) {
@@ -1270,7 +1270,7 @@
}
}
-ValueImp *getDOMRGBColor(ExecState *, unsigned c)
+JSValue *getDOMRGBColor(ExecState *, unsigned c)
{
// ### implement equals for RGBColor since they're not refcounted objects
return new DOMRGBColor(c);
@@ -1297,7 +1297,7 @@
return getStaticValueSlot<DOMRect, DOMObject>(exec, &DOMRectTable, this, propertyName, slot);
}
-ValueImp *DOMRect::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMRect::getValueProperty(ExecState *exec, int token) const
{
RectImpl &rect = *m_rect;
switch (token) {
@@ -1314,7 +1314,7 @@
}
}
-ValueImp *getDOMRect(ExecState *exec, RectImpl *r)
+JSValue *getDOMRect(ExecState *exec, RectImpl *r)
{
return cacheDOMObject<RectImpl, DOMRect>(exec, r);
}
@@ -1340,7 +1340,7 @@
return getStaticValueSlot<DOMCounter, DOMObject>(exec, &DOMCounterTable, this, propertyName, slot);
}
-ValueImp *DOMCounter::getValueProperty(ExecState *, int token) const
+JSValue *DOMCounter::getValueProperty(ExecState *, int token) const
{
CounterImpl &counter = *m_counter;
switch (token) {
@@ -1355,7 +1355,7 @@
}
}
-ValueImp *getDOMCounter(ExecState *exec, CounterImpl *c)
+JSValue *getDOMCounter(ExecState *exec, CounterImpl *c)
{
return cacheDOMObject<CounterImpl, DOMCounter>(exec, c);
}
1.23 +42 -42 WebCore/khtml/ecma/kjs_css.h
Index: kjs_css.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_css.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- kjs_css.h 7 Dec 2005 01:12:37 -0000 1.22
+++ kjs_css.h 11 Dec 2005 02:06:05 -0000 1.23
@@ -50,8 +50,8 @@
DOMCSSStyleDeclaration(ExecState *exec, DOM::CSSStyleDeclarationImpl *s);
virtual ~DOMCSSStyleDeclaration();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- ValueImp *getValueProperty(ExecState *exec, int token);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ JSValue *getValueProperty(ExecState *exec, int token);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
@@ -60,21 +60,21 @@
GetPropertyPriority, GetPropertyShorthand, IsPropertyImplicit, SetProperty, Item };
DOM::CSSStyleDeclarationImpl *impl() const { return m_impl.get(); }
private:
- static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
- static ValueImp *cssPropertyGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *cssPropertyGetter(ExecState *, const Identifier&, const PropertySlot&);
RefPtr<DOM::CSSStyleDeclarationImpl> m_impl;
};
- ValueImp *getDOMCSSStyleDeclaration(ExecState *exec, DOM::CSSStyleDeclarationImpl *d);
+ JSValue *getDOMCSSStyleDeclaration(ExecState *exec, DOM::CSSStyleDeclarationImpl *d);
class DOMStyleSheet : public DOMObject {
public:
DOMStyleSheet(ExecState *, DOM::StyleSheetImpl *ss) : m_impl(ss) { }
virtual ~DOMStyleSheet();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -87,7 +87,7 @@
RefPtr<DOM::StyleSheetImpl> m_impl;
};
- ValueImp *getDOMStyleSheet(ExecState *exec, DOM::StyleSheetImpl *ss);
+ JSValue *getDOMStyleSheet(ExecState *exec, DOM::StyleSheetImpl *ss);
class DOMStyleSheetList : public DOMObject {
public:
@@ -95,7 +95,7 @@
: m_impl(ssl), m_doc(doc) { }
virtual ~DOMStyleSheetList();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
virtual bool toBoolean(ExecState* ) const { return true; }
@@ -103,23 +103,23 @@
DOM::StyleSheetListImpl *impl() const { return m_impl.get(); }
enum { Item, Length };
private:
- static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
- static ValueImp *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
RefPtr<DOM::StyleSheetListImpl> m_impl;
RefPtr<DOM::DocumentImpl> m_doc;
};
// The document is only used for get-stylesheet-by-name (make optional if necessary)
- ValueImp *getDOMStyleSheetList(ExecState *exec, DOM::StyleSheetListImpl *ss, DOM::DocumentImpl *doc);
+ JSValue *getDOMStyleSheetList(ExecState *exec, DOM::StyleSheetListImpl *ss, DOM::DocumentImpl *doc);
class DOMMediaList : public DOMObject {
public:
DOMMediaList(ExecState *, DOM::MediaListImpl *ml);
virtual ~DOMMediaList();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token);
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ JSValue *getValueProperty(ExecState *exec, int token);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
virtual bool toBoolean(ExecState* ) const { return true; }
static const ClassInfo info;
@@ -127,18 +127,18 @@
Item, DeleteMedium, AppendMedium };
DOM::MediaListImpl *impl() const { return m_impl.get(); }
private:
- static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
RefPtr<DOM::MediaListImpl> m_impl;
};
- ValueImp *getDOMMediaList(ExecState *exec, DOM::MediaListImpl *ml);
+ JSValue *getDOMMediaList(ExecState *exec, DOM::MediaListImpl *ml);
class DOMCSSStyleSheet : public DOMStyleSheet {
public:
DOMCSSStyleSheet(ExecState *exec, DOM::CSSStyleSheetImpl *ss);
virtual ~DOMCSSStyleSheet();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -150,28 +150,28 @@
DOMCSSRuleList(ExecState *, DOM::CSSRuleListImpl *rl) : m_impl(rl) { }
virtual ~DOMCSSRuleList();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Item, Length };
DOM::CSSRuleListImpl *impl() const { return m_impl.get(); }
private:
- static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
RefPtr<DOM::CSSRuleListImpl> m_impl;
};
- ValueImp *getDOMCSSRuleList(ExecState *exec, DOM::CSSRuleListImpl *rl);
+ JSValue *getDOMCSSRuleList(ExecState *exec, DOM::CSSRuleListImpl *rl);
class DOMCSSRule : public DOMObject {
public:
DOMCSSRule(ExecState *, DOM::CSSRuleImpl *r) : m_impl(r) { }
virtual ~DOMCSSRule();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int attr);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int attr);
virtual const ClassInfo* classInfo() const;
static const ClassInfo info;
static const ClassInfo style_info, media_info, fontface_info, page_info, import_info, charset_info;
@@ -184,29 +184,29 @@
RefPtr<DOM::CSSRuleImpl> m_impl;
};
- ValueImp *getDOMCSSRule(ExecState *exec, DOM::CSSRuleImpl *r);
+ JSValue *getDOMCSSRule(ExecState *exec, DOM::CSSRuleImpl *r);
// Constructor for CSSRule - currently only used for some global values
class CSSRuleConstructor : public DOMObject {
public:
CSSRuleConstructor(ExecState *) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { UNKNOWN_RULE, STYLE_RULE, CHARSET_RULE, IMPORT_RULE, MEDIA_RULE, FONT_FACE_RULE, PAGE_RULE };
};
- ValueImp *getCSSRuleConstructor(ExecState *exec);
+ JSValue *getCSSRuleConstructor(ExecState *exec);
class DOMCSSValue : public DOMObject {
public:
DOMCSSValue(ExecState *, DOM::CSSValueImpl *v) : m_impl(v) { }
virtual ~DOMCSSValue();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { CssText, CssValueType };
@@ -218,27 +218,27 @@
RefPtr<DOM::CSSValueImpl> m_impl;
};
- ValueImp *getDOMCSSValue(ExecState *exec, DOM::CSSValueImpl *v);
+ JSValue *getDOMCSSValue(ExecState *exec, DOM::CSSValueImpl *v);
// Constructor for CSSValue - currently only used for some global values
class CSSValueConstructor : public DOMObject {
public:
CSSValueConstructor(ExecState *) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { CSS_VALUE_LIST, CSS_PRIMITIVE_VALUE, CSS_CUSTOM, CSS_INHERIT };
};
- ValueImp *getCSSValueConstructor(ExecState *exec);
+ JSValue *getCSSValueConstructor(ExecState *exec);
class DOMCSSPrimitiveValue : public DOMCSSValue {
public:
DOMCSSPrimitiveValue(ExecState *exec, DOM::CSSPrimitiveValueImpl *v);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token);
+ JSValue *getValueProperty(ExecState *exec, int token);
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -251,25 +251,25 @@
public:
CSSPrimitiveValueConstructor(ExecState *exec) : CSSValueConstructor(exec) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
- ValueImp *getCSSPrimitiveValueConstructor(ExecState *exec);
+ JSValue *getCSSPrimitiveValueConstructor(ExecState *exec);
class DOMCSSValueList : public DOMCSSValue {
public:
DOMCSSValueList(ExecState *exec, DOM::CSSValueListImpl *l);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Length, Item };
private:
- static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
};
class DOMRGBColor : public DOMObject {
@@ -277,7 +277,7 @@
DOMRGBColor(unsigned color) : m_color(color) { }
~DOMRGBColor();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -286,14 +286,14 @@
unsigned m_color;
};
- ValueImp *getDOMRGBColor(ExecState *exec, unsigned color);
+ JSValue *getDOMRGBColor(ExecState *exec, unsigned color);
class DOMRect : public DOMObject {
public:
DOMRect(ExecState *, DOM::RectImpl *r) : m_rect(r) { }
~DOMRect();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -302,14 +302,14 @@
RefPtr<DOM::RectImpl> m_rect;
};
- ValueImp *getDOMRect(ExecState *exec, DOM::RectImpl *r);
+ JSValue *getDOMRect(ExecState *exec, DOM::RectImpl *r);
class DOMCounter : public DOMObject {
public:
DOMCounter(ExecState *, DOM::CounterImpl *c) : m_counter(c) { }
~DOMCounter();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -318,7 +318,7 @@
RefPtr<DOM::CounterImpl> m_counter;
};
- ValueImp *getDOMCounter(ExecState *exec, DOM::CounterImpl *c);
+ JSValue *getDOMCounter(ExecState *exec, DOM::CounterImpl *c);
} // namespace
1.118 +69 -69 WebCore/khtml/ecma/kjs_dom.cpp
Index: kjs_dom.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_dom.cpp,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -r1.117 -r1.118
--- kjs_dom.cpp 11 Dec 2005 00:38:01 -0000 1.117
+++ kjs_dom.cpp 11 Dec 2005 02:06:05 -0000 1.118
@@ -275,7 +275,7 @@
return getStaticValueSlot<DOMNode, DOMObject>(exec, &DOMNodeTable, this, propertyName, slot);
}
-ValueImp *DOMNode::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMNode::getValueProperty(ExecState *exec, int token) const
{
NodeImpl &node = *m_impl;
switch (token) {
@@ -407,25 +407,25 @@
switch (token) {
case OffsetLeft:
- return rend ? jsNumber(rend->offsetLeft()) : static_cast<ValueImp *>(jsUndefined());
+ return rend ? jsNumber(rend->offsetLeft()) : static_cast<JSValue *>(jsUndefined());
case OffsetTop:
- return rend ? jsNumber(rend->offsetTop()) : static_cast<ValueImp *>(jsUndefined());
+ return rend ? jsNumber(rend->offsetTop()) : static_cast<JSValue *>(jsUndefined());
case OffsetWidth:
- return rend ? jsNumber(rend->offsetWidth()) : static_cast<ValueImp *>(jsUndefined());
+ return rend ? jsNumber(rend->offsetWidth()) : static_cast<JSValue *>(jsUndefined());
case OffsetHeight:
- return rend ? jsNumber(rend->offsetHeight()) : static_cast<ValueImp *>(jsUndefined());
+ return rend ? jsNumber(rend->offsetHeight()) : static_cast<JSValue *>(jsUndefined());
case OffsetParent: {
RenderObject* par = rend ? rend->offsetParent() : 0;
return getDOMNode(exec, par ? par->element() : 0);
}
case ClientWidth:
- return rend ? jsNumber(rend->clientWidth()) : static_cast<ValueImp *>(jsUndefined());
+ return rend ? jsNumber(rend->clientWidth()) : static_cast<JSValue *>(jsUndefined());
case ClientHeight:
- return rend ? jsNumber(rend->clientHeight()) : static_cast<ValueImp *>(jsUndefined());
+ return rend ? jsNumber(rend->clientHeight()) : static_cast<JSValue *>(jsUndefined());
case ScrollWidth:
- return rend ? jsNumber(rend->scrollWidth()) : static_cast<ValueImp *>(jsUndefined());
+ return rend ? jsNumber(rend->scrollWidth()) : static_cast<JSValue *>(jsUndefined());
case ScrollHeight:
- return rend ? jsNumber(rend->scrollHeight()) : static_cast<ValueImp *>(jsUndefined());
+ return rend ? jsNumber(rend->scrollHeight()) : static_cast<JSValue *>(jsUndefined());
case ScrollLeft:
return jsNumber(rend && rend->layer() ? rend->layer()->scrollXOffset() : 0);
case ScrollTop:
@@ -439,7 +439,7 @@
return NULL;
}
-void DOMNode::put(ExecState *exec, const Identifier& propertyName, ValueImp *value, int attr)
+void DOMNode::put(ExecState *exec, const Identifier& propertyName, JSValue *value, int attr)
{
#ifdef KJS_VERBOSE
kdDebug(6070) << "DOMNode::put " << propertyName.qstring() << endl;
@@ -448,7 +448,7 @@
&DOMNodeTable, this );
}
-void DOMNode::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void DOMNode::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
DOMExceptionTranslator exception(exec);
NodeImpl &node = *m_impl;
@@ -605,7 +605,7 @@
}
}
-ValueImp *DOMNode::toPrimitive(ExecState *exec, Type /*preferred*/) const
+JSValue *DOMNode::toPrimitive(ExecState *exec, Type /*preferred*/) const
{
if (!m_impl)
return jsNull();
@@ -620,12 +620,12 @@
return "[object " + (m_impl->isElementNode() ? m_impl->nodeName() : className()) + "]";
}
-void DOMNode::setListener(ExecState *exec, const AtomicString &eventType, ValueImp *func) const
+void DOMNode::setListener(ExecState *exec, const AtomicString &eventType, JSValue *func) const
{
m_impl->setHTMLEventListener(eventType, Window::retrieveActive(exec)->getJSEventListener(func, true));
}
-ValueImp *DOMNode::getListener(const AtomicString &eventType) const
+JSValue *DOMNode::getListener(const AtomicString &eventType) const
{
DOM::EventListener *listener = m_impl->getHTMLEventListener(eventType);
JSEventListener *jsListener = static_cast<JSEventListener*>(listener);
@@ -639,7 +639,7 @@
{
}
-ValueImp *DOMNodeProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMNodeProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&DOMNode::info))
return throwError(exec, TypeError);
@@ -704,7 +704,7 @@
return jsUndefined();
}
-NodeImpl *toNode(ValueImp *val)
+NodeImpl *toNode(JSValue *val)
{
if (!val || !val->isObject(&DOMNode::info))
return 0;
@@ -729,7 +729,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMNodeList::toPrimitive(ExecState *exec, Type /*preferred*/) const
+JSValue *DOMNodeList::toPrimitive(ExecState *exec, Type /*preferred*/) const
{
if (!m_impl)
return jsNull();
@@ -737,19 +737,19 @@
return jsString(toString(exec));
}
-ValueImp *DOMNodeList::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMNodeList::getValueProperty(ExecState *exec, int token) const
{
assert(token == Length);
return jsNumber(m_impl->length());
}
-ValueImp *DOMNodeList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMNodeList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMNodeList *thisObj = static_cast<DOMNodeList *>(slot.slotBase());
return getDOMNode(exec, thisObj->m_impl->item(slot.index()));
}
-ValueImp *DOMNodeList::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMNodeList::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMNodeList *thisObj = static_cast<DOMNodeList *>(slot.slotBase());
return getDOMNode(exec, thisObj->m_impl->itemById(propertyName.domString()));
@@ -784,7 +784,7 @@
}
// Need to support both get and call, so that list[0] and list(0) work.
-ValueImp *DOMNodeList::callAsFunction(ExecState *exec, ObjectImp *, const List &args)
+JSValue *DOMNodeList::callAsFunction(ExecState *exec, JSObject *, const List &args)
{
// Do not use thisObj here. See HTMLCollection.
UString s = args[0]->toString(exec);
@@ -797,7 +797,7 @@
}
// Not a prototype class currently, but should probably be converted to one
-ValueImp *DOMNodeListFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMNodeListFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMNodeList::info))
return throwError(exec, TypeError);
@@ -832,7 +832,7 @@
return getStaticValueSlot<DOMAttr, DOMNode>(exec, &DOMAttrTable, this, propertyName, slot);
}
-ValueImp *DOMAttr::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMAttr::getValueProperty(ExecState *exec, int token) const
{
AttrImpl *attr = static_cast<AttrImpl *>(impl());
switch (token) {
@@ -848,7 +848,7 @@
return NULL; // not reached
}
-void DOMAttr::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void DOMAttr::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
#ifdef KJS_VERBOSE
kdDebug(6070) << "DOMAttr::put " << propertyName.qstring() << endl;
@@ -857,7 +857,7 @@
&DOMAttrTable, this );
}
-void DOMAttr::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void DOMAttr::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
DOMExceptionTranslator exception(exec);
switch (token) {
@@ -869,7 +869,7 @@
}
}
-AttrImpl *toAttr(ValueImp *val)
+AttrImpl *toAttr(JSValue *val)
{
if (!val || !val->isObject(&DOMAttr::info))
return 0;
@@ -954,7 +954,7 @@
return getStaticValueSlot<DOMDocument, DOMNode>(exec, &DOMDocumentTable, this, propertyName, slot);
}
-ValueImp *DOMDocument::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMDocument::getValueProperty(ExecState *exec, int token) const
{
DocumentImpl &doc = *static_cast<DocumentImpl *>(impl());
@@ -1000,7 +1000,7 @@
}
}
-void DOMDocument::put(ExecState *exec, const Identifier& propertyName, ValueImp *value, int attr)
+void DOMDocument::put(ExecState *exec, const Identifier& propertyName, JSValue *value, int attr)
{
#ifdef KJS_VERBOSE
kdDebug(6070) << "DOMDocument::put " << propertyName.qstring() << endl;
@@ -1008,7 +1008,7 @@
lookupPut<DOMDocument,DOMNode>(exec, propertyName, value, attr, &DOMDocumentTable, this );
}
-void DOMDocument::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void DOMDocument::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
DocumentImpl &doc = *static_cast<DocumentImpl *>(impl());
switch (token) {
@@ -1021,7 +1021,7 @@
}
}
-ValueImp *DOMDocumentProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMDocumentProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMNode::info))
return throwError(exec, TypeError);
@@ -1068,9 +1068,9 @@
return getDOMRange(exec,doc.createRange());
case DOMDocument::CreateNodeIterator: {
NodeFilterImpl *filter = 0;
- ValueImp *arg2 = args[2];
+ JSValue *arg2 = args[2];
if (arg2->isObject()) {
- ObjectImp *o(static_cast<ObjectImp *>(arg2));
+ JSObject *o(static_cast<JSObject *>(arg2));
filter = new NodeFilterImpl(new JSNodeFilterCondition(o));
}
return getDOMNodeIterator(exec,doc.createNodeIterator(toNode(args[0]), args[1]->toUInt32(exec),
@@ -1078,9 +1078,9 @@
}
case DOMDocument::CreateTreeWalker: {
NodeFilterImpl *filter = 0;
- ValueImp *arg2 = args[2];
+ JSValue *arg2 = args[2];
if (arg2->isObject()) {
- ObjectImp *o(static_cast<ObjectImp *>(arg2));
+ JSObject *o(static_cast<JSObject *>(arg2));
filter = new NodeFilterImpl(new JSNodeFilterCondition(o));
}
return getDOMTreeWalker(exec,doc.createTreeWalker(toNode(args[0]), args[1]->toUInt32(exec),
@@ -1176,7 +1176,7 @@
{
}
-ValueImp *DOMElement::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMElement::getValueProperty(ExecState *exec, int token) const
{
ElementImpl *element = static_cast<ElementImpl *>(impl());
switch (token) {
@@ -1190,7 +1190,7 @@
}
}
-ValueImp *DOMElement::attributeGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMElement::attributeGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMElement *thisObj = static_cast<DOMElement *>(slot.slotBase());
@@ -1213,8 +1213,8 @@
if (DOMNode::getOwnPropertySlot(exec, propertyName, slot))
return true;
- ValueImp *proto = prototype();
- if (proto->isObject() && static_cast<ObjectImp *>(proto)->hasProperty(exec, propertyName))
+ JSValue *proto = prototype();
+ if (proto->isObject() && static_cast<JSObject *>(proto)->hasProperty(exec, propertyName))
return false;
ElementImpl &element = *static_cast<ElementImpl *>(impl());
@@ -1230,7 +1230,7 @@
return false;
}
-ValueImp *DOMElementProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMElementProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMNode::info))
return throwError(exec, TypeError);
@@ -1306,7 +1306,7 @@
}
}
-ElementImpl *toElement(ValueImp *val)
+ElementImpl *toElement(JSValue *val)
{
if (!val || !val->isObject(&DOMElement::info))
return 0;
@@ -1342,7 +1342,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMDOMImplementationProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMDOMImplementationProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMDOMImplementation::info))
return throwError(exec, TypeError);
@@ -1392,7 +1392,7 @@
return getStaticValueSlot<DOMDocumentType, DOMNode>(exec, &DOMDocumentTypeTable, this, propertyName, slot);
}
-ValueImp *DOMDocumentType::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMDocumentType::getValueProperty(ExecState *exec, int token) const
{
DocumentTypeImpl &type = *static_cast<DocumentTypeImpl *>(impl());
switch (token) {
@@ -1414,7 +1414,7 @@
}
}
-DocumentTypeImpl *toDocumentType(ValueImp *val)
+DocumentTypeImpl *toDocumentType(JSValue *val)
{
if (!val || !val->isObject(&DOMDocumentType::info))
return 0;
@@ -1452,19 +1452,19 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMNamedNodeMap::lengthGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMNamedNodeMap::lengthGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMNamedNodeMap *thisObj = static_cast<DOMNamedNodeMap *>(slot.slotBase());
return jsNumber(thisObj->m_impl->length());
}
-ValueImp *DOMNamedNodeMap::indexGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMNamedNodeMap::indexGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMNamedNodeMap *thisObj = static_cast<DOMNamedNodeMap *>(slot.slotBase());
return getDOMNode(exec, thisObj->m_impl->item(slot.index()));
}
-ValueImp *DOMNamedNodeMap::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMNamedNodeMap::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMNamedNodeMap *thisObj = static_cast<DOMNamedNodeMap *>(slot.slotBase());
return getDOMNode(exec, thisObj->m_impl->getNamedItem(propertyName.domString()));
@@ -1477,8 +1477,8 @@
return true;
} else {
// Look in the prototype (for functions) before assuming it's an item's name
- ValueImp *proto = prototype();
- if (proto->isObject() && static_cast<ObjectImp *>(proto)->hasProperty(exec, propertyName))
+ JSValue *proto = prototype();
+ if (proto->isObject() && static_cast<JSObject *>(proto)->hasProperty(exec, propertyName))
return false;
// name or index ?
@@ -1498,7 +1498,7 @@
return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
}
-ValueImp *DOMNamedNodeMapProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMNamedNodeMapProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMNamedNodeMap::info))
return throwError(exec, TypeError);
@@ -1549,7 +1549,7 @@
return getStaticValueSlot<DOMProcessingInstruction, DOMNode>(exec, &DOMProcessingInstructionTable, this, propertyName, slot);
}
-ValueImp *DOMProcessingInstruction::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMProcessingInstruction::getValueProperty(ExecState *exec, int token) const
{
ProcessingInstructionImpl *pi = static_cast<ProcessingInstructionImpl *>(impl());
switch (token) {
@@ -1565,7 +1565,7 @@
}
}
-void DOMProcessingInstruction::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void DOMProcessingInstruction::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
ProcessingInstructionImpl *pi = static_cast<ProcessingInstructionImpl *>(impl());
DOMExceptionTranslator exception(exec);
@@ -1597,7 +1597,7 @@
return getStaticValueSlot<DOMNotation, DOMNode>(exec, &DOMNotationTable, this, propertyName, slot);
}
-ValueImp *DOMNotation::getValueProperty(ExecState *, int token) const
+JSValue *DOMNotation::getValueProperty(ExecState *, int token) const
{
switch (token) {
case PublicId:
@@ -1632,7 +1632,7 @@
return getStaticValueSlot<DOMEntity, DOMNode>(exec, &DOMEntityTable, this, propertyName, slot);
}
-ValueImp *DOMEntity::getValueProperty(ExecState *, int token) const
+JSValue *DOMEntity::getValueProperty(ExecState *, int token) const
{
switch (token) {
case PublicId:
@@ -1649,7 +1649,7 @@
// -------------------------------------------------------------------------
-ValueImp *getDOMDocumentNode(ExecState *exec, DocumentImpl *n)
+JSValue *getDOMDocumentNode(ExecState *exec, DocumentImpl *n)
{
DOMDocument *ret = 0;
ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
@@ -1685,7 +1685,7 @@
return win && win->isSafeScript(exec);
}
-ValueImp *getDOMNode(ExecState *exec, NodeImpl *n)
+JSValue *getDOMNode(ExecState *exec, NodeImpl *n)
{
DOMNode *ret = 0;
if (!n)
@@ -1739,12 +1739,12 @@
return ret;
}
-ValueImp *getDOMNamedNodeMap(ExecState *exec, NamedNodeMapImpl *m)
+JSValue *getDOMNamedNodeMap(ExecState *exec, NamedNodeMapImpl *m)
{
return cacheDOMObject<NamedNodeMapImpl, DOMNamedNodeMap>(exec, m);
}
-ValueImp *getRuntimeObject(ExecState *exec, NodeImpl *n)
+JSValue *getRuntimeObject(ExecState *exec, NodeImpl *n)
{
if (!n)
return 0;
@@ -1770,12 +1770,12 @@
return 0;
}
-ValueImp *getDOMNodeList(ExecState *exec, NodeListImpl *l)
+JSValue *getDOMNodeList(ExecState *exec, NodeListImpl *l)
{
return cacheDOMObject<NodeListImpl, DOMNodeList>(exec, l);
}
-ValueImp *getDOMDOMImplementation(ExecState *exec, DOMImplementationImpl *i)
+JSValue *getDOMDOMImplementation(ExecState *exec, DOMImplementationImpl *i)
{
return cacheDOMObject<DOMImplementationImpl, DOMDOMImplementation>(exec, i);
}
@@ -1804,13 +1804,13 @@
return getStaticValueSlot<NodeConstructor, DOMObject>(exec, &NodeConstructorTable, this, propertyName, slot);
}
-ValueImp *NodeConstructor::getValueProperty(ExecState *, int token) const
+JSValue *NodeConstructor::getValueProperty(ExecState *, int token) const
{
// We use the token as the value to return directly
return jsNumber(token);
}
-ObjectImp *getNodeConstructor(ExecState *exec)
+JSObject *getNodeConstructor(ExecState *exec)
{
return cacheGlobalObject<NodeConstructor>(exec, "[[node.constructor]]");
}
@@ -1844,13 +1844,13 @@
return getStaticValueSlot<DOMExceptionConstructor, DOMObject>(exec, &DOMExceptionConstructorTable, this, propertyName, slot);
}
-ValueImp *DOMExceptionConstructor::getValueProperty(ExecState *, int token) const
+JSValue *DOMExceptionConstructor::getValueProperty(ExecState *, int token) const
{
// We use the token as the value to return directly
return jsNumber(token);
}
-ObjectImp *getDOMExceptionConstructor(ExecState *exec)
+JSObject *getDOMExceptionConstructor(ExecState *exec)
{
return cacheGlobalObject<DOMExceptionConstructor>(exec, "[[DOMException.constructor]]");
}
@@ -1865,13 +1865,13 @@
{
}
-ValueImp *DOMNamedNodesCollection::lengthGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMNamedNodesCollection::lengthGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMNamedNodesCollection *thisObj = static_cast<DOMNamedNodesCollection *>(slot.slotBase());
return jsNumber(thisObj->m_nodes.count());
}
-ValueImp *DOMNamedNodesCollection::indexGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *DOMNamedNodesCollection::indexGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
DOMNamedNodesCollection *thisObj = static_cast<DOMNamedNodesCollection *>(slot.slotBase());
return getDOMNode(exec, thisObj->m_nodes[slot.index()].get());
@@ -1946,7 +1946,7 @@
return getStaticValueSlot<DOMCharacterData, DOMNode>(exec, &DOMCharacterDataTable, this, propertyName, slot);
}
-ValueImp *DOMCharacterData::getValueProperty(ExecState *, int token) const
+JSValue *DOMCharacterData::getValueProperty(ExecState *, int token) const
{
CharacterDataImpl &data = *static_cast<CharacterDataImpl *>(impl());
switch (token) {
@@ -1960,7 +1960,7 @@
}
}
-void DOMCharacterData::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void DOMCharacterData::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
DOMExceptionTranslator exception(exec);
if (propertyName == "data")
@@ -1969,7 +1969,7 @@
DOMNode::put(exec, propertyName,value,attr);
}
-ValueImp *DOMCharacterDataProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMCharacterDataProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCharacterData::info))
return throwError(exec, TypeError);
@@ -2029,7 +2029,7 @@
setPrototype(DOMTextProto::self(exec));
}
-ValueImp *DOMTextProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMTextProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMText::info))
return throwError(exec, TypeError);
1.62 +45 -45 WebCore/khtml/ecma/kjs_dom.h
Index: kjs_dom.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_dom.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- kjs_dom.h 1 Dec 2005 10:32:09 -0000 1.61
+++ kjs_dom.h 11 Dec 2005 02:06:05 -0000 1.62
@@ -50,18 +50,18 @@
virtual ~DOMNode();
virtual bool toBoolean(ExecState *) const;
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
virtual void mark();
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int attr);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int attr);
DOM::NodeImpl *impl() const { return m_impl.get(); }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
- virtual ValueImp *toPrimitive(ExecState *exec, Type preferred = UndefinedType) const;
+ virtual JSValue *toPrimitive(ExecState *exec, Type preferred = UndefinedType) const;
virtual UString toString(ExecState *exec) const;
- void setListener(ExecState *exec, const DOM::AtomicString &eventType, ValueImp *func) const;
- ValueImp *getListener(const DOM::AtomicString &eventType) const;
+ void setListener(ExecState *exec, const DOM::AtomicString &eventType, JSValue *func) const;
+ JSValue *getListener(const DOM::AtomicString &eventType) const;
virtual void pushEventHandlerScope(ExecState *exec, ScopeChain &scope) const;
enum { NodeName, NodeValue, NodeType, ParentNode, ParentElement,
@@ -86,15 +86,15 @@
RefPtr<DOM::NodeImpl> m_impl;
};
- DOM::NodeImpl *toNode(ValueImp *); // returns 0 if passed-in value is not a DOMNode object
+ DOM::NodeImpl *toNode(JSValue *); // returns 0 if passed-in value is not a DOMNode object
class DOMNodeList : public DOMObject {
public:
DOMNodeList(ExecState *, DOM::NodeListImpl *l) : m_impl(l) { }
~DOMNodeList();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List&args);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List&args);
virtual bool implementsCall() const { return true; }
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
@@ -103,11 +103,11 @@
enum { Length, Item };
DOM::NodeListImpl *impl() const { return m_impl.get(); }
- virtual ValueImp *toPrimitive(ExecState *exec, Type preferred = UndefinedType) const;
+ virtual JSValue *toPrimitive(ExecState *exec, Type preferred = UndefinedType) const;
private:
- static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *nameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *nameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
RefPtr<DOM::NodeListImpl> m_impl;
};
@@ -117,9 +117,9 @@
DOMDocument(ExecState *exec, DOM::DocumentImpl *d);
~DOMDocument();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int attr);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int attr);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { DocType, Implementation, DocumentElement,
@@ -145,21 +145,21 @@
public:
DOMAttr(ExecState *exec, DOM::AttrImpl *a);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int attr);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int attr);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Name, Specified, ValueProperty, OwnerElement };
};
- DOM::AttrImpl *toAttr(ValueImp *); // returns 0 if passed-in value is not a DOMAttr object
+ DOM::AttrImpl *toAttr(JSValue *); // returns 0 if passed-in value is not a DOMAttr object
class DOMElement : public DOMNode {
public:
DOMElement(ExecState *exec, DOM::ElementImpl *e);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -173,10 +173,10 @@
// Constructor for inherited classes; doesn't set up a prototype.
DOMElement(DOM::ElementImpl *e);
private:
- static ValueImp *attributeGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *attributeGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
};
- DOM::ElementImpl *toElement(ValueImp *); // returns 0 if passed-in value is not a DOMElement object
+ DOM::ElementImpl *toElement(JSValue *); // returns 0 if passed-in value is not a DOMElement object
class DOMDOMImplementation : public DOMObject {
public:
@@ -197,14 +197,14 @@
public:
DOMDocumentType(ExecState *exec, DOM::DocumentTypeImpl *dt);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Name, Entities, Notations, PublicId, SystemId, InternalSubset };
};
- DOM::DocumentTypeImpl *toDocumentType(ValueImp *); // returns 0 if passed-in value is not a DOMDocumentType object
+ DOM::DocumentTypeImpl *toDocumentType(JSValue *); // returns 0 if passed-in value is not a DOMDocumentType object
class DOMNamedNodeMap : public DOMObject {
public:
@@ -219,9 +219,9 @@
GetNamedItemNS, SetNamedItemNS, RemoveNamedItemNS };
DOM::NamedNodeMapImpl *impl() const { return m_impl.get(); }
private:
- static ValueImp *lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *nameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *nameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
RefPtr<DOM::NamedNodeMapImpl> m_impl;
};
@@ -230,8 +230,8 @@
public:
DOMProcessingInstruction(ExecState *exec, DOM::ProcessingInstructionImpl *pi);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Target, Data, Sheet };
@@ -241,7 +241,7 @@
public:
DOMNotation(ExecState *exec, DOM::NotationImpl *n);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -252,7 +252,7 @@
public:
DOMEntity(ExecState *exec, DOM::EntityImpl *e);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -264,7 +264,7 @@
public:
NodeConstructor(ExecState *) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -275,21 +275,21 @@
public:
DOMExceptionConstructor(ExecState *) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
- ValueImp *getDOMDocumentNode(ExecState *exec, DOM::DocumentImpl *n);
+ JSValue *getDOMDocumentNode(ExecState *exec, DOM::DocumentImpl *n);
bool checkNodeSecurity(ExecState *exec, DOM::NodeImpl *n);
- ValueImp *getRuntimeObject(ExecState *exec, DOM::NodeImpl *n);
- ValueImp *getDOMNode(ExecState *exec, DOM::NodeImpl *n);
- ValueImp *getDOMNamedNodeMap(ExecState *exec, DOM::NamedNodeMapImpl *m);
- ValueImp *getDOMNodeList(ExecState *exec, DOM::NodeListImpl *l);
- ValueImp *getDOMDOMImplementation(ExecState *exec, DOM::DOMImplementationImpl *i);
- ObjectImp *getNodeConstructor(ExecState *exec);
- ObjectImp *getDOMExceptionConstructor(ExecState *exec);
+ JSValue *getRuntimeObject(ExecState *exec, DOM::NodeImpl *n);
+ JSValue *getDOMNode(ExecState *exec, DOM::NodeImpl *n);
+ JSValue *getDOMNamedNodeMap(ExecState *exec, DOM::NamedNodeMapImpl *m);
+ JSValue *getDOMNodeList(ExecState *exec, DOM::NodeListImpl *l);
+ JSValue *getDOMDOMImplementation(ExecState *exec, DOM::DOMImplementationImpl *i);
+ JSObject *getNodeConstructor(ExecState *exec);
+ JSObject *getDOMExceptionConstructor(ExecState *exec);
// Internal class, used for the collection return by e.g. document.forms.myinput
// when multiple nodes have the same name.
@@ -298,8 +298,8 @@
DOMNamedNodesCollection(ExecState *exec, const QValueList< RefPtr<DOM::NodeImpl> >& nodes );
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
private:
- static ValueImp *lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
QValueList< RefPtr<DOM::NodeImpl> > m_nodes;
};
@@ -308,8 +308,8 @@
public:
DOMCharacterData(ExecState *exec, DOM::CharacterDataImpl *d);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ JSValue *getValueProperty(ExecState *, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
DOM::CharacterDataImpl *toData() const;
1.76 +58 -58 WebCore/khtml/ecma/kjs_events.cpp
Index: kjs_events.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_events.cpp,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- kjs_events.cpp 11 Dec 2005 00:38:01 -0000 1.75
+++ kjs_events.cpp 11 Dec 2005 02:06:05 -0000 1.76
@@ -76,8 +76,8 @@
EventImpl *evt = ele;
- ObjectImp *listener = listenerObj();
- ObjectImp *win = windowObj();
+ JSObject *listener = listenerObj();
+ JSObject *win = windowObj();
KHTMLPart *part = static_cast<Window*>(win)->part();
KJSProxy *proxy = 0;
@@ -92,12 +92,12 @@
ExecState *exec = interpreter->globalExec();
bool hasHandleEvent = false;
- ValueImp *handleEventFuncValue = 0;
- ObjectImp *handleEventFunc = 0;
+ JSValue *handleEventFuncValue = 0;
+ JSObject *handleEventFunc = 0;
handleEventFuncValue = listener->get(exec, "handleEvent");
if (handleEventFuncValue->isObject()) {
- handleEventFunc = static_cast<ObjectImp *>(handleEventFuncValue);
+ handleEventFunc = static_cast<JSObject *>(handleEventFuncValue);
if (handleEventFunc->implementsCall())
hasHandleEvent = true;
@@ -115,14 +115,14 @@
// ... and in the interpreter
interpreter->setCurrentEvent(evt);
- ObjectImp *thisObj;
+ JSObject *thisObj;
if (isWindowEvent) {
thisObj = win;
} else {
- thisObj = static_cast<ObjectImp *>(getDOMNode(exec, evt->currentTarget()));
+ thisObj = static_cast<JSObject *>(getDOMNode(exec, evt->currentTarget()));
}
- ValueImp *retval;
+ JSValue *retval;
if (hasHandleEvent)
retval = handleEventFunc->call(exec, listener, args);
else
@@ -172,7 +172,7 @@
// -------------------------------------------------------------------------
-JSUnprotectedEventListener::JSUnprotectedEventListener(ObjectImp *_listener, ObjectImp *_win, bool _html)
+JSUnprotectedEventListener::JSUnprotectedEventListener(JSObject *_listener, JSObject *_win, bool _html)
: JSAbstractEventListener(_html)
, listener(_listener)
, win(_win)
@@ -191,12 +191,12 @@
}
}
-ObjectImp *JSUnprotectedEventListener::listenerObj() const
+JSObject *JSUnprotectedEventListener::listenerObj() const
{
return listener;
}
-ObjectImp *JSUnprotectedEventListener::windowObj() const
+JSObject *JSUnprotectedEventListener::windowObj() const
{
return win;
}
@@ -209,14 +209,14 @@
void JSUnprotectedEventListener::mark()
{
- ObjectImp *listenerImp = listener;
+ JSObject *listenerImp = listener;
if (listenerImp && !listenerImp->marked())
listenerImp->mark();
}
// -------------------------------------------------------------------------
-JSEventListener::JSEventListener(ObjectImp *_listener, ObjectImp *_win, bool _html)
+JSEventListener::JSEventListener(JSObject *_listener, JSObject *_win, bool _html)
: JSAbstractEventListener(_html)
, listener(_listener)
, win(_win)
@@ -227,20 +227,20 @@
JSEventListener::~JSEventListener()
{
- if (ObjectImp *l = listener) {
- ObjectImp *w = win;
+ if (JSObject *l = listener) {
+ JSObject *w = win;
if (w) {
static_cast<Window *>(w)->jsEventListeners.remove(l);
}
}
}
-ObjectImp *JSEventListener::listenerObj() const
+JSObject *JSEventListener::listenerObj() const
{
return listener;
}
-ObjectImp *JSEventListener::windowObj() const
+JSObject *JSEventListener::windowObj() const
{
return win;
}
@@ -252,7 +252,7 @@
// -------------------------------------------------------------------------
-JSLazyEventListener::JSLazyEventListener(QString _code, ObjectImp *_win, NodeImpl *_originalNode, int lineno)
+JSLazyEventListener::JSLazyEventListener(QString _code, JSObject *_win, NodeImpl *_originalNode, int lineno)
: JSEventListener(NULL, _win, true),
code(_code),
parsed(false)
@@ -271,13 +271,13 @@
void JSLazyEventListener::handleEvent(EventListenerEvent evt, bool isWindowEvent)
{
parseCode();
- ObjectImp *listenerObj = listener;
+ JSObject *listenerObj = listener;
if (listenerObj)
JSEventListener::handleEvent(evt, isWindowEvent);
}
-ObjectImp *JSLazyEventListener::listenerObj() const
+JSObject *JSLazyEventListener::listenerObj() const
{
parseCode();
return listener;
@@ -286,7 +286,7 @@
void JSLazyEventListener::parseCode() const
{
if (!parsed) {
- ObjectImp *w = win;
+ JSObject *w = win;
KHTMLPart *part = static_cast<Window *>(w)->part();
KJSProxy *proxy = 0L;
if (part)
@@ -297,10 +297,10 @@
ExecState *exec = interpreter->globalExec();
JSLock lock;
- ObjectImp *constr = interpreter->builtinFunction();
+ JSObject *constr = interpreter->builtinFunction();
List args;
- static ProtectedPtr<ValueImp> eventString = jsString("event");
+ static ProtectedPtr<JSValue> eventString = jsString("event");
UString sourceURL(part->m_url.url());
args.append(eventString);
args.append(jsString(code));
@@ -316,10 +316,10 @@
// (and the document, and the form - see HTMLElement::eventHandlerScope)
ScopeChain scope = listener->scope();
- ObjectImp *thisObj;
+ JSObject *thisObj;
{ // scope
JSLock lock;
- thisObj = static_cast<ObjectImp *>(getDOMNode(exec, originalNode));
+ thisObj = static_cast<JSObject *>(getDOMNode(exec, originalNode));
}
if (thisObj) {
@@ -332,8 +332,8 @@
// no more need to keep the unparsed code around
code = QString();
- if (ObjectImp *l = listener) {
- ObjectImp *w = win;
+ if (JSObject *l = listener) {
+ JSObject *w = win;
static_cast<Window *>(w)->jsEventListeners.insert(l, const_cast<JSLazyEventListener *>(this));
}
@@ -341,11 +341,11 @@
}
}
-ValueImp *getNodeEventListener(NodeImpl *n, const AtomicString &eventType)
+JSValue *getNodeEventListener(NodeImpl *n, const AtomicString &eventType)
{
JSAbstractEventListener *listener = static_cast<JSAbstractEventListener *>(n->getHTMLEventListener(eventType));
if (listener)
- if (ValueImp *obj = listener->listenerObjImp())
+ if (JSValue *obj = listener->listenerObjImp())
return obj;
return jsNull();
}
@@ -383,13 +383,13 @@
return getStaticValueSlot<EventConstructor, DOMObject>(exec, &EventConstructorTable, this, propertyName, slot);
}
-ValueImp *EventConstructor::getValueProperty(ExecState *, int token) const
+JSValue *EventConstructor::getValueProperty(ExecState *, int token) const
{
// We use the token as the value to return directly
return jsNumber(token);
}
-ValueImp *getEventConstructor(ExecState *exec)
+JSValue *getEventConstructor(ExecState *exec)
{
return cacheGlobalObject<EventConstructor>(exec, "[[event.constructor]]");
}
@@ -436,7 +436,7 @@
// pass marks through to JS objects we hold during garbage collection
void DOMMouseEvent::mark()
{
- ObjectImp::mark();
+ JSObject::mark();
if (clipboard && !clipboard->marked())
clipboard->mark();
}
@@ -446,7 +446,7 @@
return getStaticValueSlot<DOMEvent, DOMObject>(exec, &DOMEventTable, this, propertyName, slot);
}
-ValueImp *DOMEvent::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMEvent::getValueProperty(ExecState *exec, int token) const
{
EventImpl &event = *m_impl;
switch (token) {
@@ -500,13 +500,13 @@
}
void DOMEvent::put(ExecState *exec, const Identifier &propertyName,
- ValueImp *value, int attr)
+ JSValue *value, int attr)
{
lookupPut<DOMEvent, DOMObject>(exec, propertyName, value, attr,
&DOMEventTable, this);
}
-void DOMEvent::putValueProperty(ExecState *exec, int token, ValueImp *value, int)
+void DOMEvent::putValueProperty(ExecState *exec, int token, JSValue *value, int)
{
EventImpl &event = *m_impl;
switch (token) {
@@ -521,7 +521,7 @@
}
}
-ValueImp *DOMEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp * thisObj, const List &args)
+JSValue *DOMEventProtoFunc::callAsFunction(ExecState *exec, JSObject * thisObj, const List &args)
{
if (!thisObj->inherits(&DOMEvent::info))
return throwError(exec, TypeError);
@@ -540,7 +540,7 @@
return jsUndefined();
}
-ValueImp *getDOMEvent(ExecState *exec, EventImpl *e)
+JSValue *getDOMEvent(ExecState *exec, EventImpl *e)
{
if (!e)
return jsNull();
@@ -569,7 +569,7 @@
return ret;
}
-EventImpl *toEvent(ValueImp *val)
+EventImpl *toEvent(JSValue *val)
{
if (!val || !val->isObject(&DOMEvent::info))
return 0;
@@ -590,13 +590,13 @@
return getStaticValueSlot<EventExceptionConstructor, DOMObject>(exec, &EventExceptionConstructorTable, this, propertyName, slot);
}
-ValueImp *EventExceptionConstructor::getValueProperty(ExecState *, int token) const
+JSValue *EventExceptionConstructor::getValueProperty(ExecState *, int token) const
{
// We use the token as the value to return directly
return jsNumber(token);
}
-ValueImp *getEventExceptionConstructor(ExecState *exec)
+JSValue *getEventExceptionConstructor(ExecState *exec)
{
return cacheGlobalObject<EventExceptionConstructor>(exec, "[[eventException.constructor]]");
}
@@ -639,7 +639,7 @@
return getStaticValueSlot<DOMUIEvent, DOMEvent>(exec, &DOMUIEventTable, this, propertyName, slot);
}
-ValueImp *DOMUIEvent::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMUIEvent::getValueProperty(ExecState *exec, int token) const
{
UIEventImpl &event = *static_cast<UIEventImpl *>(impl());
switch (token) {
@@ -667,7 +667,7 @@
}
}
-ValueImp *DOMUIEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMUIEventProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&DOMUIEvent::info))
return throwError(exec, TypeError);
@@ -753,7 +753,7 @@
return QPoint(x, y);
}
-ValueImp *DOMMouseEvent::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMMouseEvent::getValueProperty(ExecState *exec, int token) const
{
MouseEventImpl &event = *static_cast<MouseEventImpl *>(impl());
switch (token) {
@@ -796,7 +796,7 @@
}
}
-ValueImp *DOMMouseEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMMouseEventProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&DOMMouseEvent::info))
return throwError(exec, TypeError);
@@ -865,7 +865,7 @@
return getStaticValueSlot<DOMKeyboardEvent, DOMUIEvent>(exec, &DOMKeyboardEventTable, this, propertyName, slot);
}
-ValueImp *DOMKeyboardEvent::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMKeyboardEvent::getValueProperty(ExecState *exec, int token) const
{
KeyboardEventImpl &event = *static_cast<KeyboardEventImpl *>(impl());
switch (token) {
@@ -889,7 +889,7 @@
}
}
-ValueImp *DOMKeyboardEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMKeyboardEventProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&DOMKeyboardEvent::info))
return throwError(exec, TypeError);
@@ -927,13 +927,13 @@
return getStaticValueSlot<MutationEventConstructor, DOMObject>(exec, &MutationEventConstructorTable, this, propertyName, slot);
}
-ValueImp *MutationEventConstructor::getValueProperty(ExecState *, int token) const
+JSValue *MutationEventConstructor::getValueProperty(ExecState *, int token) const
{
// We use the token as the value to return directly
return jsNumber(token);
}
-ValueImp *getMutationEventConstructor(ExecState *exec)
+JSValue *getMutationEventConstructor(ExecState *exec)
{
return cacheGlobalObject<MutationEventConstructor>(exec, "[[mutationEvent.constructor]]");
}
@@ -972,7 +972,7 @@
return getStaticValueSlot<DOMMutationEvent, DOMEvent>(exec, &DOMMutationEventTable, this, propertyName, slot);
}
-ValueImp *DOMMutationEvent::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMMutationEvent::getValueProperty(ExecState *exec, int token) const
{
MutationEventImpl &event = *static_cast<MutationEventImpl *>(impl());
switch (token) {
@@ -992,7 +992,7 @@
}
}
-ValueImp *DOMMutationEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMMutationEventProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&DOMMutationEvent::info))
return throwError(exec, TypeError);
@@ -1048,7 +1048,7 @@
return getStaticValueSlot<DOMWheelEvent, DOMEvent>(exec, &DOMWheelEventTable, this, propertyName, slot);
}
-ValueImp *DOMWheelEvent::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMWheelEvent::getValueProperty(ExecState *exec, int token) const
{
DOM::WheelEventImpl *e = static_cast<DOM::WheelEventImpl *>(impl());
switch (token) {
@@ -1080,7 +1080,7 @@
return jsUndefined();
}
-ValueImp *DOMWheelEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMWheelEventProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&DOMWheelEvent::info))
return throwError(exec, TypeError);
@@ -1124,7 +1124,7 @@
clipboard->deref();
}
-static ValueImp *stringOrUndefined(const DOM::DOMString &str)
+static JSValue *stringOrUndefined(const DOM::DOMString &str)
{
if (str.isNull()) {
return jsUndefined();
@@ -1138,7 +1138,7 @@
return getStaticValueSlot<Clipboard, DOMObject>(exec, &ClipboardTable, this, propertyName, slot);
}
-ValueImp *Clipboard::getValueProperty(ExecState *exec, int token) const
+JSValue *Clipboard::getValueProperty(ExecState *exec, int token) const
{
switch (token) {
case DropEffect:
@@ -1166,12 +1166,12 @@
}
}
-void Clipboard::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void Clipboard::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
lookupPut<Clipboard,DOMObject>(exec, propertyName, value, attr, &ClipboardTable, this );
}
-void Clipboard::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void Clipboard::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
switch (token) {
case DropEffect:
@@ -1189,7 +1189,7 @@
}
}
-ValueImp *ClipboardProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *ClipboardProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&Clipboard::info))
return throwError(exec, TypeError);
@@ -1250,7 +1250,7 @@
}
// See if they passed us an Image object
- ObjectImp *o = static_cast<ObjectImp*>(args[0]);
+ JSObject *o = static_cast<JSObject*>(args[0]);
if (o->isObject() && o->inherits(&Image::info)) {
Image *JSImage = static_cast<Image*>(o);
cb->clipboard->setDragImage(JSImage->image()->pixmap(), QPoint(x,y));
1.36 +35 -35 WebCore/khtml/ecma/kjs_events.h
Index: kjs_events.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_events.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- kjs_events.h 1 Dec 2005 10:32:09 -0000 1.35
+++ kjs_events.h 11 Dec 2005 02:06:05 -0000 1.36
@@ -48,43 +48,43 @@
virtual ~JSAbstractEventListener();
virtual void handleEvent(DOM::EventListenerEvent evt, bool isWindowEvent);
virtual DOM::DOMString eventListenerType();
- virtual ObjectImp *listenerObj() const = 0;
- virtual ObjectImp *windowObj() const = 0;
- ObjectImp *listenerObjImp() const { return listenerObj(); }
+ virtual JSObject *listenerObj() const = 0;
+ virtual JSObject *windowObj() const = 0;
+ JSObject *listenerObjImp() const { return listenerObj(); }
protected:
bool html;
};
class JSUnprotectedEventListener : public JSAbstractEventListener {
public:
- JSUnprotectedEventListener(ObjectImp *_listener, ObjectImp *_win, bool _html = false);
+ JSUnprotectedEventListener(JSObject *_listener, JSObject *_win, bool _html = false);
virtual ~JSUnprotectedEventListener();
- virtual ObjectImp *listenerObj() const;
- virtual ObjectImp *windowObj() const;
+ virtual JSObject *listenerObj() const;
+ virtual JSObject *windowObj() const;
void clearWindowObj();
void mark();
protected:
- ObjectImp *listener;
- ObjectImp *win;
+ JSObject *listener;
+ JSObject *win;
};
class JSEventListener : public JSAbstractEventListener {
public:
- JSEventListener(ObjectImp *_listener, ObjectImp *_win, bool _html = false);
+ JSEventListener(JSObject *_listener, JSObject *_win, bool _html = false);
virtual ~JSEventListener();
- virtual ObjectImp *listenerObj() const;
- virtual ObjectImp *windowObj() const;
+ virtual JSObject *listenerObj() const;
+ virtual JSObject *windowObj() const;
void clearWindowObj();
protected:
- mutable ProtectedPtr<ObjectImp> listener;
- ProtectedPtr<ObjectImp> win;
+ mutable ProtectedPtr<JSObject> listener;
+ ProtectedPtr<JSObject> win;
};
class JSLazyEventListener : public JSEventListener {
public:
- JSLazyEventListener(QString _code, ObjectImp *_win, DOM::NodeImpl *node, int lineno = 0);
+ JSLazyEventListener(QString _code, JSObject *_win, DOM::NodeImpl *node, int lineno = 0);
virtual void handleEvent(DOM::EventListenerEvent evt, bool isWindowEvent);
- ObjectImp *listenerObj() const;
+ JSObject *listenerObj() const;
private:
void parseCode() const;
@@ -95,30 +95,30 @@
DOM::NodeImpl *originalNode;
};
- ValueImp *getNodeEventListener(DOM::NodeImpl *n, const DOM::AtomicString &eventType);
+ JSValue *getNodeEventListener(DOM::NodeImpl *n, const DOM::AtomicString &eventType);
// Constructor for Event - currently only used for some global vars
class EventConstructor : public DOMObject {
public:
EventConstructor(ExecState *) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
- ValueImp *getEventConstructor(ExecState *exec);
+ JSValue *getEventConstructor(ExecState *exec);
class DOMEvent : public DOMObject {
public:
DOMEvent(ExecState *exec, DOM::EventImpl *e);
~DOMEvent();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
virtual void put(ExecState *exec, const Identifier &propertyName,
- ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int);
+ JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Type, Target, CurrentTarget, EventPhase, Bubbles,
@@ -131,29 +131,29 @@
mutable Clipboard *clipboard;
};
- ValueImp *getDOMEvent(ExecState *exec, DOM::EventImpl *e);
+ JSValue *getDOMEvent(ExecState *exec, DOM::EventImpl *e);
- DOM::EventImpl *toEvent(ValueImp *); // returns 0 if value is not a DOMEvent object
+ DOM::EventImpl *toEvent(JSValue *); // returns 0 if value is not a DOMEvent object
// Constructor object EventException
class EventExceptionConstructor : public DOMObject {
public:
EventExceptionConstructor(ExecState *) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
- ValueImp *getEventExceptionConstructor(ExecState *exec);
+ JSValue *getEventExceptionConstructor(ExecState *exec);
class DOMUIEvent : public DOMEvent {
public:
DOMUIEvent(ExecState *exec, DOM::UIEventImpl *ue);
~DOMUIEvent();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -165,7 +165,7 @@
DOMMouseEvent(ExecState *exec, DOM::MouseEventImpl *me);
~DOMMouseEvent();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
virtual void mark();
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
@@ -181,7 +181,7 @@
DOMKeyboardEvent(ExecState *exec, DOM::KeyboardEventImpl *ke);
~DOMKeyboardEvent();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const;
static const ClassInfo info;
@@ -193,20 +193,20 @@
public:
MutationEventConstructor(ExecState *) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
- ValueImp *getMutationEventConstructor(ExecState *exec);
+ JSValue *getMutationEventConstructor(ExecState *exec);
class DOMMutationEvent : public DOMEvent {
public:
DOMMutationEvent(ExecState *exec, DOM::MutationEventImpl *me);
~DOMMutationEvent();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -218,7 +218,7 @@
public:
DOMWheelEvent(ExecState *, DOM::WheelEventImpl *);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -232,9 +232,9 @@
Clipboard(ExecState *exec, DOM::ClipboardImpl *ds);
~Clipboard();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
1.153 +196 -196 WebCore/khtml/ecma/kjs_html.cpp
Index: kjs_html.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.cpp,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -r1.152 -r1.153
--- kjs_html.cpp 11 Dec 2005 00:38:01 -0000 1.152
+++ kjs_html.cpp 11 Dec 2005 02:06:05 -0000 1.153
@@ -143,14 +143,14 @@
class HTMLElementFunction : public DOMFunction {
public:
HTMLElementFunction(ExecState *exec, int i, int len);
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List&args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List&args);
private:
int id;
};
IMPLEMENT_PROTOFUNC(HTMLDocFunction)
-ValueImp *KJS::HTMLDocFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *KJS::HTMLDocFunction::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&HTMLDocument::info))
return throwError(exec, TypeError);
@@ -167,7 +167,7 @@
if (part) {
Window *window = Window::retrieveWindow(part);
if (window) {
- ObjectImp *functionObject = window->get(exec, "open")->getObject();
+ JSObject *functionObject = window->get(exec, "open")->getObject();
if (!functionObject || !functionObject->implementsCall())
return throwError(exec, TypeError);
return functionObject->call(exec, window, args);
@@ -263,7 +263,7 @@
{
}
-ValueImp *HTMLDocument::namedItemGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLDocument::namedItemGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLDocument *thisObj = static_cast<HTMLDocument *>(slot.slotBase());
HTMLDocumentImpl &doc = *static_cast<HTMLDocumentImpl *>(thisObj->impl());
@@ -284,7 +284,7 @@
return getHTMLCollection(exec, collection.get());
}
-ValueImp *HTMLDocument::getValueProperty(ExecState *exec, int token) const
+JSValue *HTMLDocument::getValueProperty(ExecState *exec, int token) const
{
HTMLDocumentImpl &doc = *static_cast<HTMLDocumentImpl *>(impl());
@@ -327,7 +327,7 @@
{
// To be implemented. Meanwhile, return an object with a length property set to 0
kdWarning() << "KJS::HTMLDocument document.scripts called - not implemented" << endl;
- ObjectImp *obj = new ObjectImp;
+ JSObject *obj = new JSObject;
obj->put(exec, lengthPropertyName, jsNumber(0));
return obj;
}
@@ -396,7 +396,7 @@
return DOMDocument::getOwnPropertySlot(exec, propertyName, slot);
}
-void KJS::HTMLDocument::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void KJS::HTMLDocument::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
#ifdef KJS_VERBOSE
kdDebug(6070) << "KJS::HTMLDocument::put " << propertyName.qstring() << endl;
@@ -404,7 +404,7 @@
lookupPut<HTMLDocument, DOMDocument>( exec, propertyName, value, attr, &HTMLDocumentTable, this );
}
-void KJS::HTMLDocument::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void KJS::HTMLDocument::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
DOMExceptionTranslator exception(exec);
HTMLDocumentImpl &doc = *static_cast<HTMLDocumentImpl *>(impl());
@@ -1259,7 +1259,7 @@
{
}
-ValueImp *HTMLElement::formIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLElement::formIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLElement *thisObj = static_cast<HTMLElement *>(slot.slotBase());
HTMLFormElementImpl *form = static_cast<HTMLFormElementImpl *>(thisObj->impl());
@@ -1267,7 +1267,7 @@
return getDOMNode(exec, form->elements()->item(slot.index()));
}
-ValueImp *HTMLElement::formNameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLElement::formNameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLElement *thisObj = static_cast<HTMLElement *>(slot.slotBase());
HTMLFormElementImpl *form = static_cast<HTMLFormElementImpl *>(thisObj->impl());
@@ -1275,7 +1275,7 @@
return HTMLCollection(exec, form->elements().get()).getNamedItems(exec, propertyName);
}
-ValueImp *HTMLElement::selectIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLElement::selectIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLElement *thisObj = static_cast<HTMLElement *>(slot.slotBase());
HTMLSelectElementImpl *select = static_cast<HTMLSelectElementImpl *>(thisObj->impl());
@@ -1283,7 +1283,7 @@
return getDOMNode(exec, select->optionsHTMLCollection()->item(slot.index()));
}
-ValueImp *HTMLElement::framesetNameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLElement::framesetNameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLElement *thisObj = static_cast<HTMLElement *>(slot.slotBase());
HTMLElementImpl *element = static_cast<HTMLElementImpl *>(thisObj->impl());
@@ -1296,7 +1296,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::frameWindowPropertyGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLElement::frameWindowPropertyGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLElement *thisObj = static_cast<HTMLElement *>(slot.slotBase());
@@ -1307,7 +1307,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::runtimeObjectGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLElement::runtimeObjectGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLElement *thisObj = static_cast<HTMLElement *>(slot.slotBase());
HTMLElementImpl *element = static_cast<HTMLElementImpl *>(thisObj->impl());
@@ -1315,13 +1315,13 @@
return getRuntimeObject(exec, element);
}
-ValueImp *HTMLElement::runtimeObjectPropertyGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLElement::runtimeObjectPropertyGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLElement *thisObj = static_cast<HTMLElement *>(slot.slotBase());
HTMLElementImpl *element = static_cast<HTMLElementImpl *>(thisObj->impl());
- if (ValueImp *runtimeObject = getRuntimeObject(exec, element))
- return static_cast<ObjectImp *>(runtimeObject)->get(exec, propertyName);
+ if (JSValue *runtimeObject = getRuntimeObject(exec, element))
+ return static_cast<JSObject *>(runtimeObject)->get(exec, propertyName);
return jsUndefined();
}
@@ -1341,7 +1341,7 @@
}
// FIXME: need faster way to check for a named item and/or a way to pass on the named items subcollection
- ValueImp *namedItems = HTMLCollection(exec, form.elements().get()).getNamedItems(exec, propertyName);
+ JSValue *namedItems = HTMLCollection(exec, form.elements().get()).getNamedItems(exec, propertyName);
if (!namedItems->isUndefined()) {
slot.setCustom(this, formNameGetter);
return true;
@@ -1374,9 +1374,9 @@
slot.setCustom(this, runtimeObjectGetter);
return true;
}
- ValueImp *runtimeObject = getRuntimeObject(exec,&element);
+ JSValue *runtimeObject = getRuntimeObject(exec,&element);
if (runtimeObject) {
- ObjectImp *imp = static_cast<ObjectImp *>(runtimeObject);
+ JSObject *imp = static_cast<JSObject *>(runtimeObject);
if (imp->hasProperty(exec, propertyName)) {
slot.setCustom(this, runtimeObjectPropertyGetter);
return true;
@@ -1422,23 +1422,23 @@
DocumentImpl* doc = element->getDocument();
KJSProxy *proxy = KJSProxy::proxy(doc->part());
ExecState *exec = proxy->interpreter()->globalExec();
- if (ValueImp *runtimeObject = getRuntimeObject(exec, element))
- return static_cast<ObjectImp *>(runtimeObject)->implementsCall();
+ if (JSValue *runtimeObject = getRuntimeObject(exec, element))
+ return static_cast<JSObject *>(runtimeObject)->implementsCall();
}
return false;
}
-ValueImp *KJS::HTMLElement::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List&args)
+JSValue *KJS::HTMLElement::callAsFunction(ExecState *exec, JSObject *thisObj, const List&args)
{
HTMLElementImpl *element = static_cast<HTMLElementImpl *>(impl());
if (element->hasTagName(embedTag) || element->hasTagName(objectTag) || element->hasTagName(appletTag)) {
- if (ValueImp *runtimeObject = getRuntimeObject(exec, element))
- return static_cast<ObjectImp *>(runtimeObject)->call(exec, thisObj, args);
+ if (JSValue *runtimeObject = getRuntimeObject(exec, element))
+ return static_cast<JSObject *>(runtimeObject)->call(exec, thisObj, args);
}
return jsUndefined();
}
-ValueImp *HTMLElement::htmlGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::htmlGetter(ExecState* exec, int token) const
{
HTMLHtmlElementImpl& html = *static_cast<HTMLHtmlElementImpl*>(impl());
if (token == HtmlVersion)
@@ -1446,7 +1446,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::headGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::headGetter(ExecState* exec, int token) const
{
HTMLHeadElementImpl &head = *static_cast<HTMLHeadElementImpl*>(impl());
if (token == HeadProfile)
@@ -1454,7 +1454,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::linkGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::linkGetter(ExecState* exec, int token) const
{
HTMLLinkElementImpl &link = *static_cast<HTMLLinkElementImpl*>(impl());
switch (token) {
@@ -1482,7 +1482,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::titleGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::titleGetter(ExecState* exec, int token) const
{
HTMLTitleElementImpl& title = *static_cast<HTMLTitleElementImpl*>(impl());
if (token == TitleText)
@@ -1490,7 +1490,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::metaGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::metaGetter(ExecState* exec, int token) const
{
HTMLMetaElementImpl& meta = *static_cast<HTMLMetaElementImpl*>(impl());
switch (token) {
@@ -1502,7 +1502,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::baseGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::baseGetter(ExecState* exec, int token) const
{
HTMLBaseElementImpl& base = *static_cast<HTMLBaseElementImpl*>(impl());
switch (token) {
@@ -1512,7 +1512,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::isIndexGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::isIndexGetter(ExecState* exec, int token) const
{
HTMLIsIndexElementImpl& isindex = *static_cast<HTMLIsIndexElementImpl*>(impl());
switch (token) {
@@ -1522,7 +1522,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::styleGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::styleGetter(ExecState* exec, int token) const
{
HTMLStyleElementImpl& style = *static_cast<HTMLStyleElementImpl*>(impl());
switch (token) {
@@ -1534,7 +1534,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::bodyGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::bodyGetter(ExecState* exec, int token) const
{
HTMLBodyElementImpl& body = *static_cast<HTMLBodyElementImpl*>(impl());
switch (token) {
@@ -1565,7 +1565,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::formGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::formGetter(ExecState* exec, int token) const
{
HTMLFormElementImpl& form = *static_cast<HTMLFormElementImpl*>(impl());
switch (token) {
@@ -1581,7 +1581,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::selectGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::selectGetter(ExecState* exec, int token) const
{
HTMLSelectElementImpl& select = *static_cast<HTMLSelectElementImpl*>(impl());
switch (token) {
@@ -1600,7 +1600,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::optGroupGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::optGroupGetter(ExecState* exec, int token) const
{
HTMLOptGroupElementImpl& optgroup = *static_cast<HTMLOptGroupElementImpl*>(impl());
switch (token) {
@@ -1610,7 +1610,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::optionGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::optionGetter(ExecState* exec, int token) const
{
HTMLOptionElementImpl& option = *static_cast<HTMLOptionElementImpl*>(impl());
switch (token) {
@@ -1626,21 +1626,21 @@
return jsUndefined();
}
-static ValueImp *getInputSelectionStart(HTMLInputElementImpl &input)
+static JSValue *getInputSelectionStart(HTMLInputElementImpl &input)
{
if (input.canHaveSelection())
return jsNumber(input.selectionStart());
return jsUndefined();
}
-static ValueImp *getInputSelectionEnd(HTMLInputElementImpl &input)
+static JSValue *getInputSelectionEnd(HTMLInputElementImpl &input)
{
if (input.canHaveSelection())
return jsNumber(input.selectionEnd());
return jsUndefined();
}
-ValueImp *HTMLElement::inputGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::inputGetter(ExecState* exec, int token) const
{
HTMLInputElementImpl& input = *static_cast<HTMLInputElementImpl*>(impl());
switch (token) {
@@ -1669,7 +1669,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::textAreaGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::textAreaGetter(ExecState* exec, int token) const
{
HTMLTextAreaElementImpl& textarea = *static_cast<HTMLTextAreaElementImpl*>(impl());
switch (token) {
@@ -1697,7 +1697,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::buttonGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::buttonGetter(ExecState* exec, int token) const
{
HTMLButtonElementImpl& button = *static_cast<HTMLButtonElementImpl*>(impl());
switch (token) {
@@ -1712,7 +1712,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::labelGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::labelGetter(ExecState* exec, int token) const
{
HTMLLabelElementImpl& label = *static_cast<HTMLLabelElementImpl*>(impl());
switch (token) {
@@ -1723,7 +1723,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::fieldSetGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::fieldSetGetter(ExecState* exec, int token) const
{
HTMLFieldSetElementImpl& fieldSet = *static_cast<HTMLFieldSetElementImpl*>(impl());
if (token == FieldSetForm)
@@ -1731,7 +1731,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::legendGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::legendGetter(ExecState* exec, int token) const
{
HTMLLegendElementImpl& legend = *static_cast<HTMLLegendElementImpl*>(impl());
switch (token) {
@@ -1742,7 +1742,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::uListGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::uListGetter(ExecState* exec, int token) const
{
HTMLUListElementImpl& uList = *static_cast<HTMLUListElementImpl*>(impl());
switch (token) {
@@ -1752,7 +1752,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::oListGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::oListGetter(ExecState* exec, int token) const
{
HTMLOListElementImpl& oList = *static_cast<HTMLOListElementImpl*>(impl());
switch (token) {
@@ -1763,7 +1763,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::dListGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::dListGetter(ExecState* exec, int token) const
{
HTMLDListElementImpl& dList = *static_cast<HTMLDListElementImpl*>(impl());
if (token == DListCompact)
@@ -1771,7 +1771,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::dirGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::dirGetter(ExecState* exec, int token) const
{
HTMLDirectoryElementImpl& dir = *static_cast<HTMLDirectoryElementImpl*>(impl());
if (token == DirectoryCompact)
@@ -1779,7 +1779,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::menuGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::menuGetter(ExecState* exec, int token) const
{
HTMLMenuElementImpl& menu = *static_cast<HTMLMenuElementImpl*>(impl());
if (token == MenuCompact)
@@ -1787,7 +1787,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::liGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::liGetter(ExecState* exec, int token) const
{
HTMLLIElementImpl& li = *static_cast<HTMLLIElementImpl*>(impl());
switch (token) {
@@ -1797,7 +1797,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::divGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::divGetter(ExecState* exec, int token) const
{
HTMLDivElementImpl& div = *static_cast<HTMLDivElementImpl*>(impl());
if (token == DivAlign)
@@ -1805,7 +1805,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::paragraphGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::paragraphGetter(ExecState* exec, int token) const
{
HTMLParagraphElementImpl& p = *static_cast<HTMLParagraphElementImpl*>(impl());
if (token == ParagraphAlign)
@@ -1813,7 +1813,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::headingGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::headingGetter(ExecState* exec, int token) const
{
HTMLHeadingElementImpl& h = *static_cast<HTMLHeadingElementImpl*>(impl());
if (token == HeadingAlign)
@@ -1821,7 +1821,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::blockQuoteGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::blockQuoteGetter(ExecState* exec, int token) const
{
HTMLBlockquoteElementImpl& blockQuote = *static_cast<HTMLBlockquoteElementImpl*>(impl());
if (token == BlockQuoteCite)
@@ -1829,7 +1829,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::quoteGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::quoteGetter(ExecState* exec, int token) const
{
HTMLQuoteElementImpl& quote = *static_cast<HTMLQuoteElementImpl*>(impl());
if (token == QuoteCite)
@@ -1837,7 +1837,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::preGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::preGetter(ExecState* exec, int token) const
{
// FIXME: Add support for 'wrap' when white-space: pre-wrap is implemented.
HTMLPreElementImpl& pre = *static_cast<HTMLPreElementImpl*>(impl());
@@ -1848,7 +1848,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::brGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::brGetter(ExecState* exec, int token) const
{
HTMLBRElementImpl& br = *static_cast<HTMLBRElementImpl*>(impl());
if (token == BRClear)
@@ -1856,7 +1856,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::baseFontGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::baseFontGetter(ExecState* exec, int token) const
{
HTMLBaseFontElementImpl& baseFont = *static_cast<HTMLBaseFontElementImpl*>(impl());
switch (token) {
@@ -1867,7 +1867,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::fontGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::fontGetter(ExecState* exec, int token) const
{
HTMLFontElementImpl& font = *static_cast<HTMLFontElementImpl*>(impl());
switch (token) {
@@ -1878,7 +1878,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::hrGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::hrGetter(ExecState* exec, int token) const
{
HTMLHRElementImpl& hr = *static_cast<HTMLHRElementImpl*>(impl());
switch (token) {
@@ -1890,7 +1890,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::modGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::modGetter(ExecState* exec, int token) const
{
HTMLModElementImpl& mod = *static_cast<HTMLModElementImpl*>(impl());
switch (token) {
@@ -1900,7 +1900,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::anchorGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::anchorGetter(ExecState* exec, int token) const
{
HTMLAnchorElementImpl& anchor = *static_cast<HTMLAnchorElementImpl*>(impl());
switch (token) {
@@ -1938,7 +1938,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::imageGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::imageGetter(ExecState* exec, int token) const
{
HTMLImageElementImpl& image = *static_cast<HTMLImageElementImpl*>(impl());
switch (token) {
@@ -1960,7 +1960,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::objectGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::objectGetter(ExecState* exec, int token) const
{
HTMLObjectElementImpl& object = *static_cast<HTMLObjectElementImpl*>(impl());
switch (token) {
@@ -1988,7 +1988,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::paramGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::paramGetter(ExecState* exec, int token) const
{
HTMLParamElementImpl& param = *static_cast<HTMLParamElementImpl*>(impl());
switch (token) {
@@ -2000,7 +2000,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::appletGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::appletGetter(ExecState* exec, int token) const
{
HTMLAppletElementImpl& applet = *static_cast<HTMLAppletElementImpl*>(impl());
switch (token) {
@@ -2019,7 +2019,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::mapGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::mapGetter(ExecState* exec, int token) const
{
HTMLMapElementImpl& map = *static_cast<HTMLMapElementImpl*>(impl());
switch (token) {
@@ -2029,7 +2029,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::areaGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::areaGetter(ExecState* exec, int token) const
{
HTMLAreaElementImpl& area = *static_cast<HTMLAreaElementImpl*>(impl());
switch (token) {
@@ -2059,7 +2059,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::scriptGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::scriptGetter(ExecState* exec, int token) const
{
HTMLScriptElementImpl& script = *static_cast<HTMLScriptElementImpl*>(impl());
switch (token) {
@@ -2074,7 +2074,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::tableGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::tableGetter(ExecState* exec, int token) const
{
HTMLTableElementImpl& table = *static_cast<HTMLTableElementImpl*>(impl());
switch (token) {
@@ -2096,7 +2096,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::tableCaptionGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::tableCaptionGetter(ExecState* exec, int token) const
{
HTMLTableCaptionElementImpl& tableCaption = *static_cast<HTMLTableCaptionElementImpl*>(impl());
if (token == TableCaptionAlign)
@@ -2104,7 +2104,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::tableColGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::tableColGetter(ExecState* exec, int token) const
{
HTMLTableColElementImpl& tableCol = *static_cast<HTMLTableColElementImpl*>(impl());
switch (token) {
@@ -2118,7 +2118,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::tableSectionGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::tableSectionGetter(ExecState* exec, int token) const
{
HTMLTableSectionElementImpl& tableSection = *static_cast<HTMLTableSectionElementImpl*>(impl());
switch (token) {
@@ -2131,7 +2131,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::tableRowGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::tableRowGetter(ExecState* exec, int token) const
{
HTMLTableRowElementImpl& tableRow = *static_cast<HTMLTableRowElementImpl*>(impl());
switch (token) {
@@ -2147,7 +2147,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::tableCellGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::tableCellGetter(ExecState* exec, int token) const
{
HTMLTableCellElementImpl& tableCell = *static_cast<HTMLTableCellElementImpl*>(impl());
switch (token) {
@@ -2170,7 +2170,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::frameSetGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::frameSetGetter(ExecState* exec, int token) const
{
HTMLFrameSetElementImpl& frameSet = *static_cast<HTMLFrameSetElementImpl*>(impl());
switch (token) {
@@ -2180,7 +2180,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::frameGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::frameGetter(ExecState* exec, int token) const
{
HTMLFrameElementImpl& frameElement = *static_cast<HTMLFrameElementImpl*>(impl());
switch (token) {
@@ -2202,7 +2202,7 @@
return jsUndefined();
}
-ValueImp *HTMLElement::iFrameGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::iFrameGetter(ExecState* exec, int token) const
{
HTMLIFrameElementImpl& iFrame = *static_cast<HTMLIFrameElementImpl*>(impl());
switch (token) {
@@ -2227,13 +2227,13 @@
return jsUndefined();
}
-ValueImp *HTMLElement::marqueeGetter(ExecState* exec, int token) const
+JSValue *HTMLElement::marqueeGetter(ExecState* exec, int token) const
{
// FIXME: Find out what WinIE exposes as properties and implement this.
return jsUndefined();
}
-ValueImp *HTMLElement::getValueProperty(ExecState *exec, int token) const
+JSValue *HTMLElement::getValueProperty(ExecState *exec, int token) const
{
// Check our set of generic properties first.
HTMLElementImpl &element = *static_cast<HTMLElementImpl *>(impl());
@@ -2302,7 +2302,7 @@
HTMLElementImpl *element = static_cast<HTMLElementImpl *>(impl());
// The document is put on first, fall back to searching it only after the element and form.
- scope.push(static_cast<ObjectImp *>(getDOMNode(exec, element->ownerDocument())));
+ scope.push(static_cast<JSObject *>(getDOMNode(exec, element->ownerDocument())));
// The form is next, searched before the document, but after the element itself.
@@ -2311,18 +2311,18 @@
// <table> or <tbody>.
HTMLFormElementImpl *form = getForm(element);
if (form)
- scope.push(static_cast<ObjectImp *>(getDOMNode(exec, form)));
+ scope.push(static_cast<JSObject *>(getDOMNode(exec, form)));
else {
NodeImpl *form = element->parentNode();
while (form && !form->hasTagName(formTag))
form = form->parentNode();
if (form)
- scope.push(static_cast<ObjectImp *>(getDOMNode(exec, form)));
+ scope.push(static_cast<JSObject *>(getDOMNode(exec, form)));
}
// The element is on top, searched first.
- scope.push(static_cast<ObjectImp *>(getDOMNode(exec, element)));
+ scope.push(static_cast<JSObject *>(getDOMNode(exec, element)));
}
HTMLElementFunction::HTMLElementFunction(ExecState *exec, int i, int len)
@@ -2331,7 +2331,7 @@
put(exec,lengthPropertyName,jsNumber(len),DontDelete|ReadOnly|DontEnum);
}
-ValueImp *KJS::HTMLElementFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *KJS::HTMLElementFunction::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::HTMLElement::info))
return throwError(exec, TypeError);
@@ -2522,7 +2522,7 @@
return jsUndefined();
}
-void KJS::HTMLElement::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void KJS::HTMLElement::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
#ifdef KJS_VERBOSE
DOM::DOMString str = value.isNull() ? DOM::DOMString() : value->toString(exec).domString();
@@ -2539,14 +2539,14 @@
bool ok;
/*uint u =*/ propertyName.toUInt32(&ok);
if (ok) {
- ObjectImp *coll = static_cast<ObjectImp *>(getSelectHTMLCollection(exec, select.optionsHTMLCollection().get(), &select));
+ JSObject *coll = static_cast<JSObject *>(getSelectHTMLCollection(exec, select.optionsHTMLCollection().get(), &select));
coll->put(exec,propertyName,value);
return;
}
}
else if (element.hasLocalName(embedTag) || element.hasLocalName(objectTag) || element.hasLocalName(appletTag)) {
- if (ValueImp *runtimeObject = getRuntimeObject(exec, &element)) {
- ObjectImp *imp = static_cast<ObjectImp *>(runtimeObject);
+ if (JSValue *runtimeObject = getRuntimeObject(exec, &element)) {
+ JSObject *imp = static_cast<JSObject *>(runtimeObject);
if (imp->canPut(exec, propertyName))
return imp->put(exec, propertyName, value);
}
@@ -2556,7 +2556,7 @@
const HashEntry* entry = Lookup::findEntry(table, propertyName);
if (entry) {
if (entry->attr & Function) { // function: put as override property
- ObjectImp::put(exec, propertyName, value, attr);
+ JSObject::put(exec, propertyName, value, attr);
return;
}
else if (!(entry->attr & ReadOnly)) { // let lookupPut print the warning if read-only
@@ -2568,21 +2568,21 @@
lookupPut<KJS::HTMLElement, DOMElement>(exec, propertyName, value, attr, &HTMLElementTable, this);
}
-void HTMLElement::htmlSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::htmlSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLHeadElementImpl &head = *static_cast<HTMLHeadElementImpl*>(impl());
if (token == HeadProfile)
head.setProfile(str);
}
-void HTMLElement::headSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::headSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLHeadElementImpl &head = *static_cast<HTMLHeadElementImpl*>(impl());
if (token == HeadProfile)
head.setProfile(str);
}
-void HTMLElement::linkSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::linkSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLLinkElementImpl &link = *static_cast<HTMLLinkElementImpl*>(impl());
switch (token) {
@@ -2598,14 +2598,14 @@
}
}
-void HTMLElement::titleSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::titleSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLTitleElementImpl& title = *static_cast<HTMLTitleElementImpl*>(impl());
if (token == TitleText)
title.setText(str);
}
-void HTMLElement::metaSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::metaSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLMetaElementImpl& meta = *static_cast<HTMLMetaElementImpl*>(impl());
switch (token) {
@@ -2616,7 +2616,7 @@
}
}
-void HTMLElement::baseSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::baseSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLBaseElementImpl& base = *static_cast<HTMLBaseElementImpl*>(impl());
switch (token) {
@@ -2625,14 +2625,14 @@
}
}
-void HTMLElement::isIndexSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::isIndexSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLIsIndexElementImpl& isindex = *static_cast<HTMLIsIndexElementImpl*>(impl());
if (token == IsIndexPrompt)
isindex.setPrompt(str);
}
-void HTMLElement::styleSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::styleSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLStyleElementImpl& style = *static_cast<HTMLStyleElementImpl*>(impl());
switch (token) {
@@ -2642,7 +2642,7 @@
}
}
-void HTMLElement::bodySetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::bodySetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLBodyElementImpl& body = *static_cast<HTMLBodyElementImpl*>(impl());
switch (token) {
@@ -2669,7 +2669,7 @@
}
}
-void HTMLElement::formSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::formSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLFormElementImpl& form = *static_cast<HTMLFormElementImpl*>(impl());
switch (token) {
@@ -2684,7 +2684,7 @@
}
}
-void HTMLElement::selectSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::selectSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLSelectElementImpl& select = *static_cast<HTMLSelectElementImpl*>(impl());
switch (token) {
@@ -2692,7 +2692,7 @@
case SelectSelectedIndex: { select.setSelectedIndex(value->toInt32(exec)); return; }
case SelectValue: { select.setValue(str); return; }
case SelectLength: { // read-only according to the NS spec, but webpages need it writeable
- ObjectImp *coll = static_cast<ObjectImp *>(getSelectHTMLCollection(exec, select.optionsHTMLCollection().get(), &select));
+ JSObject *coll = static_cast<JSObject *>(getSelectHTMLCollection(exec, select.optionsHTMLCollection().get(), &select));
coll->put(exec,lengthPropertyName,value);
return;
}
@@ -2706,7 +2706,7 @@
}
}
-void HTMLElement::optGroupSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::optGroupSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLOptGroupElementImpl& optgroup = *static_cast<HTMLOptGroupElementImpl*>(impl());
switch (token) {
@@ -2715,7 +2715,7 @@
}
}
-void HTMLElement::optionSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::optionSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
DOMExceptionTranslator exception(exec);
HTMLOptionElementImpl& option = *static_cast<HTMLOptionElementImpl*>(impl());
@@ -2731,7 +2731,7 @@
}
}
-void HTMLElement::inputSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::inputSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLInputElementImpl& input = *static_cast<HTMLInputElementImpl*>(impl());
switch (token) {
@@ -2759,7 +2759,7 @@
}
}
-void HTMLElement::textAreaSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::textAreaSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLTextAreaElementImpl& textarea = *static_cast<HTMLTextAreaElementImpl*>(impl());
switch (token) {
@@ -2779,7 +2779,7 @@
}
}
-void HTMLElement::buttonSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::buttonSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLButtonElementImpl& button = *static_cast<HTMLButtonElementImpl*>(impl());
switch (token) {
@@ -2793,7 +2793,7 @@
}
}
-void HTMLElement::labelSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::labelSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLLabelElementImpl& label = *static_cast<HTMLLabelElementImpl*>(impl());
switch (token) {
@@ -2803,11 +2803,11 @@
}
}
-void HTMLElement::fieldSetSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::fieldSetSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
}
-void HTMLElement::legendSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::legendSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLLegendElementImpl& legend = *static_cast<HTMLLegendElementImpl*>(impl());
switch (token) {
@@ -2817,7 +2817,7 @@
}
}
-void HTMLElement::uListSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::uListSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLUListElementImpl& uList = *static_cast<HTMLUListElementImpl*>(impl());
switch (token) {
@@ -2826,7 +2826,7 @@
}
}
-void HTMLElement::oListSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::oListSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLOListElementImpl& oList = *static_cast<HTMLOListElementImpl*>(impl());
switch (token) {
@@ -2836,28 +2836,28 @@
}
}
-void HTMLElement::dListSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::dListSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLDListElementImpl& dList = *static_cast<HTMLDListElementImpl*>(impl());
if (token == DListCompact)
dList.setCompact(value->toBoolean(exec));
}
-void HTMLElement::dirSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::dirSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLDirectoryElementImpl& directory = *static_cast<HTMLDirectoryElementImpl*>(impl());
if (token == DirectoryCompact)
directory.setCompact(value->toBoolean(exec));
}
-void HTMLElement::menuSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::menuSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLMenuElementImpl& menu = *static_cast<HTMLMenuElementImpl*>(impl());
if (token == MenuCompact)
menu.setCompact(value->toBoolean(exec));
}
-void HTMLElement::liSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::liSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLLIElementImpl& li = *static_cast<HTMLLIElementImpl*>(impl());
switch (token) {
@@ -2866,42 +2866,42 @@
}
}
-void HTMLElement::divSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::divSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLDivElementImpl& div = *static_cast<HTMLDivElementImpl*>(impl());
if (token == DivAlign)
div.setAlign(str);
}
-void HTMLElement::paragraphSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::paragraphSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLParagraphElementImpl& paragraph = *static_cast<HTMLParagraphElementImpl*>(impl());
if (token == ParagraphAlign)
paragraph.setAlign(str);
}
-void HTMLElement::headingSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::headingSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLHeadingElementImpl& heading = *static_cast<HTMLHeadingElementImpl*>(impl());
if (token == HeadingAlign)
heading.setAlign(str);
}
-void HTMLElement::blockQuoteSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::blockQuoteSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLBlockquoteElementImpl& blockQuote = *static_cast<HTMLBlockquoteElementImpl*>(impl());
if (token == BlockQuoteCite)
blockQuote.setCite(str);
}
-void HTMLElement::quoteSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::quoteSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLQuoteElementImpl& quote = *static_cast<HTMLQuoteElementImpl*>(impl());
if (token == QuoteCite)
quote.setCite(str);
}
-void HTMLElement::preSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::preSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLPreElementImpl& pre = *static_cast<HTMLPreElementImpl*>(impl());
if (token == PreWidth)
@@ -2910,14 +2910,14 @@
pre.setWrap(value->toBoolean(exec));
}
-void HTMLElement::brSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::brSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLBRElementImpl& br = *static_cast<HTMLBRElementImpl*>(impl());
if (token == BRClear)
br.setClear(str);
}
-void HTMLElement::baseFontSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::baseFontSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLBaseFontElementImpl& baseFont = *static_cast<HTMLBaseFontElementImpl*>(impl());
switch (token) {
@@ -2927,7 +2927,7 @@
}
}
-void HTMLElement::fontSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::fontSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLFontElementImpl& font = *static_cast<HTMLFontElementImpl*>(impl());
switch (token) {
@@ -2937,7 +2937,7 @@
}
}
-void HTMLElement::hrSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::hrSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLHRElementImpl& hr = *static_cast<HTMLHRElementImpl*>(impl());
switch (token) {
@@ -2948,7 +2948,7 @@
}
}
-void HTMLElement::modSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::modSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLModElementImpl& mod = *static_cast<HTMLModElementImpl*>(impl());
switch (token) {
@@ -2957,7 +2957,7 @@
}
}
-void HTMLElement::anchorSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::anchorSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLAnchorElementImpl& anchor = *static_cast<HTMLAnchorElementImpl*>(impl());
switch (token) {
@@ -2976,7 +2976,7 @@
}
}
-void HTMLElement::imageSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::imageSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLImageElementImpl& image = *static_cast<HTMLImageElementImpl*>(impl());
switch (token) {
@@ -2995,7 +2995,7 @@
}
}
-void HTMLElement::objectSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::objectSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLObjectElementImpl& object = *static_cast<HTMLObjectElementImpl*>(impl());
switch (token) {
@@ -3021,7 +3021,7 @@
}
}
-void HTMLElement::paramSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::paramSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLParamElementImpl& param = *static_cast<HTMLParamElementImpl*>(impl());
switch (token) {
@@ -3032,7 +3032,7 @@
}
}
-void HTMLElement::appletSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::appletSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLAppletElementImpl& applet = *static_cast<HTMLAppletElementImpl*>(impl());
switch (token) {
@@ -3050,7 +3050,7 @@
}
}
-void HTMLElement::mapSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::mapSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLMapElementImpl& map = *static_cast<HTMLMapElementImpl*>(impl());
if (token == MapName)
@@ -3058,7 +3058,7 @@
map.setName(str);
}
-void HTMLElement::areaSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::areaSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLAreaElementImpl& area = *static_cast<HTMLAreaElementImpl*>(impl());
switch (token) {
@@ -3073,7 +3073,7 @@
}
}
-void HTMLElement::scriptSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::scriptSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLScriptElementImpl& script = *static_cast<HTMLScriptElementImpl*>(impl());
switch (token) {
@@ -3087,7 +3087,7 @@
}
}
-void HTMLElement::tableSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::tableSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLTableElementImpl& table = *static_cast<HTMLTableElementImpl*>(impl());
switch (token) {
@@ -3108,14 +3108,14 @@
}
}
-void HTMLElement::tableCaptionSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::tableCaptionSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLTableCaptionElementImpl& tableCaption = *static_cast<HTMLTableCaptionElementImpl*>(impl());
if (token == TableCaptionAlign)
tableCaption.setAlign(str);
}
-void HTMLElement::tableColSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::tableColSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLTableColElementImpl& tableCol = *static_cast<HTMLTableColElementImpl*>(impl());
switch (token) {
@@ -3128,7 +3128,7 @@
}
}
-void HTMLElement::tableSectionSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::tableSectionSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLTableSectionElementImpl& tableSection = *static_cast<HTMLTableSectionElementImpl*>(impl());
switch (token) {
@@ -3140,7 +3140,7 @@
}
}
-void HTMLElement::tableRowSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::tableRowSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLTableRowElementImpl& tableRow = *static_cast<HTMLTableRowElementImpl*>(impl());
switch (token) {
@@ -3155,7 +3155,7 @@
}
}
-void HTMLElement::tableCellSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::tableCellSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLTableCellElementImpl& tableCell = *static_cast<HTMLTableCellElementImpl*>(impl());
switch (token) {
@@ -3177,7 +3177,7 @@
}
}
-void HTMLElement::frameSetSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::frameSetSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLFrameSetElementImpl& frameSet = *static_cast<HTMLFrameSetElementImpl*>(impl());
switch (token) {
@@ -3186,7 +3186,7 @@
}
}
-void HTMLElement::frameSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::frameSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLFrameElementImpl& frameElement = *static_cast<HTMLFrameElementImpl*>(impl());
switch (token) {
@@ -3203,7 +3203,7 @@
}
}
-void HTMLElement::iFrameSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::iFrameSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
HTMLIFrameElementImpl& iFrame = *static_cast<HTMLIFrameElementImpl*>(impl());
switch (token) {
@@ -3221,12 +3221,12 @@
}
}
-void HTMLElement::marqueeSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str)
+void HTMLElement::marqueeSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str)
{
// FIXME: Find out what WinIE supports and implement it.
}
-void HTMLElement::putValueProperty(ExecState *exec, int token, ValueImp *value, int)
+void HTMLElement::putValueProperty(ExecState *exec, int token, JSValue *value, int)
{
DOMExceptionTranslator exception(exec);
DOM::DOMString str = value->toString(exec).domString();
@@ -3272,14 +3272,14 @@
return (this->*(info->m_setter))(exec, token, value, str);
}
-HTMLElementImpl *toHTMLElement(ValueImp *val)
+HTMLElementImpl *toHTMLElement(JSValue *val)
{
if (!val || !val->isObject(&HTMLElement::info))
return 0;
return static_cast<HTMLElementImpl *>(static_cast<HTMLElement *>(val)->impl());
}
-HTMLTableCaptionElementImpl *toHTMLTableCaptionElement(ValueImp *val)
+HTMLTableCaptionElementImpl *toHTMLTableCaptionElement(JSValue *val)
{
HTMLElementImpl *e = toHTMLElement(val);
if (e && e->hasTagName(captionTag))
@@ -3287,7 +3287,7 @@
return 0;
}
-HTMLTableSectionElementImpl *toHTMLTableSectionElement(ValueImp *val)
+HTMLTableSectionElementImpl *toHTMLTableSectionElement(JSValue *val)
{
HTMLElementImpl *e = toHTMLElement(val);
if (e && (e->hasTagName(theadTag) || e->hasTagName(tbodyTag) || e->hasTagName(tfootTag)))
@@ -3320,19 +3320,19 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *HTMLCollection::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLCollection::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLCollection *thisObj = static_cast<HTMLCollection *>(slot.slotBase());
return jsNumber(thisObj->m_impl->length());
}
-ValueImp *HTMLCollection::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLCollection::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLCollection *thisObj = static_cast<HTMLCollection *>(slot.slotBase());
return getDOMNode(exec, thisObj->m_impl->item(slot.index()));
}
-ValueImp *HTMLCollection::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLCollection::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLCollection *thisObj = static_cast<HTMLCollection *>(slot.slotBase());
return thisObj->getNamedItems(exec, propertyName);
@@ -3345,8 +3345,8 @@
return true;
} else {
// Look in the prototype (for functions) before assuming it's an item's name
- ValueImp *proto = prototype();
- if (proto->isObject() && static_cast<ObjectImp *>(proto)->hasProperty(exec, propertyName))
+ JSValue *proto = prototype();
+ if (proto->isObject() && static_cast<JSObject *>(proto)->hasProperty(exec, propertyName))
return false;
// name or index ?
@@ -3368,7 +3368,7 @@
// HTMLCollections are strange objects, they support both get and call,
// so that document.forms.item(0) and document.forms(0) both work.
-ValueImp *KJS::HTMLCollection::callAsFunction(ExecState *exec, ObjectImp *, const List &args)
+JSValue *KJS::HTMLCollection::callAsFunction(ExecState *exec, JSObject *, const List &args)
{
// Do not use thisObj here. It can be the HTMLDocument, in the document.forms(i) case.
HTMLCollectionImpl &collection = *m_impl;
@@ -3405,7 +3405,7 @@
return jsUndefined();
}
-ValueImp *KJS::HTMLCollection::getNamedItems(ExecState *exec, const Identifier &propertyName) const
+JSValue *KJS::HTMLCollection::getNamedItems(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
kdDebug(6070) << "KJS::HTMLCollection::getNamedItems " << propertyName.ascii() << endl;
@@ -3427,7 +3427,7 @@
return new DOMNamedNodesCollection(exec, namedItems);
}
-ValueImp *KJS::HTMLCollectionProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *KJS::HTMLCollectionProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::HTMLCollection::info))
return throwError(exec, TypeError);
@@ -3452,7 +3452,7 @@
{
}
-ValueImp *HTMLSelectCollection::selectedIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *HTMLSelectCollection::selectedIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
HTMLSelectCollection *thisObj = static_cast<HTMLSelectCollection *>(slot.slotBase());
return jsNumber(thisObj->m_element->selectedIndex());
@@ -3469,7 +3469,7 @@
return HTMLCollection::getOwnPropertySlot(exec, propertyName, slot);
}
-void KJS::HTMLSelectCollection::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int)
+void KJS::HTMLSelectCollection::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int)
{
#ifdef KJS_VERBOSE
kdDebug(6070) << "KJS::HTMLSelectCollection::put " << propertyName.qstring() << endl;
@@ -3555,7 +3555,7 @@
OptionConstructorImp::OptionConstructorImp(ExecState *exec, DocumentImpl *d)
: m_doc(d)
{
- // ## isn't there some redundancy between ObjectImp::_proto and the "prototype" property ?
+ // ## isn't there some redundancy between JSObject::_proto and the "prototype" property ?
//put(exec,"prototype", ...,DontEnum|DontDelete|ReadOnly);
// no. of arguments for constructor
@@ -3568,7 +3568,7 @@
return true;
}
-ObjectImp *OptionConstructorImp::construct(ExecState *exec, const List &args)
+JSObject *OptionConstructorImp::construct(ExecState *exec, const List &args)
{
int exception = 0;
RefPtr<ElementImpl> el(m_doc->createElement("option", exception));
@@ -3591,7 +3591,7 @@
}
setDOMException(exec, exception);
- return static_cast<ObjectImp *>(getDOMNode(exec,opt));
+ return static_cast<JSObject *>(getDOMNode(exec,opt));
}
////////////////////// Image Object ////////////////////////
@@ -3606,22 +3606,22 @@
return true;
}
-ObjectImp *ImageConstructorImp::construct(ExecState * exec, const List & list)
+JSObject *ImageConstructorImp::construct(ExecState * exec, const List & list)
{
bool widthSet = false, heightSet = false;
int width = 0, height = 0;
if (list.size() > 0) {
widthSet = true;
- ValueImp *w = list.at(0);
+ JSValue *w = list.at(0);
width = w->toInt32(exec);
}
if (list.size() > 1) {
heightSet = true;
- ValueImp *h = list.at(1);
+ JSValue *h = list.at(1);
height = h->toInt32(exec);
}
- ObjectImp *result(new Image(m_doc.get(), widthSet, width, heightSet, height));
+ JSObject *result(new Image(m_doc.get(), widthSet, width, heightSet, height));
/* TODO: do we need a prototype ? */
return result;
@@ -3644,7 +3644,7 @@
return getStaticValueSlot<Image,DOMObject>(exec, &ImageTable, this, propertyName, slot);
}
-ValueImp *Image::getValueProperty(ExecState *, int token) const
+JSValue *Image::getValueProperty(ExecState *, int token) const
{
switch (token) {
case Src:
@@ -3685,12 +3685,12 @@
}
}
-void Image::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void Image::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
lookupPut<Image,DOMObject>(exec, propertyName, value, attr, &ImageTable, this );
}
-void Image::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void Image::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
switch(token) {
case Src:
@@ -3750,12 +3750,12 @@
IMPLEMENT_PROTOFUNC(Context2DFunction)
-static bool isGradient(ValueImp *value)
+static bool isGradient(JSValue *value)
{
return value->isObject(&Gradient::info);
}
-static bool isImagePattern(ValueImp *value)
+static bool isImagePattern(JSValue *value)
{
return value->isObject(&ImagePattern::info);
}
@@ -3763,7 +3763,7 @@
#define BITS_PER_COMPONENT 8
#define BYTES_PER_ROW(width,bitsPerComponent,numComponents) ((width * bitsPerComponent * numComponents + 7)/8)
-ValueImp *KJS::Context2DFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *KJS::Context2DFunction::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&Context2D::info))
return throwError(exec, TypeError);
@@ -3970,7 +3970,7 @@
// operates on clippin regions! Odd, but true.
CGContextClip(drawingContext);
- ObjectImp *o = static_cast<ObjectImp*>(contextObject->_fillStyle);
+ JSObject *o = static_cast<JSObject*>(contextObject->_fillStyle);
Gradient *gradient = static_cast<Gradient*>(o);
CGShadingRef shading = gradient->getShading();
CGContextDrawShading(drawingContext, shading);
@@ -3999,7 +3999,7 @@
CGContextReplacePathWithStrokedPath(drawingContext);
CGContextClip(drawingContext);
- ObjectImp *o = static_cast<ObjectImp*>(contextObject->_strokeStyle);
+ JSObject *o = static_cast<JSObject*>(contextObject->_strokeStyle);
Gradient *gradient = static_cast<Gradient*>(o);
CGShadingRef shading = gradient->getShading();
@@ -4266,7 +4266,7 @@
return throwError(exec, SyntaxError);
// Make sure first argument is an object.
- ObjectImp *o = static_cast<ObjectImp*>(args[0]);
+ JSObject *o = static_cast<JSObject*>(args[0]);
if (!o->isObject())
return throwError(exec, TypeError);
@@ -4388,7 +4388,7 @@
case Context2D::DrawImageFromRect: {
if (args.size() != 10)
return throwError(exec, SyntaxError);
- ObjectImp *o = static_cast<ObjectImp*>(args[0]);
+ JSObject *o = static_cast<JSObject*>(args[0]);
if (!o->isObject() || !o->inherits(&Image::info))
return throwError(exec, TypeError);
Image *i = static_cast<Image*>(o);
@@ -4457,7 +4457,7 @@
case Context2D::CreatePattern: {
if (args.size() != 2)
return throwError(exec, SyntaxError);
- ObjectImp *o = static_cast<ObjectImp*>(args[0]);
+ JSObject *o = static_cast<JSObject*>(args[0]);
if (!o->isObject() || !o->inherits(&Image::info))
return throwError(exec, TypeError);
int repetitionType = ImagePattern::Repeat;
@@ -4535,7 +4535,7 @@
return getStaticPropertySlot<Context2DFunction, Context2D, DOMObject>(exec, &Context2DTable, this, propertyName, slot);
}
-ValueImp *Context2D::getValueProperty(ExecState *, int token) const
+JSValue *Context2D::getValueProperty(ExecState *, int token) const
{
switch(token) {
case StrokeStyle: {
@@ -4593,7 +4593,7 @@
return jsUndefined();
}
-void Context2D::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void Context2D::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
lookupPut<Context2D,DOMObject>(exec, propertyName, value, attr, &Context2DTable, this );
}
@@ -4612,7 +4612,7 @@
}
-CGColorRef colorRefFromValue(ExecState *exec, ValueImp *value)
+CGColorRef colorRefFromValue(ExecState *exec, JSValue *value)
{
CGColorSpaceRef colorSpace;
float components[4];
@@ -4635,7 +4635,7 @@
return colorRef;
}
-QColor colorFromValue(ExecState *exec, ValueImp *value)
+QColor colorFromValue(ExecState *exec, JSValue *value)
{
QRgb color = DOM::CSSParser::parseColor(value->toString(exec).domString());
return QColor(color);
@@ -4694,7 +4694,7 @@
}
}
-void Context2D::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void Context2D::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
CGContextRef context = drawingContext();
if (!context)
@@ -4710,7 +4710,7 @@
else {
// _strokeStyle is used when stroke() is called on the context.
// CG doesn't have the notion of a setting a stroke gradient.
- ObjectImp *o = static_cast<ObjectImp*>(value);
+ JSObject *o = static_cast<JSObject*>(value);
if (!o->isObject() || !(o->inherits(&Gradient::info) || o->inherits(&ImagePattern::info)))
throwError(exec, TypeError);
@@ -4727,7 +4727,7 @@
else {
// _fillStyle is checked when fill() is called on the context.
// CG doesn't have the notion of setting a fill gradient.
- ObjectImp *o = static_cast<ObjectImp*>(value);
+ JSObject *o = static_cast<JSObject*>(value);
if (!o->isObject() || !(o->inherits(&Gradient::info) || o->inherits(&ImagePattern::info)))
throwError(exec, TypeError);
@@ -4908,7 +4908,7 @@
void Context2D::mark()
{
- ValueImp *v;
+ JSValue *v;
v = _strokeStyle;
if (!v->marked())
@@ -4978,7 +4978,7 @@
IMPLEMENT_PROTOFUNC(GradientFunction)
-ValueImp *GradientFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *GradientFunction::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&Gradient::info))
return throwError(exec, TypeError);
@@ -5094,17 +5094,17 @@
return getStaticPropertySlot<GradientFunction, Gradient, DOMObject>(exec, &GradientTable, this, propertyName, slot);
}
-ValueImp *Gradient::getValueProperty(ExecState *, int token) const
+JSValue *Gradient::getValueProperty(ExecState *, int token) const
{
return jsUndefined();
}
-void Gradient::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void Gradient::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
lookupPut<Gradient,DOMObject>(exec, propertyName, value, attr, &GradientTable, this );
}
-void Gradient::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void Gradient::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
}
@@ -5290,29 +5290,29 @@
return getStaticValueSlot<ImagePattern, DOMObject>(exec, &ImagePatternTable, this, propertyName, slot);
}
-ValueImp *ImagePattern::getValueProperty(ExecState *, int token) const
+JSValue *ImagePattern::getValueProperty(ExecState *, int token) const
{
return jsUndefined();
}
-void ImagePattern::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void ImagePattern::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
lookupPut<ImagePattern,DOMObject>(exec, propertyName, value, attr, &ImagePatternTable, this );
}
-void ImagePattern::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void ImagePattern::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
}
////////////////////////////////////////////////////////////////
-ValueImp *getHTMLCollection(ExecState *exec, HTMLCollectionImpl *c)
+JSValue *getHTMLCollection(ExecState *exec, HTMLCollectionImpl *c)
{
return cacheDOMObject<HTMLCollectionImpl, HTMLCollection>(exec, c);
}
-ValueImp *getSelectHTMLCollection(ExecState *exec, HTMLCollectionImpl *c, HTMLSelectElementImpl *e)
+JSValue *getSelectHTMLCollection(ExecState *exec, HTMLCollectionImpl *c, HTMLSelectElementImpl *e)
{
DOMObject *ret;
if (!c)
1.63 +167 -167 WebCore/khtml/ecma/kjs_html.h
Index: kjs_html.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- kjs_html.h 3 Dec 2005 20:26:00 -0000 1.62
+++ kjs_html.h 11 Dec 2005 02:06:06 -0000 1.63
@@ -46,9 +46,9 @@
public:
HTMLDocument(ExecState *exec, DOM::HTMLDocumentImpl *d);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Title, Referrer, Domain, URL, Body, Location, Cookie,
@@ -56,19 +56,19 @@
Write, WriteLn, GetElementsByName, CaptureEvents, ReleaseEvents,
BgColor, FgColor, AlinkColor, LinkColor, VlinkColor, LastModified, Height, Width, Dir, DesignMode };
private:
- static ValueImp *namedItemGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *namedItemGetter(ExecState *, const Identifier&, const PropertySlot&);
};
class HTMLElement : public DOMElement {
public:
HTMLElement(ExecState *exec, DOM::HTMLElementImpl *e);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int);
virtual UString toString(ExecState *exec) const;
virtual void pushEventHandlerScope(ExecState *exec, ScopeChain &scope) const;
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List&args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List&args);
virtual bool implementsCall() const;
virtual const ClassInfo* classInfo() const;
static const ClassInfo info;
@@ -85,8 +85,8 @@
tablecell_info, frameSet_info, frame_info, iFrame_info, marquee_info;
// FIXME: Might make sense to combine this with ClassInfo some day.
- typedef ValueImp *(HTMLElement::*GetterFunction)(ExecState *exec, int token) const;
- typedef void (HTMLElement::*SetterFunction)(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
+ typedef JSValue *(HTMLElement::*GetterFunction)(ExecState *exec, int token) const;
+ typedef void (HTMLElement::*SetterFunction)(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
struct Accessors { GetterFunction m_getter; SetterFunction m_setter; };
const Accessors* getSetInfo() const;
static const Accessors html_accessors, head_accessors, link_accessors, title_accessors,
@@ -100,114 +100,114 @@
caption_accessors, col_accessors, tablesection_accessors, tr_accessors,
tablecell_accessors, frameSet_accessors, frame_accessors, iFrame_accessors, marquee_accessors;
- ValueImp *htmlGetter(ExecState* exec, int token) const;
- void htmlSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *headGetter(ExecState* exec, int token) const;
- void headSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *linkGetter(ExecState* exec, int token) const;
- void linkSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *titleGetter(ExecState* exec, int token) const;
- void titleSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *metaGetter(ExecState* exec, int token) const;
- void metaSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *baseGetter(ExecState* exec, int token) const;
- void baseSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *isIndexGetter(ExecState* exec, int token) const;
- void isIndexSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *styleGetter(ExecState* exec, int token) const;
- void styleSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *bodyGetter(ExecState* exec, int token) const;
- void bodySetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *formGetter(ExecState* exec, int token) const;
- void formSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *selectGetter(ExecState* exec, int token) const;
- void selectSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *optGroupGetter(ExecState* exec, int token) const;
- void optGroupSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *optionGetter(ExecState* exec, int token) const;
- void optionSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *inputGetter(ExecState* exec, int token) const;
- void inputSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *textAreaGetter(ExecState* exec, int token) const;
- void textAreaSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *buttonGetter(ExecState* exec, int token) const;
- void buttonSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *labelGetter(ExecState* exec, int token) const;
- void labelSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *fieldSetGetter(ExecState* exec, int token) const;
- void fieldSetSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *legendGetter(ExecState* exec, int token) const;
- void legendSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *uListGetter(ExecState* exec, int token) const;
- void uListSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *oListGetter(ExecState* exec, int token) const;
- void oListSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *dListGetter(ExecState* exec, int token) const;
- void dListSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *dirGetter(ExecState* exec, int token) const;
- void dirSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *menuGetter(ExecState* exec, int token) const;
- void menuSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *liGetter(ExecState* exec, int token) const;
- void liSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *divGetter(ExecState* exec, int token) const;
- void divSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *paragraphGetter(ExecState* exec, int token) const;
- void paragraphSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *headingGetter(ExecState* exec, int token) const;
- void headingSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *blockQuoteGetter(ExecState* exec, int token) const;
- void blockQuoteSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *quoteGetter(ExecState* exec, int token) const;
- void quoteSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *preGetter(ExecState* exec, int token) const;
- void preSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *brGetter(ExecState* exec, int token) const;
- void brSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *baseFontGetter(ExecState* exec, int token) const;
- void baseFontSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *fontGetter(ExecState* exec, int token) const;
- void fontSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *hrGetter(ExecState* exec, int token) const;
- void hrSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *modGetter(ExecState* exec, int token) const;
- void modSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *anchorGetter(ExecState* exec, int token) const;
- void anchorSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *imageGetter(ExecState* exec, int token) const;
- void imageSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *objectGetter(ExecState* exec, int token) const;
- void objectSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *paramGetter(ExecState* exec, int token) const;
- void paramSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *appletGetter(ExecState* exec, int token) const;
- void appletSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *mapGetter(ExecState* exec, int token) const;
- void mapSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *areaGetter(ExecState* exec, int token) const;
- void areaSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *scriptGetter(ExecState* exec, int token) const;
- void scriptSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *tableGetter(ExecState* exec, int token) const;
- void tableSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *tableCaptionGetter(ExecState* exec, int token) const;
- void tableCaptionSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *tableColGetter(ExecState* exec, int token) const;
- void tableColSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *tableSectionGetter(ExecState* exec, int token) const;
- void tableSectionSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *tableRowGetter(ExecState* exec, int token) const;
- void tableRowSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *tableCellGetter(ExecState* exec, int token) const;
- void tableCellSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *frameSetGetter(ExecState* exec, int token) const;
- void frameSetSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *frameGetter(ExecState* exec, int token) const;
- void frameSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *iFrameGetter(ExecState* exec, int token) const;
- void iFrameSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
- ValueImp *marqueeGetter(ExecState* exec, int token) const;
- void marqueeSetter(ExecState *exec, int token, ValueImp *value, const DOM::DOMString& str);
+ JSValue *htmlGetter(ExecState* exec, int token) const;
+ void htmlSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *headGetter(ExecState* exec, int token) const;
+ void headSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *linkGetter(ExecState* exec, int token) const;
+ void linkSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *titleGetter(ExecState* exec, int token) const;
+ void titleSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *metaGetter(ExecState* exec, int token) const;
+ void metaSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *baseGetter(ExecState* exec, int token) const;
+ void baseSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *isIndexGetter(ExecState* exec, int token) const;
+ void isIndexSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *styleGetter(ExecState* exec, int token) const;
+ void styleSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *bodyGetter(ExecState* exec, int token) const;
+ void bodySetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *formGetter(ExecState* exec, int token) const;
+ void formSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *selectGetter(ExecState* exec, int token) const;
+ void selectSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *optGroupGetter(ExecState* exec, int token) const;
+ void optGroupSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *optionGetter(ExecState* exec, int token) const;
+ void optionSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *inputGetter(ExecState* exec, int token) const;
+ void inputSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *textAreaGetter(ExecState* exec, int token) const;
+ void textAreaSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *buttonGetter(ExecState* exec, int token) const;
+ void buttonSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *labelGetter(ExecState* exec, int token) const;
+ void labelSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *fieldSetGetter(ExecState* exec, int token) const;
+ void fieldSetSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *legendGetter(ExecState* exec, int token) const;
+ void legendSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *uListGetter(ExecState* exec, int token) const;
+ void uListSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *oListGetter(ExecState* exec, int token) const;
+ void oListSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *dListGetter(ExecState* exec, int token) const;
+ void dListSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *dirGetter(ExecState* exec, int token) const;
+ void dirSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *menuGetter(ExecState* exec, int token) const;
+ void menuSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *liGetter(ExecState* exec, int token) const;
+ void liSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *divGetter(ExecState* exec, int token) const;
+ void divSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *paragraphGetter(ExecState* exec, int token) const;
+ void paragraphSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *headingGetter(ExecState* exec, int token) const;
+ void headingSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *blockQuoteGetter(ExecState* exec, int token) const;
+ void blockQuoteSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *quoteGetter(ExecState* exec, int token) const;
+ void quoteSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *preGetter(ExecState* exec, int token) const;
+ void preSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *brGetter(ExecState* exec, int token) const;
+ void brSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *baseFontGetter(ExecState* exec, int token) const;
+ void baseFontSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *fontGetter(ExecState* exec, int token) const;
+ void fontSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *hrGetter(ExecState* exec, int token) const;
+ void hrSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *modGetter(ExecState* exec, int token) const;
+ void modSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *anchorGetter(ExecState* exec, int token) const;
+ void anchorSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *imageGetter(ExecState* exec, int token) const;
+ void imageSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *objectGetter(ExecState* exec, int token) const;
+ void objectSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *paramGetter(ExecState* exec, int token) const;
+ void paramSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *appletGetter(ExecState* exec, int token) const;
+ void appletSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *mapGetter(ExecState* exec, int token) const;
+ void mapSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *areaGetter(ExecState* exec, int token) const;
+ void areaSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *scriptGetter(ExecState* exec, int token) const;
+ void scriptSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *tableGetter(ExecState* exec, int token) const;
+ void tableSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *tableCaptionGetter(ExecState* exec, int token) const;
+ void tableCaptionSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *tableColGetter(ExecState* exec, int token) const;
+ void tableColSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *tableSectionGetter(ExecState* exec, int token) const;
+ void tableSectionSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *tableRowGetter(ExecState* exec, int token) const;
+ void tableRowSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *tableCellGetter(ExecState* exec, int token) const;
+ void tableCellSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *frameSetGetter(ExecState* exec, int token) const;
+ void frameSetSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *frameGetter(ExecState* exec, int token) const;
+ void frameSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *iFrameGetter(ExecState* exec, int token) const;
+ void iFrameSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
+ JSValue *marqueeGetter(ExecState* exec, int token) const;
+ void marqueeSetter(ExecState *exec, int token, JSValue *value, const DOM::DOMString& str);
enum { HtmlVersion, HeadProfile, LinkHref, LinkRel, LinkMedia,
LinkCharset, LinkDisabled, LinkHrefLang, LinkRev, LinkTarget, LinkType,
@@ -285,69 +285,69 @@
ElementClassName, ElementInnerText, ElementDocument, ElementChildren, ElementContentEditable,
ElementIsContentEditable, ElementOuterHTML, ElementOuterText};
private:
- static ValueImp *formIndexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *formNameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *selectIndexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *framesetNameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *frameWindowPropertyGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *runtimeObjectGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *runtimeObjectPropertyGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *formIndexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *formNameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *selectIndexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *framesetNameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *frameWindowPropertyGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *runtimeObjectGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *runtimeObjectPropertyGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
};
- DOM::HTMLElementImpl *toHTMLElement(ValueImp *); // returns 0 if passed-in value is not a HTMLElement object
- DOM::HTMLTableCaptionElementImpl *toHTMLTableCaptionElement(ValueImp *); // returns 0 if passed-in value is not a HTMLElement object for a HTMLTableCaptionElementImpl
- DOM::HTMLTableSectionElementImpl *toHTMLTableSectionElement(ValueImp *); // returns 0 if passed-in value is not a HTMLElement object for a HTMLTableSectionElementImpl
+ DOM::HTMLElementImpl *toHTMLElement(JSValue *); // returns 0 if passed-in value is not a HTMLElement object
+ DOM::HTMLTableCaptionElementImpl *toHTMLTableCaptionElement(JSValue *); // returns 0 if passed-in value is not a HTMLElement object for a HTMLTableCaptionElementImpl
+ DOM::HTMLTableSectionElementImpl *toHTMLTableSectionElement(JSValue *); // returns 0 if passed-in value is not a HTMLElement object for a HTMLTableSectionElementImpl
class HTMLCollection : public DOMObject {
public:
HTMLCollection(ExecState *exec, DOM::HTMLCollectionImpl *c);
~HTMLCollection();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List&args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List&args);
virtual bool implementsCall() const { return true; }
virtual bool toBoolean(ExecState *) const { return true; }
enum { Item, NamedItem, Tags };
- ValueImp *getNamedItems(ExecState *exec, const Identifier &propertyName) const;
+ JSValue *getNamedItems(ExecState *exec, const Identifier &propertyName) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
DOM::HTMLCollectionImpl *impl() const { return m_impl.get(); }
protected:
RefPtr<DOM::HTMLCollectionImpl> m_impl;
private:
- static ValueImp *lengthGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *nameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *lengthGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *nameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
};
class HTMLSelectCollection : public HTMLCollection {
public:
HTMLSelectCollection(ExecState *exec, DOM::HTMLCollectionImpl *c, DOM::HTMLSelectElementImpl *e);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
private:
- static ValueImp *selectedIndexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *selectedIndexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
RefPtr<DOM::HTMLSelectElementImpl> m_element;
};
////////////////////// Option Object ////////////////////////
- class OptionConstructorImp : public ObjectImp {
+ class OptionConstructorImp : public JSObject {
public:
OptionConstructorImp(ExecState *exec, DOM::DocumentImpl *d);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
private:
RefPtr<DOM::DocumentImpl> m_doc;
};
////////////////////// Image Object ////////////////////////
- class ImageConstructorImp : public ObjectImp {
+ class ImageConstructorImp : public JSObject {
public:
ImageConstructorImp(ExecState *exec, DOM::DocumentImpl *d);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
private:
RefPtr<DOM::DocumentImpl> m_doc;
};
@@ -357,9 +357,9 @@
Image(DOM::DocumentImpl *d, bool ws, int w, bool hs, int h);
~Image();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/);
void notifyFinished(khtml::CachedObject *);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
@@ -387,9 +387,9 @@
Context2D(DOM::HTMLElementImpl *e);
~Context2D();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual void mark();
virtual const ClassInfo* classInfo() const { return &info; }
@@ -443,24 +443,24 @@
QPtrList<List> stateStack;
- ValueImp *_strokeStyle;
- ValueImp *_fillStyle;
- ValueImp *_lineWidth;
- ValueImp *_lineCap;
- ValueImp *_lineJoin;
- ValueImp *_miterLimit;
- ValueImp *_shadowOffsetX;
- ValueImp *_shadowOffsetY;
- ValueImp *_shadowBlur;
- ValueImp *_shadowColor;
- ValueImp *_globalAlpha;
- ValueImp *_globalComposite;
+ JSValue *_strokeStyle;
+ JSValue *_fillStyle;
+ JSValue *_lineWidth;
+ JSValue *_lineCap;
+ JSValue *_lineJoin;
+ JSValue *_miterLimit;
+ JSValue *_shadowOffsetX;
+ JSValue *_shadowOffsetY;
+ JSValue *_shadowBlur;
+ JSValue *_shadowColor;
+ JSValue *_globalAlpha;
+ JSValue *_globalComposite;
};
// FIXME: Macintosh specific, and should be abstracted by KWQ in QPainter.
- CGColorRef colorRefFromValue(ExecState *exec, ValueImp *value);
+ CGColorRef colorRefFromValue(ExecState *exec, JSValue *value);
- QColor colorFromValue(ExecState *exec, ValueImp *value);
+ QColor colorFromValue(ExecState *exec, JSValue *value);
struct ColorStop {
float stop;
@@ -479,9 +479,9 @@
Gradient(float x0, float y0, float r0, float x1, float y1, float r1);
~Gradient();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -525,9 +525,9 @@
public:
ImagePattern(Image *i, int type);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -548,8 +548,8 @@
CGRect _bounds;
};
- ValueImp *getHTMLCollection(ExecState *exec, DOM::HTMLCollectionImpl *c);
- ValueImp *getSelectHTMLCollection(ExecState *exec, DOM::HTMLCollectionImpl *c, DOM::HTMLSelectElementImpl *e);
+ JSValue *getHTMLCollection(ExecState *exec, DOM::HTMLCollectionImpl *c);
+ JSValue *getSelectHTMLCollection(ExecState *exec, DOM::HTMLCollectionImpl *c, DOM::HTMLSelectElementImpl *e);
} // namespace
1.39 +27 -27 WebCore/khtml/ecma/kjs_navigator.cpp
Index: kjs_navigator.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_navigator.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- kjs_navigator.cpp 11 Dec 2005 00:38:02 -0000 1.38
+++ kjs_navigator.cpp 11 Dec 2005 02:06:06 -0000 1.39
@@ -38,7 +38,7 @@
namespace KJS {
- class PluginBase : public ObjectImp {
+ class PluginBase : public JSObject {
public:
PluginBase(ExecState *exec);
virtual ~PluginBase();
@@ -74,39 +74,39 @@
public:
Plugins(ExecState *exec) : PluginBase(exec) {};
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Length, Refresh };
private:
- static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
- static ValueImp *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
};
class MimeTypes : public PluginBase {
public:
MimeTypes(ExecState *exec) : PluginBase(exec) { };
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Length };
private:
- static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
- static ValueImp *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
};
class Plugin : public PluginBase {
public:
Plugin(ExecState *exec, PluginInfo *info) : PluginBase(exec), m_info(info) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Name, Filename, Description, Length };
private:
- static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
- static ValueImp *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
PluginInfo *m_info;
};
@@ -115,7 +115,7 @@
public:
MimeType( ExecState *exec, MimeClassInfo *info ) : PluginBase(exec), m_info(info) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Type, Suffixes, Description, EnabledPlugin };
@@ -159,14 +159,14 @@
IMPLEMENT_PROTOFUNC(NavigatorFunc)
Navigator::Navigator(ExecState *exec, KHTMLPart *p)
- : ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype()), m_part(p) { }
+ : JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()), m_part(p) { }
bool Navigator::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
- return getStaticPropertySlot<NavigatorFunc, Navigator, ObjectImp>(exec, &NavigatorTable, this, propertyName, slot);
+ return getStaticPropertySlot<NavigatorFunc, Navigator, JSObject>(exec, &NavigatorTable, this, propertyName, slot);
}
-ValueImp *Navigator::getValueProperty(ExecState *exec, int token) const
+JSValue *Navigator::getValueProperty(ExecState *exec, int token) const
{
QString userAgent = KWQ(m_part)->userAgent();
switch (token) {
@@ -232,7 +232,7 @@
/*******************************************************************/
PluginBase::PluginBase(ExecState *exec)
- : ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype() )
+ : JSObject(exec->lexicalInterpreter()->builtinObjectPrototype() )
{
if ( !plugins ) {
plugins = new QPtrList<PluginInfo>;
@@ -331,18 +331,18 @@
*/
IMPLEMENT_PROTOFUNC(PluginsFunc)
-ValueImp *Plugins::getValueProperty(ExecState *exec, int token) const
+JSValue *Plugins::getValueProperty(ExecState *exec, int token) const
{
assert(token == Length);
return jsNumber(plugins->count());
}
-ValueImp *Plugins::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *Plugins::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
return new Plugin(exec, plugins->at(slot.index()));
}
-ValueImp *Plugins::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *Plugins::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
for (PluginInfo *pl = plugins->first(); pl; pl = plugins->next()) {
if (pl->name == propertyName.qstring()) {
@@ -390,18 +390,18 @@
@end
*/
-ValueImp *MimeTypes::getValueProperty(ExecState *exec, int token) const
+JSValue *MimeTypes::getValueProperty(ExecState *exec, int token) const
{
assert(token == Length);
return jsNumber(plugins->count());
}
-ValueImp *MimeTypes::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *MimeTypes::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
return new MimeType(exec, mimes->at(slot.index()));
}
-ValueImp *MimeTypes::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *MimeTypes::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
for (MimeClassInfo *m = mimes->first(); m; m = mimes->next()) {
if (m->type == propertyName.qstring())
@@ -449,7 +449,7 @@
@end
*/
-ValueImp *Plugin::getValueProperty(ExecState *exec, int token) const
+JSValue *Plugin::getValueProperty(ExecState *exec, int token) const
{
switch (token) {
case Name:
@@ -466,13 +466,13 @@
}
}
-ValueImp *Plugin::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *Plugin::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
Plugin *thisObj = static_cast<Plugin *>(slot.slotBase());
return new MimeType(exec, thisObj->m_info->mimes.at(slot.index()));
}
-ValueImp *Plugin::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *Plugin::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
Plugin *thisObj = static_cast<Plugin *>(slot.slotBase());
for (MimeClassInfo *m = thisObj->m_info->mimes.first(); m; m = thisObj->m_info->mimes.next()) {
@@ -521,7 +521,7 @@
@end
*/
-ValueImp *MimeType::getValueProperty(ExecState *exec, int token) const
+JSValue *MimeType::getValueProperty(ExecState *exec, int token) const
{
switch (token) {
case Type:
@@ -542,13 +542,13 @@
return getStaticValueSlot<MimeType, PluginBase>(exec, &MimeTypeTable, this, propertyName, slot);
}
-ValueImp *PluginsFunc::callAsFunction(ExecState *exec, ObjectImp *, const List &args)
+JSValue *PluginsFunc::callAsFunction(ExecState *exec, JSObject *, const List &args)
{
PluginBase(exec).refresh(args[0]->toBoolean(exec));
return jsUndefined();
}
-ValueImp *NavigatorFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &)
+JSValue *NavigatorFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &)
{
if (!thisObj->inherits(&KJS::Navigator::info))
return throwError(exec, TypeError);
1.9 +2 -2 WebCore/khtml/ecma/kjs_navigator.h
Index: kjs_navigator.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_navigator.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- kjs_navigator.h 8 Aug 2005 04:07:41 -0000 1.8
+++ kjs_navigator.h 11 Dec 2005 02:06:06 -0000 1.9
@@ -27,11 +27,11 @@
namespace KJS {
- class Navigator : public ObjectImp {
+ class Navigator : public JSObject {
public:
Navigator(ExecState *exec, KHTMLPart *p);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { AppCodeName, AppName, AppVersion, Language, UserAgent, Platform,
1.28 +6 -6 WebCore/khtml/ecma/kjs_proxy.cpp
Index: kjs_proxy.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_proxy.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- kjs_proxy.cpp 11 Dec 2005 00:38:02 -0000 1.27
+++ kjs_proxy.cpp 11 Dec 2005 02:06:06 -0000 1.28
@@ -114,7 +114,7 @@
JSLock lock;
- KJS::ValueImp *thisNode = n ? Window::retrieve(m_part) : getDOMNode(m_script->globalExec(), n);
+ KJS::JSValue *thisNode = n ? Window::retrieve(m_part) : getDOMNode(m_script->globalExec(), n);
UString code(str);
Completion comp = m_script->evaluate(filename, baseLine, code, thisNode);
@@ -236,14 +236,14 @@
}
// Implementation of the debug() function
-class TestFunctionImp : public ObjectImp {
+class TestFunctionImp : public JSObject {
public:
- TestFunctionImp() : ObjectImp() {}
+ TestFunctionImp() : JSObject() {}
virtual bool implementsCall() const { return true; }
- virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+ virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
-ValueImp *TestFunctionImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
+JSValue *TestFunctionImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
{
fprintf(stderr,"--> %s\n",args[0]->toString(exec).ascii());
return jsUndefined();
@@ -256,7 +256,7 @@
// Build the global object - which is a Window instance
KJS::JSLock lock;
- ObjectImp *globalObject( new Window(m_part) );
+ JSObject *globalObject( new Window(m_part) );
// Create a KJS interpreter for this part
m_script = new KJS::ScriptInterpreter(globalObject, m_part);
1.19 +7 -7 WebCore/khtml/ecma/kjs_range.cpp
Index: kjs_range.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_range.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- kjs_range.cpp 11 Dec 2005 00:38:02 -0000 1.18
+++ kjs_range.cpp 11 Dec 2005 02:06:07 -0000 1.19
@@ -89,7 +89,7 @@
return getStaticValueSlot<DOMRange, DOMObject>(exec, &DOMRangeTable, this, propertyName, slot);
}
-ValueImp *DOMRange::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMRange::getValueProperty(ExecState *exec, int token) const
{
DOMExceptionTranslator exception(exec);
RangeImpl &range = *m_impl;
@@ -112,12 +112,12 @@
}
}
-ValueImp *DOMRangeProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMRangeProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMRange::info))
return throwError(exec, TypeError);
RangeImpl &range = *static_cast<DOMRange *>(thisObj)->impl();
- ValueImp *result = jsUndefined();
+ JSValue *result = jsUndefined();
int exception = 0;
switch (id) {
@@ -184,7 +184,7 @@
return result;
}
-ValueImp *getDOMRange(ExecState *exec, RangeImpl *r)
+JSValue *getDOMRange(ExecState *exec, RangeImpl *r)
{
return cacheDOMObject<RangeImpl, DOMRange>(exec, r);
}
@@ -205,18 +205,18 @@
return getStaticValueSlot<RangeConstructor,DOMObject>(exec, &RangeConstructorTable, this, propertyName, slot);
}
-ValueImp *RangeConstructor::getValueProperty(ExecState *, int token) const
+JSValue *RangeConstructor::getValueProperty(ExecState *, int token) const
{
return jsNumber(token);
}
-ValueImp *getRangeConstructor(ExecState *exec)
+JSValue *getRangeConstructor(ExecState *exec)
{
return cacheGlobalObject<RangeConstructor>(exec, "[[range.constructor]]");
}
-RangeImpl *toRange(ValueImp *val)
+RangeImpl *toRange(JSValue *val)
{
if (!val || !val->isObject(&DOMRange::info))
return 0;
1.12 +5 -5 WebCore/khtml/ecma/kjs_range.h
Index: kjs_range.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_range.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- kjs_range.h 1 Dec 2005 10:32:10 -0000 1.11
+++ kjs_range.h 11 Dec 2005 02:06:07 -0000 1.12
@@ -34,7 +34,7 @@
DOMRange(ExecState *exec, DOM::RangeImpl *r);
~DOMRange();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -55,16 +55,16 @@
public:
RangeConstructor(ExecState *) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *, int token) const;
+ JSValue *getValueProperty(ExecState *, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
- ValueImp *getDOMRange(ExecState *exec, DOM::RangeImpl *r);
- ValueImp *getRangeConstructor(ExecState *exec);
+ JSValue *getDOMRange(ExecState *exec, DOM::RangeImpl *r);
+ JSValue *getRangeConstructor(ExecState *exec);
- DOM::RangeImpl *toRange(ValueImp *); // returns 0 if the value is not a DOMRange object
+ DOM::RangeImpl *toRange(JSValue *); // returns 0 if the value is not a DOMRange object
} // namespace
1.24 +16 -16 WebCore/khtml/ecma/kjs_traversal.cpp
Index: kjs_traversal.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_traversal.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- kjs_traversal.cpp 11 Dec 2005 00:38:02 -0000 1.23
+++ kjs_traversal.cpp 11 Dec 2005 02:06:07 -0000 1.24
@@ -73,7 +73,7 @@
return getStaticValueSlot<DOMNodeIterator, DOMObject>(exec, &DOMNodeIteratorTable, this, propertyName, slot);
}
-ValueImp *DOMNodeIterator::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMNodeIterator::getValueProperty(ExecState *exec, int token) const
{
NodeIteratorImpl &ni = *m_impl;
switch (token) {
@@ -95,7 +95,7 @@
}
}
-ValueImp *DOMNodeIteratorProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &)
+JSValue *DOMNodeIteratorProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &)
{
if (!thisObj->inherits(&KJS::DOMNodeIterator::info))
return throwError(exec, TypeError);
@@ -113,7 +113,7 @@
return jsUndefined();
}
-ValueImp *getDOMNodeIterator(ExecState *exec, NodeIteratorImpl *ni)
+JSValue *getDOMNodeIterator(ExecState *exec, NodeIteratorImpl *ni)
{
return cacheDOMObject<NodeIteratorImpl, DOMNodeIterator>(exec, ni);
}
@@ -147,13 +147,13 @@
return getStaticValueSlot<NodeFilterConstructor, DOMObject>(exec, &NodeFilterConstructorTable, this, propertyName, slot);
}
-ValueImp *NodeFilterConstructor::getValueProperty(ExecState *, int token) const
+JSValue *NodeFilterConstructor::getValueProperty(ExecState *, int token) const
{
// We use the token as the value to return directly
return jsNumber(token);
}
-ValueImp *getNodeFilterConstructor(ExecState *exec)
+JSValue *getNodeFilterConstructor(ExecState *exec)
{
return cacheGlobalObject<NodeFilterConstructor>(exec, "[[nodeFilter.constructor]]");
}
@@ -181,7 +181,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMNodeFilterProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMNodeFilterProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMNodeFilter::info))
return throwError(exec, TypeError);
@@ -193,12 +193,12 @@
return jsUndefined();
}
-ValueImp *getDOMNodeFilter(ExecState *exec, NodeFilterImpl *nf)
+JSValue *getDOMNodeFilter(ExecState *exec, NodeFilterImpl *nf)
{
return cacheDOMObject<NodeFilterImpl, DOMNodeFilter>(exec, nf);
}
-NodeFilterImpl *toNodeFilter(ValueImp *val)
+NodeFilterImpl *toNodeFilter(JSValue *val)
{
if (!val || !val->isObject(&DOMNodeFilter::info))
return 0;
@@ -246,7 +246,7 @@
return getStaticValueSlot<DOMTreeWalker, DOMObject>(exec, &DOMTreeWalkerTable, this, propertyName, slot);
}
-ValueImp *DOMTreeWalker::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMTreeWalker::getValueProperty(ExecState *exec, int token) const
{
TreeWalkerImpl &tw = *m_impl;
switch (token) {
@@ -267,17 +267,17 @@
}
void DOMTreeWalker::put(ExecState *exec, const Identifier &propertyName,
- ValueImp *value, int attr)
+ JSValue *value, int attr)
{
if (propertyName == "currentNode") {
DOMExceptionTranslator exception(exec);
m_impl->setCurrentNode(toNode(value), exception);
}
else
- ObjectImp::put(exec, propertyName, value, attr);
+ JSObject::put(exec, propertyName, value, attr);
}
-ValueImp *DOMTreeWalkerProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &)
+JSValue *DOMTreeWalkerProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &)
{
if (!thisObj->inherits(&KJS::DOMTreeWalker::info))
return throwError(exec, TypeError);
@@ -301,14 +301,14 @@
return jsUndefined();
}
-ValueImp *getDOMTreeWalker(ExecState *exec, TreeWalkerImpl *tw)
+JSValue *getDOMTreeWalker(ExecState *exec, TreeWalkerImpl *tw)
{
return cacheDOMObject<TreeWalkerImpl, DOMTreeWalker>(exec, tw);
}
// -------------------------------------------------------------------------
-JSNodeFilterCondition::JSNodeFilterCondition(ObjectImp * _filter) : filter( _filter )
+JSNodeFilterCondition::JSNodeFilterCondition(JSObject * _filter) : filter( _filter )
{
}
@@ -322,8 +322,8 @@
ExecState *exec = proxy->interpreter()->globalExec();
List args;
args.append(getDOMNode(exec, node));
- ObjectImp *obj = filter;
- ValueImp *result = obj->call(exec, obj, args);
+ JSObject *obj = filter;
+ JSValue *result = obj->call(exec, obj, args);
return result->toInt32(exec);
}
1.15 +11 -11 WebCore/khtml/ecma/kjs_traversal.h
Index: kjs_traversal.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_traversal.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- kjs_traversal.h 4 Dec 2005 12:43:13 -0000 1.14
+++ kjs_traversal.h 11 Dec 2005 02:06:07 -0000 1.15
@@ -38,7 +38,7 @@
DOMNodeIterator(ExecState *exec, DOM::NodeIteratorImpl *ni);
~DOMNodeIterator();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -54,7 +54,7 @@
public:
NodeFilterConstructor(ExecState *) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot& slot);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -78,8 +78,8 @@
DOMTreeWalker(ExecState *exec, DOM::TreeWalkerImpl *tw);
~DOMTreeWalker();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot& slot);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Root, WhatToShow, Filter, ExpandEntityReferences, CurrentNode,
@@ -90,20 +90,20 @@
RefPtr<DOM::TreeWalkerImpl> m_impl;
};
- ValueImp *getDOMNodeIterator(ExecState *exec, DOM::NodeIteratorImpl *ni);
- ValueImp *getNodeFilterConstructor(ExecState *exec);
- ValueImp *getDOMNodeFilter(ExecState *exec, DOM::NodeFilterImpl *nf);
- ValueImp *getDOMTreeWalker(ExecState *exec, DOM::TreeWalkerImpl *tw);
+ JSValue *getDOMNodeIterator(ExecState *exec, DOM::NodeIteratorImpl *ni);
+ JSValue *getNodeFilterConstructor(ExecState *exec);
+ JSValue *getDOMNodeFilter(ExecState *exec, DOM::NodeFilterImpl *nf);
+ JSValue *getDOMTreeWalker(ExecState *exec, DOM::TreeWalkerImpl *tw);
- DOM::NodeFilterImpl *toNodeFilter(const ValueImp *); // returns 0 if value is not a DOMNodeFilter
+ DOM::NodeFilterImpl *toNodeFilter(const JSValue *); // returns 0 if value is not a DOMNodeFilter
class JSNodeFilterCondition : public DOM::NodeFilterCondition {
public:
- JSNodeFilterCondition(ObjectImp * _filter);
+ JSNodeFilterCondition(JSObject * _filter);
virtual ~JSNodeFilterCondition() {}
virtual short acceptNode(DOM::NodeImpl*) const;
protected:
- ProtectedPtr<ObjectImp> filter;
+ ProtectedPtr<JSObject> filter;
};
} // namespace
1.20 +4 -4 WebCore/khtml/ecma/kjs_views.cpp
Index: kjs_views.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_views.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- kjs_views.cpp 11 Dec 2005 00:38:02 -0000 1.19
+++ kjs_views.cpp 11 Dec 2005 02:06:07 -0000 1.20
@@ -66,7 +66,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-ValueImp *DOMAbstractView::getValueProperty(ExecState *exec, int token)
+JSValue *DOMAbstractView::getValueProperty(ExecState *exec, int token)
{
assert(token == Document);
return getDOMNode(exec, impl()->document());
@@ -77,7 +77,7 @@
return getStaticValueSlot<DOMAbstractView, DOMObject>(exec, &DOMAbstractViewTable, this, propertyName, slot);
}
-ValueImp *DOMAbstractViewProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *DOMAbstractViewProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&DOMAbstractView::info))
return throwError(exec, TypeError);
@@ -107,12 +107,12 @@
return jsUndefined();
}
-ValueImp *getDOMAbstractView(ExecState *exec, AbstractViewImpl *av)
+JSValue *getDOMAbstractView(ExecState *exec, AbstractViewImpl *av)
{
return cacheDOMObject<AbstractViewImpl, DOMAbstractView>(exec, av);
}
-AbstractViewImpl *toAbstractView(ValueImp *val)
+AbstractViewImpl *toAbstractView(JSValue *val)
{
if (!val || !val->isObject(&DOMAbstractView::info))
return 0;
1.15 +3 -3 WebCore/khtml/ecma/kjs_views.h
Index: kjs_views.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_views.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- kjs_views.h 7 Dec 2005 01:12:37 -0000 1.14
+++ kjs_views.h 11 Dec 2005 02:06:07 -0000 1.15
@@ -34,7 +34,7 @@
DOMAbstractView(ExecState *, DOM::AbstractViewImpl *av);
~DOMAbstractView();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token);
+ JSValue *getValueProperty(ExecState *exec, int token);
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -44,9 +44,9 @@
RefPtr<DOM::AbstractViewImpl> m_impl;
};
- ValueImp *getDOMAbstractView(ExecState *exec, DOM::AbstractViewImpl *av);
+ JSValue *getDOMAbstractView(ExecState *exec, DOM::AbstractViewImpl *av);
- DOM::AbstractViewImpl *toAbstractView(ValueImp *);
+ DOM::AbstractViewImpl *toAbstractView(JSValue *);
} // namespace
1.196 +71 -71 WebCore/khtml/ecma/kjs_window.cpp
Index: kjs_window.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_window.cpp,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -r1.195 -r1.196
--- kjs_window.cpp 11 Dec 2005 00:38:02 -0000 1.195
+++ kjs_window.cpp 11 Dec 2005 02:06:07 -0000 1.196
@@ -99,13 +99,13 @@
////////////////////// History Object ////////////////////////
- class History : public ObjectImp {
+ class History : public JSObject {
friend class HistoryFunc;
public:
History(ExecState *exec, KHTMLPart *p)
- : ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype()), part(p) { }
+ : JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()), part(p) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Back, Forward, Go, Length };
@@ -114,17 +114,17 @@
QGuardedPtr<KHTMLPart> part;
};
- class FrameArray : public ObjectImp {
+ class FrameArray : public JSObject {
public:
FrameArray(ExecState *exec, KHTMLPart *p)
- : ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype()), part(p) { }
+ : JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()), part(p) { }
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token);
+ JSValue *getValueProperty(ExecState *exec, int token);
virtual UString toString(ExecState *exec) const;
enum { Length, Location };
private:
- static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
- static ValueImp *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
+ static JSValue *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -158,14 +158,14 @@
// We set the object prototype so that toString is implemented
Screen::Screen(ExecState *exec)
- : ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype()) {}
+ : JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()) {}
bool Screen::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
- return getStaticValueSlot<Screen, ObjectImp>(exec, &ScreenTable, this, propertyName, slot);
+ return getStaticValueSlot<Screen, JSObject>(exec, &ScreenTable, this, propertyName, slot);
}
-ValueImp *Screen::getValueProperty(ExecState *exec, int token) const
+JSValue *Screen::getValueProperty(ExecState *exec, int token) const
{
KWinModule info;
QWidget *thisWidget = Window::retrieveActive(exec)->part()->view();
@@ -318,7 +318,7 @@
IMPLEMENT_PROTOFUNC(WindowFunc)
Window::Window(KHTMLPart *p)
- : ObjectImp(/*no proto*/)
+ : JSObject(/*no proto*/)
, m_part(p)
, screen(0)
, history(0)
@@ -363,7 +363,7 @@
Window *Window::retrieveWindow(KHTMLPart *p)
{
- ObjectImp *obj = retrieve(p)->getObject();
+ JSObject *obj = retrieve(p)->getObject();
#ifndef NDEBUG
// obj should never be null, except when javascript has been disabled in that part.
if ( p && p->jScriptEnabled() )
@@ -381,7 +381,7 @@
Window *Window::retrieveActive(ExecState *exec)
{
- ValueImp *imp = exec->dynamicInterpreter()->globalObject();
+ JSValue *imp = exec->dynamicInterpreter()->globalObject();
assert( imp );
#ifndef QWS
//assert( dynamic_cast<Window*>(imp) );
@@ -389,7 +389,7 @@
return static_cast<Window*>(imp);
}
-ValueImp *Window::retrieve(KHTMLPart *p)
+JSValue *Window::retrieve(KHTMLPart *p)
{
assert(p);
KJSProxy *proxy = KJSProxy::proxy( p );
@@ -461,7 +461,7 @@
// reference our special objects during garbage collection
void Window::mark()
{
- ObjectImp::mark();
+ JSObject::mark();
if (screen && !screen->marked())
screen->mark();
if (history && !history->marked())
@@ -499,7 +499,7 @@
|| static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture());
}
-static QMap<QString, QString> parseFeatures(ExecState *exec, ValueImp *featuresArg)
+static QMap<QString, QString> parseFeatures(ExecState *exec, JSValue *featuresArg)
{
QMap<QString, QString> map;
@@ -559,7 +559,7 @@
}
static KHTMLPart *createNewWindow(ExecState *exec, Window *openerWindow, const QString &URL,
- const QString &frameName, const WindowArgs &windowArgs, ValueImp *dialogArgs)
+ const QString &frameName, const WindowArgs &windowArgs, JSValue *dialogArgs)
{
KHTMLPart *openerPart = openerWindow->part();
KHTMLPart *activePart = Window::retrieveActive(exec)->part();
@@ -616,7 +616,7 @@
return part && static_cast<KHTMLPartBrowserExtension *>(part->browserExtension())->canRunModalNow();
}
-static ValueImp *showModalDialog(ExecState *exec, Window *openerWindow, const List &args)
+static JSValue *showModalDialog(ExecState *exec, Window *openerWindow, const List &args)
{
UString URL = args[0]->toString(exec);
@@ -671,14 +671,14 @@
return jsUndefined();
Window *dialogWindow = Window::retrieveWindow(dialogPart);
- ValueImp *returnValue = jsUndefined();
+ JSValue *returnValue = jsUndefined();
dialogWindow->setReturnValueSlot(&returnValue);
static_cast<KHTMLPartBrowserExtension *>(dialogPart->browserExtension())->runModal();
dialogWindow->setReturnValueSlot(NULL);
return returnValue;
}
-ValueImp *Window::getValueProperty(ExecState *exec, int token) const
+JSValue *Window::getValueProperty(ExecState *exec, int token) const
{
assert(token == Closed || m_part);
@@ -921,19 +921,19 @@
return jsUndefined();
}
-ValueImp *Window::childFrameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *Window::childFrameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
Window *thisObj = static_cast<Window *>(slot.slotBase());
return retrieve(thisObj->m_part->childFrameNamed(propertyName.qstring()));
}
-ValueImp *Window::namedFrameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *Window::namedFrameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
Window *thisObj = static_cast<Window *>(slot.slotBase());
return retrieve(thisObj->m_part->findFrame(propertyName.qstring()));
}
-ValueImp *Window::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *Window::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
Window *thisObj = static_cast<Window *>(slot.slotBase());
@@ -944,7 +944,7 @@
return retrieve(static_cast<KHTMLPart*>(frame));
}
-ValueImp *Window::namedItemGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *Window::namedItemGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
Window *thisObj = static_cast<Window *>(slot.slotBase());
DocumentImpl *doc = thisObj->m_part->xmlDocImpl();
@@ -977,7 +977,7 @@
}
// Look for overrides first
- ValueImp **val = getDirectLocation(propertyName);
+ JSValue **val = getDirectLocation(propertyName);
if (val) {
if (isSafeScript(exec))
slot.setValueSlot(this, val);
@@ -1057,18 +1057,18 @@
return true;
}
- return ObjectImp::getOwnPropertySlot(exec, propertyName, slot);
+ return JSObject::getOwnPropertySlot(exec, propertyName, slot);
}
-void Window::put(ExecState* exec, const Identifier &propertyName, ValueImp *value, int attr)
+void Window::put(ExecState* exec, const Identifier &propertyName, JSValue *value, int attr)
{
// Called by an internal KJS call (e.g. InterpreterImp's constructor) ?
- // If yes, save time and jump directly to ObjectImp.
+ // If yes, save time and jump directly to JSObject.
if ( (attr != None && attr != DontDelete)
// Same thing if we have a local override (e.g. "var location")
- || ( ObjectImp::getDirect(propertyName) && isSafeScript(exec)) )
+ || ( JSObject::getDirect(propertyName) && isSafeScript(exec)) )
{
- ObjectImp::put( exec, propertyName, value, attr );
+ JSObject::put( exec, propertyName, value, attr );
return;
}
@@ -1212,7 +1212,7 @@
}
}
if (isSafeScript(exec)) {
- ObjectImp::put(exec, propertyName, value, attr);
+ JSObject::put(exec, propertyName, value, attr);
}
}
@@ -1356,7 +1356,7 @@
return false;
}
-void Window::setListener(ExecState *exec, const AtomicString &eventType, ValueImp *func)
+void Window::setListener(ExecState *exec, const AtomicString &eventType, JSValue *func)
{
if (!isSafeScript(exec))
return;
@@ -1367,7 +1367,7 @@
doc->setHTMLWindowEventListener(eventType, getJSEventListener(func,true));
}
-ValueImp *Window::getListener(ExecState *exec, const AtomicString &eventType) const
+JSValue *Window::getListener(ExecState *exec, const AtomicString &eventType) const
{
if (!isSafeScript(exec))
return jsUndefined();
@@ -1382,11 +1382,11 @@
return jsNull();
}
-JSEventListener *Window::getJSEventListener(ValueImp *val, bool html)
+JSEventListener *Window::getJSEventListener(JSValue *val, bool html)
{
if (!val->isObject())
return 0;
- ObjectImp *listenerObject = static_cast<ObjectImp *>(val);
+ JSObject *listenerObject = static_cast<JSObject *>(val);
JSEventListener *existingListener = jsEventListeners[listenerObject];
if (existingListener)
@@ -1396,11 +1396,11 @@
return new JSEventListener(listenerObject, this, html);
}
-JSUnprotectedEventListener *Window::getJSUnprotectedEventListener(ValueImp *val, bool html)
+JSUnprotectedEventListener *Window::getJSUnprotectedEventListener(JSValue *val, bool html)
{
if (!val->isObject())
return 0;
- ObjectImp *listenerObject = static_cast<ObjectImp *>(val);
+ JSObject *listenerObject = static_cast<JSObject *>(val);
JSUnprotectedEventListener *existingListener = jsUnprotectedEventListeners[listenerObject];
if (existingListener)
@@ -1420,7 +1420,7 @@
{
JSLock lock;
if (m_returnValueSlot)
- if (ValueImp *returnValue = getDirect("returnValue"))
+ if (JSValue *returnValue = getDirect("returnValue"))
*m_returnValueSlot = returnValue;
kdDebug(6070) << "Window::clear " << this << endl;
delete winq;
@@ -1441,7 +1441,7 @@
//kdDebug(6070) << "Window " << this << " (part=" << m_part << ")::setCurrentEvent m_evt=" << evt << endl;
}
-ValueImp *WindowFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&Window::info))
return throwError(exec, TypeError);
@@ -1453,7 +1453,7 @@
return jsUndefined();
KHTMLView *widget = part->view();
- ValueImp *v = args[0];
+ JSValue *v = args[0];
UString s = v->toString(exec);
str = s.qstring();
@@ -1759,8 +1759,8 @@
int r = (const_cast<Window*>(window))->installTimeout(s, i, true /*single shot*/);
return jsNumber(r);
}
- else if (args.size() >= 2 && v->isObject() && static_cast<ObjectImp *>(v)->implementsCall()) {
- ValueImp *func = args[0];
+ else if (args.size() >= 2 && v->isObject() && static_cast<JSObject *>(v)->implementsCall()) {
+ JSValue *func = args[0];
int i = args[1]->toInt32(exec);
// All arguments after the second should go to the function
@@ -1780,8 +1780,8 @@
int r = (const_cast<Window*>(window))->installTimeout(s, i, false);
return jsNumber(r);
}
- else if (args.size() >= 2 && v->isObject() && static_cast<ObjectImp *>(v)->implementsCall()) {
- ValueImp *func = args[0];
+ else if (args.size() >= 2 && v->isObject() && static_cast<JSObject *>(v)->implementsCall()) {
+ JSValue *func = args[0];
int i = args[1]->toInt32(exec);
// All arguments after the second should go to the function
@@ -1882,14 +1882,14 @@
interpreter->setProcessingTimerCallback(true);
- if (ValueImp* func = m_func.get()) {
- if (func->isObject() && static_cast<ObjectImp *>(func)->implementsCall()) {
+ if (JSValue* func = m_func.get()) {
+ if (func->isObject() && static_cast<JSObject *>(func)->implementsCall()) {
ExecState *exec = interpreter->globalExec();
assert(window == interpreter->globalObject());
JSLock lock;
- static_cast<ObjectImp *>(func)->call(exec, window, m_args);
+ static_cast<JSObject *>(func)->call(exec, window, m_args);
if (exec->hadException()) {
- ObjectImp* exception = exec->exception()->toObject(exec);
+ JSObject* exception = exec->exception()->toObject(exec);
exec->clearException();
QString message = exception->get(exec, messagePropertyName)->toString(exec).qstring();
int lineNumber = exception->get(exec, "line")->toInt32(exec);
@@ -1934,7 +1934,7 @@
return id;
}
-int WindowQObject::installTimeout(ValueImp *func, const List& args, int t, bool singleShot)
+int WindowQObject::installTimeout(JSValue *func, const List& args, int t, bool singleShot)
{
int id = startTimer(t);
m_timeouts.insert(id, new ScheduledAction(func, args, singleShot));
@@ -2016,7 +2016,7 @@
@end
*/
-ValueImp *FrameArray::getValueProperty(ExecState *exec, int token)
+JSValue *FrameArray::getValueProperty(ExecState *exec, int token)
{
switch (token) {
case Length: {
@@ -2026,7 +2026,7 @@
}
case Location:
// non-standard property, but works in NS and IE
- if (ObjectImp *obj = Window::retrieveWindow(part))
+ if (JSObject *obj = Window::retrieveWindow(part))
return obj->get(exec, "location");
return jsUndefined();
default:
@@ -2035,7 +2035,7 @@
}
}
-ValueImp *FrameArray::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *FrameArray::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
FrameArray *thisObj = static_cast<FrameArray *>(slot.slotBase());
KParts::ReadOnlyPart *frame = thisObj->part->frames().at(slot.index());
@@ -2048,7 +2048,7 @@
return jsUndefined();
}
-ValueImp *FrameArray::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue *FrameArray::nameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
{
FrameArray *thisObj = static_cast<FrameArray *>(slot.slotBase());
KParts::ReadOnlyPart *frame = thisObj->part->findFrame(propertyName.qstring());
@@ -2088,7 +2088,7 @@
return true;
}
- return ObjectImp::getOwnPropertySlot(exec, propertyName, slot);
+ return JSObject::getOwnPropertySlot(exec, propertyName, slot);
}
UString FrameArray::toString(ExecState *) const
@@ -2121,7 +2121,7 @@
{
}
-ValueImp *Location::getValueProperty(ExecState *exec, int token) const
+JSValue *Location::getValueProperty(ExecState *exec, int token) const
{
KURL url = m_part->url();
switch (token) {
@@ -2168,10 +2168,10 @@
return true;
}
- return getStaticPropertySlot<LocationFunc, Location, ObjectImp>(exec, &LocationTable, this, propertyName, slot);
+ return getStaticPropertySlot<LocationFunc, Location, JSObject>(exec, &LocationTable, this, propertyName, slot);
}
-void Location::put(ExecState *exec, const Identifier &p, ValueImp *v, int attr)
+void Location::put(ExecState *exec, const Identifier &p, JSValue *v, int attr)
{
if (m_part.isNull())
return;
@@ -2216,7 +2216,7 @@
break;
}
else {
- ObjectImp::put(exec, p, v, attr);
+ JSObject::put(exec, p, v, attr);
return;
}
@@ -2229,7 +2229,7 @@
}
}
-ValueImp *Location::toPrimitive(ExecState *exec, Type) const
+JSValue *Location::toPrimitive(ExecState *exec, Type) const
{
return jsString(toString(exec));
}
@@ -2242,7 +2242,7 @@
return m_part->url().prettyURL();
}
-ValueImp *LocationFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *LocationFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&Location::info))
return throwError(exec, TypeError);
@@ -2331,7 +2331,7 @@
{
}
-ValueImp *Selection::getValueProperty(ExecState *exec, int token) const
+JSValue *Selection::getValueProperty(ExecState *exec, int token) const
{
const Window* window = Window::retrieveWindow(m_part);
if (!window) {
@@ -2378,10 +2378,10 @@
if (m_part.isNull())
return false;
- return getStaticPropertySlot<SelectionFunc, Selection, ObjectImp>(exec, &SelectionTable, this, propertyName, slot);
+ return getStaticPropertySlot<SelectionFunc, Selection, JSObject>(exec, &SelectionTable, this, propertyName, slot);
}
-ValueImp *Selection::toPrimitive(ExecState *exec, Type) const
+JSValue *Selection::toPrimitive(ExecState *exec, Type) const
{
return jsString(toString(exec));
}
@@ -2391,7 +2391,7 @@
return UString(m_part->selectedText());
}
-ValueImp *SelectionFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *SelectionFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&Selection::info))
return throwError(exec, TypeError);
@@ -2471,13 +2471,13 @@
@end
*/
BarInfo::BarInfo(ExecState *exec, KHTMLPart *p, Type barType)
- : ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype())
+ : JSObject(exec->lexicalInterpreter()->builtinObjectPrototype())
, m_part(p)
, m_type(barType)
{
}
-ValueImp *BarInfo::getValueProperty(ExecState *exec, int token) const
+JSValue *BarInfo::getValueProperty(ExecState *exec, int token) const
{
assert(token == Visible);
switch (m_type) {
@@ -2503,7 +2503,7 @@
if (m_part.isNull())
return false;
- return getStaticValueSlot<BarInfo, ObjectImp>(exec, &BarInfoTable, this, propertyName, slot);
+ return getStaticValueSlot<BarInfo, JSObject>(exec, &BarInfoTable, this, propertyName, slot);
}
////////////////////// History Object ////////////////////////
@@ -2521,10 +2521,10 @@
bool History::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
- return getStaticPropertySlot<HistoryFunc, History, ObjectImp>(exec, &HistoryTable, this, propertyName, slot);
+ return getStaticPropertySlot<HistoryFunc, History, JSObject>(exec, &HistoryTable, this, propertyName, slot);
}
-ValueImp *History::getValueProperty(ExecState *, int token) const
+JSValue *History::getValueProperty(ExecState *, int token) const
{
switch (token) {
case Length:
@@ -2555,7 +2555,7 @@
return "[object History]";
}
-ValueImp *HistoryFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *HistoryFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&History::info))
return throwError(exec, TypeError);
1.60 +29 -29 WebCore/khtml/ecma/kjs_window.h
Index: kjs_window.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_window.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- kjs_window.h 10 Dec 2005 17:14:36 -0000 1.59
+++ kjs_window.h 11 Dec 2005 02:06:08 -0000 1.60
@@ -77,7 +77,7 @@
~WindowQObject() { parentDestroyed(); }
int installTimeout(const UString &handler, int interval, bool singleShot);
- int installTimeout(ValueImp *function, const List &, int interval, bool singleShot);
+ int installTimeout(JSValue *function, const List &, int interval, bool singleShot);
void clearTimeout(int timerId, bool delAction = true);
PausedTimeouts *pauseTimeouts();
@@ -92,7 +92,7 @@
QMap<int, ScheduledAction *> m_timeouts;
};
- class Screen : public ObjectImp {
+ class Screen : public JSObject {
public:
Screen(ExecState *exec);
enum {
@@ -100,14 +100,14 @@
AvailWidth
};
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
private:
KHTMLView *view;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
- class Window : public ObjectImp {
+ class Window : public JSObject {
friend QGuardedPtr<KHTMLPart> getInstance();
friend class Location;
friend class WindowFunc;
@@ -122,7 +122,7 @@
* for the specified part p this will be returned in order to have unique
* bindings.
*/
- static ValueImp *retrieve(KHTMLPart *p);
+ static JSValue *retrieve(KHTMLPart *p);
/**
* Returns the Window object for a given HTML part
*/
@@ -135,12 +135,12 @@
QGuardedPtr<KHTMLPart> part() const { return m_part; }
virtual void mark();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
virtual bool toBoolean(ExecState *exec) const;
int installTimeout(const UString& handler, int t, bool singleShot) { return winq->installTimeout(handler, t, singleShot); }
- int installTimeout(ValueImp* function, List& args, int t, bool singleShot) { return winq->installTimeout(function, args, t, singleShot); }
+ int installTimeout(JSValue* function, List& args, int t, bool singleShot) { return winq->installTimeout(function, args, t, singleShot); }
void clearTimeout(int timerId) { winq->clearTimeout(timerId); }
PausedTimeouts* pauseTimeouts() { return winq->pauseTimeouts(); }
void resumeTimeouts(PausedTimeouts* t) { winq->resumeTimeouts(t); }
@@ -159,8 +159,8 @@
BarInfo *scrollbars(ExecState *exec) const;
BarInfo *statusbar(ExecState *exec) const;
BarInfo *toolbar(ExecState *exec) const;
- JSEventListener *getJSEventListener(ValueImp *val, bool html = false);
- JSUnprotectedEventListener *getJSUnprotectedEventListener(ValueImp *val, bool html = false);
+ JSEventListener *getJSEventListener(JSValue *val, bool html = false);
+ JSUnprotectedEventListener *getJSUnprotectedEventListener(JSValue *val, bool html = false);
JSLazyEventListener *getJSLazyEventListener(const QString &code, DOM::NodeImpl *node, int lineno = 0);
void clear( ExecState *exec );
virtual UString toString(ExecState *exec) const;
@@ -169,7 +169,7 @@
void setCurrentEvent(DOM::EventImpl *evt);
// Set a place to put a dialog return value when the window is cleared.
- void setReturnValueSlot(ValueImp **slot) { m_returnValueSlot = slot; }
+ void setReturnValueSlot(JSValue **slot) { m_returnValueSlot = slot; }
QPtrDict<JSEventListener> jsEventListeners;
QPtrDict<JSUnprotectedEventListener> jsUnprotectedEventListeners;
@@ -192,13 +192,13 @@
Onselect, Onsubmit, Onunload, Onbeforeunload,
Statusbar, Toolbar, FrameElement, ShowModalDialog };
protected:
- ValueImp *getListener(ExecState *exec, const DOM::AtomicString &eventType) const;
- void setListener(ExecState *exec, const DOM::AtomicString &eventType, ValueImp *func);
+ JSValue *getListener(ExecState *exec, const DOM::AtomicString &eventType) const;
+ void setListener(ExecState *exec, const DOM::AtomicString &eventType, JSValue *func);
private:
- static ValueImp *childFrameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *namedFrameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
- static ValueImp *namedItemGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *childFrameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *namedFrameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
+ static JSValue *namedItemGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
void updateLayout() const;
@@ -216,7 +216,7 @@
BarInfo *m_toolbar;
WindowQObject *winq;
DOM::EventImpl *m_evt;
- ValueImp **m_returnValueSlot;
+ JSValue **m_returnValueSlot;
};
/**
@@ -226,7 +226,7 @@
*/
class ScheduledAction {
public:
- ScheduledAction(ValueImp *func, const List& args, bool singleShot)
+ ScheduledAction(JSValue *func, const List& args, bool singleShot)
: m_func(func), m_args(args), m_singleShot(singleShot) { }
ScheduledAction(const QString& code, bool singleShot)
: m_code(code), m_singleShot(singleShot) { }
@@ -234,18 +234,18 @@
bool singleShot() const { return m_singleShot; }
private:
- ProtectedPtr<ValueImp> m_func;
+ ProtectedPtr<JSValue> m_func;
List m_args;
QString m_code;
bool m_singleShot;
};
- class Location : public ObjectImp {
+ class Location : public JSObject {
public:
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- virtual ValueImp *toPrimitive(ExecState *exec, Type preferred) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ virtual JSValue *toPrimitive(ExecState *exec, Type preferred) const;
virtual UString toString(ExecState *exec) const;
enum { Hash, Href, Hostname, Host, Pathname, Port, Protocol, Search, EqualEqual,
Replace, Reload, ToString, Assign };
@@ -258,11 +258,11 @@
QGuardedPtr<KHTMLPart> m_part;
};
- class Selection : public ObjectImp {
+ class Selection : public JSObject {
public:
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual ValueImp *toPrimitive(ExecState *exec, Type preferred) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual JSValue *toPrimitive(ExecState *exec, Type preferred) const;
virtual UString toString(ExecState *exec) const;
enum { AnchorNode, AnchorOffset, FocusNode, FocusOffset, BaseNode, BaseOffset, ExtentNode, ExtentOffset,
IsCollapsed, _Type, EqualEqual, Collapse, CollapseToEnd, CollapseToStart, Empty, ToString,
@@ -276,10 +276,10 @@
QGuardedPtr<KHTMLPart> m_part;
};
- class BarInfo : public ObjectImp {
+ class BarInfo : public JSObject {
public:
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
+ JSValue *getValueProperty(ExecState *exec, int token) const;
enum { Visible };
enum Type { Locationbar, Menubar, Personalbar, Scrollbars, Statusbar, Toolbar };
KHTMLPart *part() const { return m_part; }
1.51 +10 -10 WebCore/khtml/ecma/xmlhttprequest.cpp
Index: xmlhttprequest.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/xmlhttprequest.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- xmlhttprequest.cpp 11 Dec 2005 00:38:03 -0000 1.50
+++ xmlhttprequest.cpp 11 Dec 2005 02:06:08 -0000 1.51
@@ -102,7 +102,7 @@
return true;
}
-ObjectImp *XMLHttpRequestConstructorImp::construct(ExecState *exec, const List &)
+JSObject *XMLHttpRequestConstructorImp::construct(ExecState *exec, const List &)
{
return new XMLHttpRequest(exec, doc.get());
}
@@ -126,7 +126,7 @@
return getStaticValueSlot<XMLHttpRequest, DOMObject>(exec, &XMLHttpRequestTable, this, propertyName, slot);
}
-ValueImp *XMLHttpRequest::getValueProperty(ExecState *exec, int token) const
+JSValue *XMLHttpRequest::getValueProperty(ExecState *exec, int token) const
{
switch (token) {
case ReadyState:
@@ -141,7 +141,7 @@
QString mimeType;
if (MIMETypeOverride.isEmpty()) {
- ValueImp *header = getResponseHeader("Content-Type");
+ JSValue *header = getResponseHeader("Content-Type");
if (header->isUndefined()) {
mimeType = "text/xml";
} else {
@@ -191,12 +191,12 @@
}
}
-void XMLHttpRequest::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
+void XMLHttpRequest::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
{
lookupPut<XMLHttpRequest,DOMObject>(exec, propertyName, value, attr, &XMLHttpRequestTable, this );
}
-void XMLHttpRequest::putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/)
+void XMLHttpRequest::putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/)
{
switch(token) {
case Onreadystatechange:
@@ -407,7 +407,7 @@
requestHeaders += value;
}
-ValueImp *XMLHttpRequest::getAllResponseHeaders() const
+JSValue *XMLHttpRequest::getAllResponseHeaders() const
{
if (responseHeaders.isEmpty()) {
return jsUndefined();
@@ -422,7 +422,7 @@
return jsString(responseHeaders.mid(endOfLine + 1) + "\n");
}
-ValueImp *XMLHttpRequest::getResponseHeader(const QString& name) const
+JSValue *XMLHttpRequest::getResponseHeader(const QString& name) const
{
if (responseHeaders.isEmpty()) {
return jsUndefined();
@@ -450,7 +450,7 @@
return jsString(responseHeaders.mid(headerLinePos + matchLength, endOfLine - (headerLinePos + matchLength)).stripWhiteSpace());
}
-ValueImp *XMLHttpRequest::getStatus() const
+JSValue *XMLHttpRequest::getStatus() const
{
if (responseHeaders.isEmpty()) {
return jsUndefined();
@@ -476,7 +476,7 @@
return jsNumber(code);
}
-ValueImp *XMLHttpRequest::getStatusText() const
+JSValue *XMLHttpRequest::getStatusText() const
{
if (responseHeaders.isEmpty()) {
return jsUndefined();
@@ -624,7 +624,7 @@
QPtrDictIterator<XMLHttpRequest>(*requests).current()->abort();
}
-ValueImp *XMLHttpRequestProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *XMLHttpRequestProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&XMLHttpRequest::info))
return throwError(exec, TypeError);
1.23 +9 -9 WebCore/khtml/ecma/xmlhttprequest.h
Index: xmlhttprequest.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/xmlhttprequest.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- xmlhttprequest.h 1 Dec 2005 10:32:10 -0000 1.22
+++ xmlhttprequest.h 11 Dec 2005 02:06:08 -0000 1.23
@@ -51,12 +51,12 @@
Completed = 4
};
- class XMLHttpRequestConstructorImp : public ObjectImp {
+ class XMLHttpRequestConstructorImp : public JSObject {
public:
XMLHttpRequestConstructorImp(ExecState *exec, DOM::DocumentImpl *d);
~XMLHttpRequestConstructorImp();
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
private:
RefPtr<DOM::DocumentImpl> doc;
};
@@ -66,9 +66,9 @@
XMLHttpRequest(ExecState *, DOM::DocumentImpl *d);
~XMLHttpRequest();
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- ValueImp *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, ValueImp *value, int /*attr*/);
+ JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ void putValueProperty(ExecState *exec, int token, JSValue *value, int /*attr*/);
virtual bool toBoolean(ExecState *) const { return true; }
virtual void mark();
@@ -84,8 +84,8 @@
friend class XMLHttpRequestProtoFunc;
friend class XMLHttpRequestQObject;
- ValueImp *getStatusText() const;
- ValueImp *getStatus() const;
+ JSValue *getStatusText() const;
+ JSValue *getStatus() const;
bool urlMatchesDocumentDomain(const KURL&) const;
XMLHttpRequestQObject *qObject;
@@ -100,8 +100,8 @@
void send(const QString& _body);
void abort();
void setRequestHeader(const QString& name, const QString &value);
- ValueImp *getAllResponseHeaders() const;
- ValueImp *getResponseHeader(const QString& name) const;
+ JSValue *getAllResponseHeaders() const;
+ JSValue *getResponseHeader(const QString& name) const;
void changeState(XMLHttpRequestState newState);
1.11 +3 -3 WebCore/khtml/ecma/xmlserializer.cpp
Index: xmlserializer.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/xmlserializer.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- xmlserializer.cpp 11 Dec 2005 00:38:03 -0000 1.10
+++ xmlserializer.cpp 11 Dec 2005 02:06:08 -0000 1.11
@@ -45,7 +45,7 @@
IMPLEMENT_PROTOTYPE(XMLSerializerProto,XMLSerializerProtoFunc)
XMLSerializerConstructorImp::XMLSerializerConstructorImp(ExecState *)
- : ObjectImp()
+ : JSObject()
{
}
@@ -54,7 +54,7 @@
return true;
}
-ObjectImp *XMLSerializerConstructorImp::construct(ExecState *exec, const List &)
+JSObject *XMLSerializerConstructorImp::construct(ExecState *exec, const List &)
{
return new XMLSerializer(exec);
}
@@ -71,7 +71,7 @@
setPrototype(XMLSerializerProto::self(exec));
}
-ValueImp *XMLSerializerProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
+JSValue *XMLSerializerProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (!thisObj->inherits(&XMLSerializer::info))
return throwError(exec, TypeError);
1.4 +2 -2 WebCore/khtml/ecma/xmlserializer.h
Index: xmlserializer.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/xmlserializer.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- xmlserializer.h 8 Aug 2005 04:07:42 -0000 1.3
+++ xmlserializer.h 11 Dec 2005 02:06:08 -0000 1.4
@@ -27,11 +27,11 @@
class JSEventListener;
- class XMLSerializerConstructorImp : public ObjectImp {
+ class XMLSerializerConstructorImp : public JSObject {
public:
XMLSerializerConstructorImp(ExecState *);
virtual bool implementsConstruct() const;
- virtual ObjectImp *construct(ExecState *exec, const List &args);
+ virtual JSObject *construct(ExecState *exec, const List &args);
};
class XMLSerializer : public DOMObject {
1.10 +8 -8 WebCore/ksvg2/ecma/Ecma.cpp
Index: Ecma.cpp
===================================================================
RCS file: /cvs/root/WebCore/ksvg2/ecma/Ecma.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Ecma.cpp 11 Dec 2005 00:38:07 -0000 1.9
+++ Ecma.cpp 11 Dec 2005 02:06:14 -0000 1.10
@@ -114,7 +114,7 @@
// Create base bridge for document
SVGDocument docObj(svgDocument);
- KJS::ObjectImp *kjsObj = docObj.bridge(interpreter()->globalExec());
+ KJS::JSObject *kjsObj = docObj.bridge(interpreter()->globalExec());
#ifndef APPLE_CHANGES
kjsObj->ref();
#endif
@@ -123,10 +123,10 @@
svgDocument->deref();
}
-KJS::ObjectImp *Ecma::inheritedGetDOMNode(KJS::ExecState *exec, KDOM::Node n)
+KJS::JSObject *Ecma::inheritedGetDOMNode(KJS::ExecState *exec, KDOM::Node n)
{
// Use svg element ids to distinguish between svg elements.
- KJS::ObjectImp *ret = 0;
+ KJS::JSObject *ret = 0;
KDOM::NodeImpl *nodeImpl = static_cast<KDOM::NodeImpl *>(n.handle());
if(!nodeImpl)
@@ -361,7 +361,7 @@
return ret;
}
-KJS::ObjectImp *Ecma::inheritedGetDOMEvent(KJS::ExecState *exec, KDOM::Event e)
+KJS::JSObject *Ecma::inheritedGetDOMEvent(KJS::ExecState *exec, KDOM::Event e)
{
KDOM::EventImpl *eventImpl = e.handle();
if(!eventImpl)
@@ -382,7 +382,7 @@
return 0;
}
-KJS::ObjectImp *Ecma::inheritedGetDOMCSSValue(KJS::ExecState *exec, KDOM::CSSValue c)
+KJS::JSObject *Ecma::inheritedGetDOMCSSValue(KJS::ExecState *exec, KDOM::CSSValue c)
{
KDOM::CSSValueImpl *impl = c.handle();
@@ -398,7 +398,7 @@
return 0;
}
-KJS::ValueImp *KSVG::getSVGPathSeg(KJS::ExecState *exec, SVGPathSeg s)
+KJS::JSValue *KSVG::getSVGPathSeg(KJS::ExecState *exec, SVGPathSeg s)
{
if(s == SVGPathSeg::null)
return KJS::jsNull();
@@ -408,11 +408,11 @@
return KJS::jsNull();
// Reuse existing bridge, if possible
- KJS::ObjectImp *request = interpreter->getDOMObject(s.handle());
+ KJS::JSObject *request = interpreter->getDOMObject(s.handle());
if(request)
return request;
- KJS::ObjectImp *ret = 0;
+ KJS::JSObject *ret = 0;
unsigned short type = s.pathSegType();
switch(type)
1.5 +4 -4 WebCore/ksvg2/ecma/Ecma.h
Index: Ecma.h
===================================================================
RCS file: /cvs/root/WebCore/ksvg2/ecma/Ecma.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Ecma.h 1 Sep 2005 07:35:27 -0000 1.4
+++ Ecma.h 11 Dec 2005 02:06:14 -0000 1.5
@@ -40,9 +40,9 @@
virtual ~Ecma();
// We are a KDOM user, so implement the hook to convert svg elements to kjs objects
- virtual KJS::ObjectImp *inheritedGetDOMNode(KJS::ExecState *exec, KDOM::Node n);
- virtual KJS::ObjectImp *inheritedGetDOMEvent(KJS::ExecState *exec, KDOM::Event e);
- virtual KJS::ObjectImp *inheritedGetDOMCSSValue(KJS::ExecState *exec, KDOM::CSSValue c);
+ virtual KJS::JSObject *inheritedGetDOMNode(KJS::ExecState *exec, KDOM::Node n);
+ virtual KJS::JSObject *inheritedGetDOMEvent(KJS::ExecState *exec, KDOM::Event e);
+ virtual KJS::JSObject *inheritedGetDOMCSSValue(KJS::ExecState *exec, KDOM::CSSValue c);
protected:
virtual void setupDocument(KDOM::DocumentImpl *document);
@@ -50,7 +50,7 @@
// Helpers
class SVGPathSeg;
- KJS::ValueImp *getSVGPathSeg(KJS::ExecState *exec, SVGPathSeg s);
+ KJS::JSValue *getSVGPathSeg(KJS::ExecState *exec, SVGPathSeg s);
};
#endif
1.9 +2 -2 WebCore/ksvg2/ecma/GlobalObject.cpp
Index: GlobalObject.cpp
===================================================================
RCS file: /cvs/root/WebCore/ksvg2/ecma/GlobalObject.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- GlobalObject.cpp 11 Dec 2005 00:38:07 -0000 1.8
+++ GlobalObject.cpp 11 Dec 2005 02:06:14 -0000 1.9
@@ -62,11 +62,11 @@
doc()->updateRendering();
}
-KJS::ValueImp *GlobalObject::get(KJS::ExecState *exec, const KJS::Identifier &p) const
+KJS::JSValue *GlobalObject::get(KJS::ExecState *exec, const KJS::Identifier &p) const
{
kdDebug(26004) << "KSVG::GlobalObject (" << this << ")::get " << p.qstring() << endl;
- KJS::ValueImp *ret = KDOM::GlobalObject::get(exec, p);
+ KJS::JSValue *ret = KDOM::GlobalObject::get(exec, p);
if(ret->type() != KJS::UndefinedType)
return ret;
1.5 +1 -1 WebCore/ksvg2/ecma/GlobalObject.h
Index: GlobalObject.h
===================================================================
RCS file: /cvs/root/WebCore/ksvg2/ecma/GlobalObject.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- GlobalObject.h 1 Sep 2005 07:35:28 -0000 1.4
+++ GlobalObject.h 11 Dec 2005 02:06:14 -0000 1.5
@@ -38,7 +38,7 @@
virtual ~GlobalObject();
virtual void afterTimeout() const;
- virtual KJS::ValueImp *get(KJS::ExecState *exec, const KJS::Identifier &propertyName) const;
+ virtual KJS::JSValue *get(KJS::ExecState *exec, const KJS::Identifier &propertyName) const;
// EcmaScript specific stuff - only needed for GlobalObject
// You won't find it in "general" kdom ecma code...
1.13 +2 -2 WebCore/ksvg2/svg/SVGScriptElementImpl.cpp
Index: SVGScriptElementImpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/ksvg2/svg/SVGScriptElementImpl.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SVGScriptElementImpl.cpp 2 Dec 2005 22:44:27 -0000 1.12
+++ SVGScriptElementImpl.cpp 11 Dec 2005 02:06:15 -0000 1.13
@@ -81,12 +81,12 @@
if(comp.complType() == KJS::Throw)
{
KJS::ExecState *exec = ecmaEngine->globalExec();
- KJS::ValueImp *exVal = comp.value();
+ KJS::JSValue *exVal = comp.value();
int lineno = -1;
if(exVal->isObject())
{
- KJS::ValueImp *lineVal = static_cast<KJS::ObjectImp *>(exVal)->get(exec, "line");
+ KJS::JSValue *lineVal = static_cast<KJS::JSObject *>(exVal)->get(exec, "line");
if(lineVal->type() == KJS::NumberType)
lineno = int(lineVal->toNumber(exec));
}
1.11 +2 -2 WebCore/kwq/DOMInternal.mm
Index: DOMInternal.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/DOMInternal.mm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- DOMInternal.mm 3 Oct 2005 21:13:00 -0000 1.10
+++ DOMInternal.mm 11 Dec 2005 02:06:15 -0000 1.11
@@ -52,7 +52,7 @@
using KJS::ExecState;
using KJS::Interpreter;
-using KJS::ObjectImp;
+using KJS::JSObject;
using KJS::Bindings::RootObject;
@@ -189,7 +189,7 @@
ExecState *exec = interpreter->globalExec();
// Get (or create) a cached JS object for the DOM node.
- ObjectImp *scriptImp = static_cast<ObjectImp *>(getDOMNode(exec, nodeImpl));
+ JSObject *scriptImp = static_cast<JSObject *>(getDOMNode(exec, nodeImpl));
const RootObject *executionContext = KWQ(part)->bindingRootObject();
1.7 +1 -1 WebCore/kwq/DOMUtility.mm
Index: DOMUtility.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/DOMUtility.mm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMUtility.mm 3 Oct 2005 21:13:00 -0000 1.6
+++ DOMUtility.mm 11 Dec 2005 02:06:16 -0000 1.7
@@ -42,7 +42,7 @@
namespace KJS {
-void *ScriptInterpreter::createObjcInstanceForValue(ExecState *exec, ObjectImp *value, const Bindings::RootObject *origin, const Bindings::RootObject *current)
+void *ScriptInterpreter::createObjcInstanceForValue(ExecState *exec, JSObject *value, const Bindings::RootObject *origin, const Bindings::RootObject *current)
{
if (value->inherits(&DOMNode::info)) {
DOMNode *imp = static_cast<DOMNode *>(value);
1.701 +6 -6 WebCore/kwq/KWQKHTMLPart.mm
Index: KWQKHTMLPart.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.mm,v
retrieving revision 1.700
retrieving revision 1.701
diff -u -r1.700 -r1.701
--- KWQKHTMLPart.mm 10 Dec 2005 17:14:37 -0000 1.700
+++ KWQKHTMLPart.mm 11 Dec 2005 02:06:16 -0000 1.701
@@ -1371,7 +1371,7 @@
if (!_bindingRoot) {
JSLock lock;
_bindingRoot = new KJS::Bindings::RootObject(0); // The root gets deleted by JavaScriptCore.
- KJS::ObjectImp *win = KJS::Window::retrieveWindow(this);
+ KJS::JSObject *win = KJS::Window::retrieveWindow(this);
_bindingRoot->setRootObjectImp (win);
_bindingRoot->setInterpreter (KJSProxy::proxy(this)->interpreter());
addPluginRootObject (_bindingRoot);
@@ -1383,8 +1383,8 @@
{
if (!_windowScriptObject) {
KJS::JSLock lock;
- KJS::ObjectImp *win = KJS::Window::retrieveWindow(this);
- _windowScriptObject = KWQRetainNSRelease([[WebScriptObject alloc] _initWithObjectImp:win originExecutionContext:bindingRootObject() executionContext:bindingRootObject()]);
+ KJS::JSObject *win = KJS::Window::retrieveWindow(this);
+ _windowScriptObject = KWQRetainNSRelease([[WebScriptObject alloc] _initWithJSObject:win originExecutionContext:bindingRootObject() executionContext:bindingRootObject()]);
}
return _windowScriptObject;
@@ -1393,15 +1393,15 @@
NPObject *KWQKHTMLPart::windowScriptNPObject()
{
if (!_windowScriptNPObject) {
- KJS::ObjectImp *win = KJS::Window::retrieveWindow(this);
+ KJS::JSObject *win = KJS::Window::retrieveWindow(this);
// The window script object can be 0 if JavaScript is disabled. However, callers (like plugins) expect us to
- // always return a window script object here. By substituting a plain ObjectImp for the window's ObjectImp,
+ // always return a window script object here. By substituting a plain JSObject for the window's JSObject,
// we can satisfy callers' assumptions and let them try to manipulate the dummy object when JavaScript is
// disabled.
if (!win) {
JSLock lock;
- win = new KJS::ObjectImp();
+ win = new KJS::JSObject();
}
_windowScriptNPObject = _NPN_CreateScriptObject (0, win, bindingRootObject(), bindingRootObject());
1.442 +2 -2 WebCore/kwq/WebCoreBridge.mm
Index: WebCoreBridge.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.mm,v
retrieving revision 1.441
retrieving revision 1.442
diff -u -r1.441 -r1.442
--- WebCoreBridge.mm 10 Dec 2005 20:40:19 -0000 1.441
+++ WebCoreBridge.mm 11 Dec 2005 02:06:16 -0000 1.442
@@ -135,7 +135,7 @@
using KJS::ExecState;
using KJS::Interpreter;
using KJS::JSLock;
-using KJS::ObjectImp;
+using KJS::JSObject;
using KJS::SavedProperties;
using KJS::SavedBuiltins;
using KJS::Window;
@@ -178,7 +178,7 @@
static pthread_t mainThread = 0;
-static void updateRenderingForBindings (ExecState *exec, ObjectImp *rootObject)
+static void updateRenderingForBindings (ExecState *exec, JSObject *rootObject)
{
if (pthread_self() != mainThread)
return;
1.7 +11 -11 WebCore/kwq/WebCoreScriptDebugger.mm
Index: WebCoreScriptDebugger.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/WebCoreScriptDebugger.mm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- WebCoreScriptDebugger.mm 11 Dec 2005 00:38:07 -0000 1.6
+++ WebCoreScriptDebugger.mm 11 Dec 2005 02:06:17 -0000 1.7
@@ -49,7 +49,7 @@
- (WebCoreScriptCallFrame *)_initWithGlobalObject:(WebScriptObject *)globalObj caller:(WebCoreScriptCallFrame *)caller state:(ExecState *)state;
- (void)_setWrapper:(id)wrapper;
-- (id)_convertValueToObjcValue:(ValueImp *)value;
+- (id)_convertValueToObjcValue:(JSValue *)value;
@end
@@ -92,7 +92,7 @@
}
return true;
}
- virtual bool callEvent(ExecState *state, int sid, int lineno, ObjectImp *func, const List &args) {
+ virtual bool callEvent(ExecState *state, int sid, int lineno, JSObject *func, const List &args) {
if (!_nested) {
_nested = true;
_current = [_objc _enterFrame:state];
@@ -109,7 +109,7 @@
}
return true;
}
- virtual bool returnEvent(ExecState *state, int sid, int lineno, ObjectImp *func) {
+ virtual bool returnEvent(ExecState *state, int sid, int lineno, JSObject *func) {
if (!_nested) {
_nested = true;
[[_objc delegate] leavingFrame:_current sourceId:sid line:lineno];
@@ -210,7 +210,7 @@
_wrapper = wrapper; // (already retained)
}
-- (id)_convertValueToObjcValue:(ValueImp *)value
+- (id)_convertValueToObjcValue:(JSValue *)value
{
if (!value) {
return nil;
@@ -315,14 +315,14 @@
ExecState *state = _state;
Interpreter *interp = state->interpreter();
- ObjectImp *globObj = interp->globalObject();
+ JSObject *globObj = interp->globalObject();
// find "eval"
- ObjectImp *eval = NULL;
+ JSObject *eval = NULL;
if (state->context().imp()) { // "eval" won't work without context (i.e. at global scope)
- ValueImp *v = globObj->get(state, "eval");
- if (v->isObject() && static_cast<ObjectImp *>(v)->implementsCall()) {
- eval = static_cast<ObjectImp *>(v);
+ JSValue *v = globObj->get(state, "eval");
+ if (v->isObject() && static_cast<JSObject *>(v)->implementsCall()) {
+ eval = static_cast<JSObject *>(v);
}
else {
// no "eval" - fallback operates on global exec state
@@ -330,11 +330,11 @@
}
}
- ValueImp *savedException = state->exception();
+ JSValue *savedException = state->exception();
state->clearException();
// evaluate
- ValueImp *result;
+ JSValue *result;
if (eval) {
JSLock lock;
List args;
More information about the webkit-changes
mailing list