Index: libadblockplus-android/jni/JniJsValue.cpp |
=================================================================== |
--- a/libadblockplus-android/jni/JniJsValue.cpp |
+++ b/libadblockplus-android/jni/JniJsValue.cpp |
@@ -32,16 +32,25 @@ |
{ |
try |
{ |
return JniGetJsValue(ptr)->IsNull() ? JNI_TRUE : JNI_FALSE; |
} |
CATCH_THROW_AND_RETURN(env, JNI_FALSE) |
} |
+static jboolean JNICALL JniIsNumber(JNIEnv* env, jclass clazz, jlong ptr) |
+{ |
+ try |
+ { |
+ return JniGetJsValue(ptr)->IsNumber() ? JNI_TRUE : JNI_FALSE; |
+ } |
+ CATCH_THROW_AND_RETURN(env, JNI_FALSE) |
+} |
+ |
static jboolean JNICALL JniIsString(JNIEnv* env, jclass clazz, jlong ptr) |
{ |
try |
{ |
return JniGetJsValue(ptr)->IsString() ? JNI_TRUE : JNI_FALSE; |
} |
CATCH_THROW_AND_RETURN(env, JNI_FALSE) |
} |
@@ -187,16 +196,17 @@ |
//inline void SetProperty(const std::string& name, int val); |
//std::string GetClass() const; |
//JsValuePtr Call(const JsValueList& params = JsValueList(), AdblockPlus::JsValuePtr thisPtr = AdblockPlus::JsValuePtr()) const; |
static JNINativeMethod methods[] = |
{ |
{ (char*)"isUndefined", (char*)"(J)Z", (void*)JniIsUndefined }, |
{ (char*)"isNull", (char*)"(J)Z", (void*)JniIsNull }, |
+ { (char*)"isNumber", (char*)"(J)Z", (void*)JniIsNumber }, |
{ (char*)"isString", (char*)"(J)Z", (void*)JniIsString }, |
{ (char*)"isBoolean", (char*)"(J)Z", (void*)JniIsBoolean }, |
{ (char*)"isObject", (char*)"(J)Z", (void*)JniIsObject }, |
{ (char*)"isArray", (char*)"(J)Z", (void*)JniIsArray }, |
{ (char*)"isFunction", (char*)"(J)Z", (void*)JniIsFunction }, |
{ (char*)"asString", (char*)"(J)Ljava/lang/String;", (void*)JniAsString }, |
{ (char*)"asLong", (char*)"(J)J", (void*)JniAsLong }, |
{ (char*)"asBoolean", (char*)"(J)Z", (void*)JniAsBoolean }, |