Skip to content
Permalink
Browse files

added backwards support for node v8.0.0

  • Loading branch information...
JoshuaWise committed Dec 17, 2018
1 parent 2ed90f5 commit 13a4021776944091ecf84886e28d9f690d8fa3a6
Showing with 9 additions and 9 deletions.
  1. +2 −2 benchmark/index.js
  2. +4 −4 lib/transaction.js
  3. +1 −1 test/21.statement.get.js
  4. +1 −1 test/22.statement.all.js
  5. +1 −1 test/23.statement.iterate.js
@@ -39,8 +39,8 @@ const displayTrialName = (trial) => {
};

const createContext = (trial, driver) => {
const { data: _unused, ...tableInfo } = tables.get(trial.table);
return JSON.stringify({ ...trial, ...tableInfo, driver, tables: [...tables.keys()] });
const tableInfo = Object.assign({}, tables.get(trial.table), { data: undefined });
return JSON.stringify(Object.assign({}, trial, tableInfo, { driver, tables: [...tables.keys()] }));
};

const erase = () => {
@@ -33,10 +33,10 @@ const getController = (db) => {
rollbackTo: db.prepare('ROLLBACK TO `\t_bs3.\t`'),
};
controllers.set(db, controller = {
default: { begin: db.prepare('BEGIN'), ...shared },
deferred: { begin: db.prepare('BEGIN DEFERRED'), ...shared },
immediate: { begin: db.prepare('BEGIN IMMEDIATE'), ...shared },
exclusive: { begin: db.prepare('BEGIN EXCLUSIVE'), ...shared },
default: Object.assign({ begin: db.prepare('BEGIN') }, shared),
deferred: Object.assign({ begin: db.prepare('BEGIN DEFERRED') }, shared),
immediate: Object.assign({ begin: db.prepare('BEGIN IMMEDIATE') }, shared),
exclusive: Object.assign({ begin: db.prepare('BEGIN EXCLUSIVE') }, shared),
});
}
return controller;
@@ -35,7 +35,7 @@ describe('Statement#get()', function () {
it('should obey the current pluck and expand settings', function () {
const stmt = this.db.prepare("SELECT *, 2 + 3.5 AS c FROM entries ORDER BY rowid");
const expanded = { entries: { a: 'foo', b: 1, c: 3.14, d: Buffer.alloc(4).fill(0xdd), e: null }, $: { c: 5.5 } };
const row = { ...expanded.entries, ...expanded.$ };
const row = Object.assign({}, expanded.entries, expanded.$);
const plucked = expanded.entries.a;
const raw = Object.values(expanded.entries).concat(expanded.$.c);
expect(stmt.get()).to.deep.equal(row);
@@ -49,7 +49,7 @@ describe('Statement#all()', function () {
entries: { a: 'foo', b: i + 1, c: 3.14, d: Buffer.alloc(4).fill(0xdd), e: null },
$: { c: 5.5 },
}));
const rows = expanded.map(x => ({ ...x.entries, ...x.$ }));
const rows = expanded.map(x => Object.assign({}, x.entries, x.$));
const plucked = expanded.map(x => x.entries.a);
const raw = expanded.map(x => Object.values(x.entries).concat(x.$.c))
expect(stmt.all()).to.deep.equal(rows);
@@ -80,7 +80,7 @@ describe('Statement#iterate()', function () {
entries: { a: 'foo', b: 1, c: 3.14, d: Buffer.alloc(4).fill(0xdd), e: null },
$: { c: 5.5 },
};
const row = { ...expanded.entries, ...expanded.$ };
const row = Object.assign({}, expanded.entries, expanded.$);
const plucked = expanded.entries.a;
const raw = Object.values(expanded.entries).concat(expanded.$.c);
const stmt = this.db.prepare("SELECT *, 2 + 3.5 AS c FROM entries ORDER BY rowid");

0 comments on commit 13a4021

Please sign in to comment.
You can’t perform that action at this time.