| Index: polyfill.js |
| =================================================================== |
| --- a/polyfill.js |
| +++ b/polyfill.js |
| @@ -69,8 +69,12 @@ |
| let func = object[name]; |
| if (!func) |
| return; |
| - |
| - object[name] = function(...args) |
| + let descriptor = Object.getOwnPropertyDescriptor(object, name); |
| + // Some descriptors like setUninstallURL are in fact accessor descriptors. |
|
kzar
2017/11/10 14:16:14
Nit: This comment doesn't read too well and I don'
|
| + // We convert them to data descriptors. |
| + delete descriptor["get"]; |
| + delete descriptor["set"]; |
| + descriptor.value = function(...args) |
| { |
| let callStack = new Error().stack; |
| @@ -111,6 +115,7 @@ |
| }); |
| }); |
| }; |
| + Object.defineProperty(object, name, descriptor); |
| } |
| function shouldWrapAPIs() |