Skip to content

Commit bd43083

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

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/node_sqlite.cc

Lines changed: 8 additions & 11 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

@@ -209,8 +209,6 @@ class BackupJob : public ThreadPoolWork {
209209

210210
void DoThreadPoolWork() override {
211211
backup_status_ = sqlite3_backup_step(pBackup_, pages_);
212-
213-
const char* errstr = sqlite3_errstr(backup_status_);
214212
}
215213

216214
void AfterThreadPoolWork(int status) override {
@@ -227,9 +225,8 @@ class BackupJob : public ThreadPoolWork {
227225

228226
if (!(backup_status_ == SQLITE_OK || backup_status_ == SQLITE_DONE ||
229227
backup_status_ == SQLITE_BUSY || backup_status_ == SQLITE_LOCKED)) {
230-
Local<Object> e = Local<Object>();
231-
232-
CreateSQLiteError(env()->isolate(), backup_status_).ToLocal(&e);
228+
Local<Object> e =
229+
CreateSQLiteError(env()->isolate(), backup_status_).ToLocalChecked();
233230

234231
Cleanup();
235232

@@ -275,8 +272,8 @@ class BackupJob : public ThreadPoolWork {
275272
env()->isolate(), "Backup completed", NewStringType::kNormal)
276273
.ToLocalChecked();
277274

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

281278
Cleanup();
282279

@@ -826,8 +823,8 @@ void DatabaseSync::Backup(const FunctionCallbackInfo<Value>& args) {
826823
}
827824

828825
Local<Promise::Resolver> resolver = Promise::Resolver::New(env->context())
829-
.ToLocalChecked()
830-
.As<Promise::Resolver>();
826+
.ToLocalChecked()
827+
.As<Promise::Resolver>();
831828

832829
args.GetReturnValue().Set(resolver->GetPromise());
833830

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)