From 322951bdc06262f49212bacdbd7e440017c73411 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sat, 2 Mar 2019 18:18:44 -0500 Subject: [PATCH] Add polyfill for `Object.getOwnPropertySymbols` for sinon (closes #6001) --- package.json | 2 +- test/spec/spec_helpers.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ce35d305b..5702ab97e 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "rollup-plugin-node-resolve": "^4.0.0", "shelljs": "^0.8.0", "shx": "^0.3.0", - "sinon": "^7.2.4", + "sinon": "^7.2.6", "sinon-chai": "^3.1.0", "smash": "0.0", "svg-sprite": "1.5.0", diff --git a/test/spec/spec_helpers.js b/test/spec/spec_helpers.js index 2a70210dd..1db452d4e 100644 --- a/test/spec/spec_helpers.js +++ b/test/spec/spec_helpers.js @@ -38,6 +38,12 @@ expect = chai.expect; window.d3 = iD.d3; // TODO: remove +// Object.getOwnPropertySymbols polyfill (For PhantomJS / IE11) - #6001 +if (!Object.getOwnPropertySymbols) { + Object.defineProperty(Object.prototype, 'getOwnPropertySymbols', { + value: function() { return []; } + }); +} // Array.find polyfill (For PhantomJS / IE11) // https://tc39.github.io/ecma262/#sec-array.prototype.find