EncodedJSValue JSC_HOST_CALL jsDatabaseSyncPrototypeFunctionReadTransaction(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSDatabaseSync::s_info)) return throwVMTypeError(exec); JSDatabaseSync* castedThis = static_cast<JSDatabaseSync*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDatabaseSync::s_info); DatabaseSync* imp = static_cast<DatabaseSync*>(castedThis->impl()); if (exec->argumentCount() < 1) return throwVMError(exec, createSyntaxError(exec, "Not enough arguments")); ExceptionCode ec = 0; if (exec->argumentCount() <= 0 || !exec->argument(0).isObject()) { setDOMException(exec, TYPE_MISMATCH_ERR); return JSValue::encode(jsUndefined()); } RefPtr<SQLTransactionSyncCallback> callback = JSSQLTransactionSyncCallback::create(asObject(exec->argument(0)), castedThis->globalObject()); imp->readTransaction(callback, ec); setDOMException(exec, ec); return JSValue::encode(jsUndefined()); }