From e048de1d2f9182aab7d3989f7aa4ef9a010a4557 Mon Sep 17 00:00:00 2001 From: Jeremy Scheff Date: Mon, 1 May 2017 17:11:32 -0400 Subject: [PATCH] Include core-js by default to make it work more easily in old environments like PhantomJS - fixes #19 --- CHANGELOG.md | 4 ++++ TODO | 10 ++++++++++ lib/FDBCursor.js | 1 + lib/FDBCursorWithValue.js | 1 + lib/FDBDatabase.js | 1 + lib/FDBFactory.js | 1 + lib/FDBIndex.js | 1 + lib/FDBKeyRange.js | 1 + lib/FDBObjectStore.js | 1 + lib/FDBOpenDBRequest.js | 1 + lib/FDBRequest.js | 1 + lib/FDBTransaction.js | 1 + lib/FDBVersionChangeEvent.js | 1 + package.json | 2 +- src/global.ts | 1 + src/index.ts | 1 + src/test/indexedDBmock/index.html | 1 - 17 files changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c9613ec..4c2c42de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.2 (2017-05-01) + +* Include core-js by default to make it work more easily in old environments like PhantomJS + # 2.0.1 (2017-04-29) * Minor updates to README diff --git a/TODO b/TODO index 3892297d..c9b17a4e 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,13 @@ +# binary tree + +write tests for RecordStore, including benchmarks + +implement + +balance? + +--- + revisit setImmediate - *-exception-order race condition - on some it's not even a race condition, like idbcursor ones seem to always fail, but idbobjectstore ones are intermittent diff --git a/lib/FDBCursor.js b/lib/FDBCursor.js index 1044efdc..439a392f 100644 --- a/lib/FDBCursor.js +++ b/lib/FDBCursor.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBCursor").default; diff --git a/lib/FDBCursorWithValue.js b/lib/FDBCursorWithValue.js index 39e26727..5f6d6837 100644 --- a/lib/FDBCursorWithValue.js +++ b/lib/FDBCursorWithValue.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBCursorWithValue").default; diff --git a/lib/FDBDatabase.js b/lib/FDBDatabase.js index 47c2d725..5a000cff 100644 --- a/lib/FDBDatabase.js +++ b/lib/FDBDatabase.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBDatabase").default; diff --git a/lib/FDBFactory.js b/lib/FDBFactory.js index 6c651906..ca935194 100644 --- a/lib/FDBFactory.js +++ b/lib/FDBFactory.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBFactory").default; diff --git a/lib/FDBIndex.js b/lib/FDBIndex.js index 0c4693fd..b2be51e6 100644 --- a/lib/FDBIndex.js +++ b/lib/FDBIndex.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBIndex").default; diff --git a/lib/FDBKeyRange.js b/lib/FDBKeyRange.js index 52ff74ff..8ef258bb 100644 --- a/lib/FDBKeyRange.js +++ b/lib/FDBKeyRange.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBKeyRange").default; diff --git a/lib/FDBObjectStore.js b/lib/FDBObjectStore.js index f3d5ceef..3be030ff 100644 --- a/lib/FDBObjectStore.js +++ b/lib/FDBObjectStore.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBObjectStore").default; diff --git a/lib/FDBOpenDBRequest.js b/lib/FDBOpenDBRequest.js index 2608b722..93aad462 100644 --- a/lib/FDBOpenDBRequest.js +++ b/lib/FDBOpenDBRequest.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBOpenDBRequest").default; diff --git a/lib/FDBRequest.js b/lib/FDBRequest.js index 7e518b8b..3895f4ab 100644 --- a/lib/FDBRequest.js +++ b/lib/FDBRequest.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBRequest").default; diff --git a/lib/FDBTransaction.js b/lib/FDBTransaction.js index 42b729c3..b7d719d7 100644 --- a/lib/FDBTransaction.js +++ b/lib/FDBTransaction.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBTransaction").default; diff --git a/lib/FDBVersionChangeEvent.js b/lib/FDBVersionChangeEvent.js index e86492b5..6cb71695 100644 --- a/lib/FDBVersionChangeEvent.js +++ b/lib/FDBVersionChangeEvent.js @@ -2,4 +2,5 @@ // and . It should not // be used internally, only externally. +require("core-js"); module.exports = require("../build/FDBVersionChangeEvent").default; diff --git a/package.json b/package.json index 4368409e..46ae428c 100644 --- a/package.json +++ b/package.json @@ -38,13 +38,13 @@ "lib" ], "dependencies": { + "core-js": "^2.4.1", "realistic-structured-clone": "^1.0.1", "setimmediate": "^1.0.5" }, "devDependencies": { "@types/mocha": "^2.2.41", "@types/node": "^7.0.13", - "babel-polyfill": "^6.23.0", "browserify": "^14.0.0", "mocha": "^3.2.0", "node-qunit-phantomjs": "^1.5.0", diff --git a/src/global.ts b/src/global.ts index 14a3da86..c00a14cc 100644 --- a/src/global.ts +++ b/src/global.ts @@ -1,3 +1,4 @@ +import "core-js"; import fakeIndexedDB from "./fakeIndexedDB"; import FDBCursor from "./FDBCursor"; import FDBCursorWithValue from "./FDBCursorWithValue"; diff --git a/src/index.ts b/src/index.ts index b9364838..d40bc394 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +import "core-js"; import fakeIndexedDB from "./fakeIndexedDB"; module.exports = fakeIndexedDB; diff --git a/src/test/indexedDBmock/index.html b/src/test/indexedDBmock/index.html index 72ceeb4f..76638414 100644 --- a/src/test/indexedDBmock/index.html +++ b/src/test/indexedDBmock/index.html @@ -10,7 +10,6 @@
-