bool VJSObject::DeleteProperty( const VString& inPropertyName, JS4D::ExceptionRef *outException) const { JSStringRef jsName = JS4D::VStringToString( inPropertyName); bool ok = JSObjectDeleteProperty( fContext, fObject, jsName, outException); JSStringRelease( jsName); return ok; }
bool ObjectWrapper::Remove(const KeyType& key) { JSStringRef strKey = JSStringCreateWithUTF8CString(key.c_str()); JSObjectDeleteProperty(g_ctx, m_obj, strKey, NULL); JSStringRelease(strKey); return true; }
bool JSObject::DeleteProperty(const JSString& property_name) { HAL_JSOBJECT_LOCK_GUARD; JSValueRef exception { nullptr }; const bool result = JSObjectDeleteProperty(static_cast<JSContextRef>(js_context__), js_object_ref__, static_cast<JSStringRef>(property_name), &exception); if (exception) { detail::ThrowRuntimeError("JSObject", JSValue(js_context__, exception)); } return result; }
NATIVE(JSObject,jobject,deleteProperty) (PARAMS, jlong ctx, jlong object, jlong propertyName) { JSValueRef exception = NULL; jclass ret = env->FindClass("org/liquidplayer/webkit/javascriptcore/JNIReturnObject"); jmethodID cid = env->GetMethodID(ret,"<init>","()V"); jobject out = env->NewObject(ret, cid); jfieldID fid = env->GetFieldID(ret ,"bool", "Z"); env->SetBooleanField( out, fid, (bool) JSObjectDeleteProperty((JSContextRef) ctx, (JSObjectRef)object, (JSStringRef)propertyName, &exception)); fid = env->GetFieldID(ret , "exception", "J"); env->SetLongField( out, fid, (long) exception); return out; }
bool JSObject::DeleteProperty(JSString propertyName) { return JSObjectDeleteProperty(ctx_, instance_, propertyName, nullptr); }