| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9e4f133 commit 87064a0
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2254,6 +2254,8 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) { | |||
| 2254 | 2254 | return; | |
| 2255 | 2255 | } | |
| 2256 | 2256 | ||
| 2257 | + Local<Function> conflictFunc; | ||
| 2258 | + Local<Function> filterFunc; | ||
| 2257 | 2259 | if (args.Length() > 1 && !args[1]->IsUndefined()) { | |
| 2258 | 2260 | if (!args[1]->IsObject()) { | |
| 2259 | 2261 | THROW_ERR_INVALID_ARG_TYPE(env->isolate(), | |
@@ -2276,8 +2278,8 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) { | |||
| 2276 | 2278 | "The \"options.onConflict\" argument must be a function."); | |
| 2277 | 2279 | return; | |
| 2278 | 2280 | } | |
| 2279 | - Local<Function> conflictFunc = conflictValue.As<Function>(); | ||
| 2280 | - context.conflictCallback = [env, conflictFunc](int conflictType) -> int { | ||
| 2281 | + conflictFunc = conflictValue.As<Function>(); | ||
| 2282 | + context.conflictCallback = [env, &conflictFunc](int conflictType) -> int { | ||
| 2281 | 2283 | Local<Value> argv[] = {Integer::New(env->isolate(), conflictType)}; | |
| 2282 | 2284 | TryCatch try_catch(env->isolate()); | |
| 2283 | 2285 | Local<Value> result = | |
@@ -2313,10 +2315,10 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) { | |||
| 2313 | 2315 | return; | |
| 2314 | 2316 | } | |
| 2315 | 2317 | ||
| 2316 | - Local<Function> filterFunc = filterValue.As<Function>(); | ||
| 2318 | + filterFunc = filterValue.As<Function>(); | ||
| 2317 | 2319 | ||
| 2318 | 2320 | context.filterCallback = | |
| 2319 | - [env, db, filterFunc](std::string_view item) -> bool { | ||
| 2321 | + [env, db, &filterFunc](std::string_view item) -> bool { | ||
| 2320 | 2322 | // If there was an error in the previous call to the filter's | |
| 2321 | 2323 | // callback, we skip calling it again. | |
| 2322 | 2324 | if (db->ignore_next_sqlite_error_) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments