Commit 35940e83 authored by darin's avatar darin

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2ea0aa85
2005-12-10 Darin Adler <darin@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@apple.com>
Reviewed by Maciej.
......
......@@ -97,7 +97,7 @@ static bool _isSafeScript(JavaScriptObject *obj)
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 @@ bool _NPN_Invoke (NPP npp, NPObject *o, NPIdentifier methodName, const NPVariant
// 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 @@ bool _NPN_Invoke (NPP npp, NPObject *o, NPIdentifier methodName, const NPVariant
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 @@ bool _NPN_Evaluate (NPP npp, NPObject *o, NPString *s, NPVariant *variant)
return false;
ExecState *exec = obj->executionContext->interpreter()->globalExec();
ValueImp *result;
JSValue *result;
JSLock lock;
NPUTF16 *scriptString;
......@@ -225,7 +225,7 @@ bool _NPN_GetProperty (NPP npp, NPObject *o, NPIdentifier propertyName, NPVarian
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 @@ bool _NPN_HasMethod(NPP npp, NPObject *o, NPIdentifier methodName)
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;
......
......@@ -40,12 +40,12 @@ extern NPClass *NPScriptObjectClass;
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
}
......
......@@ -95,9 +95,9 @@ void CInstance::end()
// 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::invokeMethod (ExecState *exec, const MethodList &methodList
}
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::invokeDefaultMethod (ExecState *exec, const List &args)
}
ValueImp *CInstance::defaultValue (Type hint) const
JSValue *CInstance::defaultValue (Type hint) const
{
if (hint == StringType) {
return stringValue();
......@@ -204,26 +204,26 @@ ValueImp *CInstance::defaultValue (Type hint) const
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();
}
......
......@@ -51,15 +51,15 @@ public:
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; }
......
......@@ -42,11 +42,11 @@ using namespace KJS::Bindings;
// ---------------------- 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 @@ ValueImp *CField::valueFromInstance(ExecState *exec, const Instance *inst) const
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();
......
......@@ -48,8 +48,8 @@ public:
_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 @@ public:
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();
......
......@@ -59,7 +59,7 @@ void convertUTF8ToUTF16(const NPUTF8 *UTF8Chars, int UTF8Length, NPUTF16 **UTF16
}
// 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 @@ void coerceValueToNPVariantStringType(ExecState *exec, ValueImp *value, NPVarian
}
// 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 @@ void convertValueToNPVariant(ExecState *exec, ValueImp *value, NPVariant *result
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 @@ void convertValueToNPVariant(ExecState *exec, ValueImp *value, NPVariant *result
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 @@ ValueImp *convertNPVariantToValue(ExecState *exec, const NPVariant *variant)
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.
......
......@@ -49,9 +49,9 @@ typedef enum
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
{
......
......@@ -74,7 +74,7 @@ Class *JavaInstance::getClass() const
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 @@ ValueImp *JavaInstance::stringValue() const
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 @@ ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodL
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 @@ ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodL
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 @@ ValueImp *JavaInstance::defaultValue (Type hint) const
return valueOf();
}
ValueImp *JavaInstance::valueOf() const
JSValue *JavaInstance::valueOf() const
{
return stringValue();
};
......
......@@ -73,17 +73,17 @@ public:
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
......
......@@ -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 @@ struct JSObjectCallContext
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 @@ public:
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 @@ private:
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);
......
......@@ -44,7 +44,7 @@ using namespace KJS::Bindings;
- (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;
......
......@@ -68,12 +68,12 @@ JavaField::JavaField (JNIEnv *env, jobject aField)
_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 @@ jvalue JavaField::dispatchValueFromInstance(ExecState *exec, const JavaInstance
{
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 @@ jvalue JavaField::dispatchValueFromInstance(ExecState *exec, const JavaInstance
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 @@ void JavaField::dispatchSetValueToInstance(ExecState *exec, const JavaInstance *
{
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::dispatchSetValueToInstance(ExecState *exec, const JavaInstance *
}
}
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 @@ JavaArray::JavaArray (const JavaArray &other) : Array()
_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 @@ void JavaArray::setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue
}
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]);
......
......@@ -181,8 +181,8 @@ public:
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 @@ public:
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; }
......
......@@ -711,7 +711,7 @@ jvalue getJNIField( jobject obj, JNIType type, const char *name, const char *sig
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 @@ jvalue convertValueToJValue (ExecState *exec, ValueImp *value, JNIType _JNIType,
// 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();
}
......
......@@ -63,7 +63,7 @@ JNIType JNITypeFromClassName(const char *name);
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 @@ jdouble callJNIDoubleMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
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
......
......@@ -63,10 +63,10 @@ static void _didExecute(WebScriptObject *obj)
ExecState *exec = [obj _executionContext]->interpreter()->globalExec();
KJSDidExecuteFunctionPtr func = Instance::didExecuteFunction();
if (func)
func (exec, static_cast<ObjectImp*>([obj _executionContext]->rootObjectImp()));