url-search-params-polyfill
Advanced tools
Comparing version 8.1.0 to 8.1.1
22
index.js
@@ -139,2 +139,15 @@ /** | ||
var useProxy = (!forSureUsePolyfill && nativeURLSearchParams && !isSupportObjectConstructor && self.Proxy); | ||
var propValue; | ||
if (useProxy) { | ||
// Safari 10.0 doesn't support Proxy, so it won't extend URLSearchParams on safari 10.0 | ||
propValue = new Proxy(nativeURLSearchParams, { | ||
construct: function (target, args) { | ||
return new target((new URLSearchParamsPolyfill(args[0]).toString())); | ||
} | ||
}) | ||
// Chrome <=60 .toString() on a function proxy got error "Function.prototype.toString is not generic" | ||
propValue.toString = Function.prototype.toString.bind(URLSearchParamsPolyfill); | ||
} else { | ||
propValue = URLSearchParamsPolyfill; | ||
} | ||
/* | ||
@@ -144,10 +157,3 @@ * Apply polifill to global object and append other prototype into it | ||
Object.defineProperty(self, 'URLSearchParams', { | ||
value: (useProxy ? | ||
// Safari 10.0 doesn't support Proxy, so it won't extend URLSearchParams on safari 10.0 | ||
new Proxy(nativeURLSearchParams, { | ||
construct: function(target, args) { | ||
return new target((new URLSearchParamsPolyfill(args[0]).toString())); | ||
} | ||
}) : | ||
URLSearchParamsPolyfill) | ||
value: propValue | ||
}); | ||
@@ -154,0 +160,0 @@ |
{ | ||
"name": "url-search-params-polyfill", | ||
"version": "8.1.0", | ||
"version": "8.1.1", | ||
"description": "a simple polyfill for javascript URLSearchParams", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/jerrybendy/url-search-params-polyfill", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16178
311