Skip to content

Commit

Permalink
Merge pull request #33 from workflowy/master
Browse files Browse the repository at this point in the history
Overwrite broken native support in Edge
  • Loading branch information
jerrybendy authored Sep 5, 2018
2 parents e288bdb + 8428c2f commit b21de2e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@
// There is a bug in safari 10.1 (and earlier) that incorrectly decodes `%2B` as an empty space and not a plus.
decodesPlusesCorrectly = nativeURLSearchParams && (new nativeURLSearchParams('s=%2B').get('s') === '+'),
__URLSearchParams__ = "__URLSearchParams__",
encodesAmpersandsCorrectly = true,
prototype = URLSearchParamsPolyfill.prototype,
iterable = !!(self.Symbol && self.Symbol.iterator);

if (nativeURLSearchParams && isSupportObjectConstructor && decodesPlusesCorrectly) {
if (nativeURLSearchParams) {
var ampersandTest = new nativeURLSearchParams();
ampersandTest.append('s', ' &');
encodesAmpersandsCorrectly = ampersandTest.toString() === 's=+%26';
}

if (nativeURLSearchParams && isSupportObjectConstructor && decodesPlusesCorrectly && encodesAmpersandsCorrectly) {
return;
}

Expand Down

0 comments on commit b21de2e

Please sign in to comment.