Skip to content

Commit 69a3bf3

Browse files
committed
fixup: fix linter issues
1 parent 01ee4c0 commit 69a3bf3

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/node_sqlite.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class BackupJob : public ThreadPoolWork {
182182
Local<Object> e = Local<Object>();
183183

184184
if (backup_status_ != SQLITE_OK) {
185-
CreateSQLiteError(isolate, pDest_).ToLocal(&e);
185+
e = CreateSQLiteError(isolate, pDest_).ToLocalChecked();
186186

187187
Cleanup();
188188

@@ -195,7 +195,7 @@ class BackupJob : public ThreadPoolWork {
195195
pDest_, dest_db_.c_str(), source_->Connection(), source_db_.c_str());
196196

197197
if (pBackup_ == nullptr) {
198-
CreateSQLiteError(isolate, pDest_).ToLocal(&e);
198+
e = CreateSQLiteError(isolate, pDest_).ToLocalChecked();
199199

200200
sqlite3_close(pDest_);
201201

@@ -227,9 +227,8 @@ class BackupJob : public ThreadPoolWork {
227227

228228
if (!(backup_status_ == SQLITE_OK || backup_status_ == SQLITE_DONE ||
229229
backup_status_ == SQLITE_BUSY || backup_status_ == SQLITE_LOCKED)) {
230-
Local<Object> e = Local<Object>();
231-
232-
CreateSQLiteError(env()->isolate(), backup_status_).ToLocal(&e);
230+
Local<Object> e =
231+
CreateSQLiteError(env()->isolate(), backup_status_).ToLocalChecked();
233232

234233
Cleanup();
235234

@@ -275,8 +274,8 @@ class BackupJob : public ThreadPoolWork {
275274
env()->isolate(), "Backup completed", NewStringType::kNormal)
276275
.ToLocalChecked();
277276

278-
Local<Object> e = Local<Object>();
279-
CreateSQLiteError(env()->isolate(), pDest_).ToLocal(&e);
277+
Local<Object> e =
278+
CreateSQLiteError(env()->isolate(), pDest_).ToLocalChecked();
280279

281280
Cleanup();
282281

@@ -826,8 +825,8 @@ void DatabaseSync::Backup(const FunctionCallbackInfo<Value>& args) {
826825
}
827826

828827
Local<Promise::Resolver> resolver = Promise::Resolver::New(env->context())
829-
.ToLocalChecked()
830-
.As<Promise::Resolver>();
828+
.ToLocalChecked()
829+
.As<Promise::Resolver>();
831830

832831
args.GetReturnValue().Set(resolver->GetPromise());
833832

test/parallel/test-sqlite-backup.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import common from '../common/index.js';
1+
import * as common from '../common/index.mjs';
22
import tmpdir from '../common/tmpdir.js';
33
import { join } from 'path';
44
import { DatabaseSync } from 'node:sqlite';
@@ -58,7 +58,8 @@ test('database backup', async (t) => {
5858
const backup = new DatabaseSync(destDb);
5959
const rows = backup.prepare('SELECT * FROM data').all();
6060

61-
// The source database has two pages - using the default page size -, so the progress function should be called once (the last call is not made since
61+
// The source database has two pages - using the default page size -,
62+
// so the progress function should be called once (the last call is not made since
6263
// the promise resolves)
6364
t.assert.strictEqual(progressFn.mock.calls.length, 1);
6465
t.assert.deepStrictEqual(rows, [
@@ -80,4 +81,3 @@ test('database backup fails when dest file is not writable', (t) => {
8081
message: 'attempt to write a readonly database'
8182
}));
8283
});
83-

0 commit comments

Comments
 (0)