From ebd7a1bf100ded50d49bf7df5dadda8cad174007 Mon Sep 17 00:00:00 2001 From: yan Date: Mon, 8 May 2017 16:19:32 +0000 Subject: [PATCH] polyfill Object.values for webkit browsers Also add safari and chrome automated testing targets. --- .gitignore | 1 + client/recordUtil.js | 3 ++- package.json | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c327b09..b15902d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ npm-debug.log* pids *.pid *.seed +*.source.*.html # Directory for instrumented libs generated by jscoverage/JSCover lib-cov diff --git a/client/recordUtil.js b/client/recordUtil.js index beb010a..187b018 100644 --- a/client/recordUtil.js +++ b/client/recordUtil.js @@ -198,7 +198,8 @@ const mergeRecords = (recordsAndObjects) => { objectIdMap[id] = recordAndObject } }) - return Object.values(objectIdMap) + // webkit does not support Object.values + return Object.keys(objectIdMap).map((key) => objectIdMap[key]) } /** diff --git a/package.json b/package.json index 688ee56..4961a34 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "build": "yarn build-proto && browserify client/sync.js | uglifyjs - > bundles/bundle.js", "build-proto": "pbjs --target=static-module lib/api.proto > lib/api.proto.js", "browsertest": "yarn build-proto; yarn start-test; browserify test/client/*.js test/*.js | uglifyjs - | tape-run; exitCode=$?; yarn stop-test; exit $exitCode", - "browsertest-client": "yarn build-proto; yarn start-test; browserify test/client/*.js | tape-run --browser chrome; exitCode=$?; yarn stop-test; exit $exitCode", + "browsertest-chrome": "yarn build-proto; yarn start-test; browserify test/client/*.js | tape-run --browser chrome; exitCode=$?; yarn stop-test; exit $exitCode", + "browsertest-safari": "yarn build-proto; yarn start-test; browserify test/client/*.js | tape-run --browser safari; exitCode=$?; yarn stop-test; exit $exitCode", "check": "nsp check", "client": "yarn build && python -m SimpleHTTPServer", "coverage": "NODE_CONFIG_DIR=server/config/ istanbul cover tape test/*.js test/server/**/*.js --report lcovonly -- -R spec",