A call to the setDescriptor function fails in IE11.
See original GitHub issueBug
What
A call to the setDescriptor function fails in IE11.
Details
In IE11 (user-agent: ‘Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko’), under certain circumstances (reasons not known), the ‘protoDescriptor’ variable in the setDescriptor function (line 4842) is undefined. This means the call to objectDefineProperty fails.
The solution is to change code as follows:
setDescriptor = function (o, key, descriptor) {
var protoDescriptor = gOPD(ObjectProto, key);
delete ObjectProto[key];
objectDefineProperty(o, key, descriptor);
if (o !== ObjectProto) {
objectDefineProperty(ObjectProto, key, protoDescriptor);
}
};
to:
setDescriptor = function (o, key, descriptor) {
var protoDescriptor = gOPD(ObjectProto, key);
delete ObjectProto[key];
objectDefineProperty(o, key, descriptor);
if (o !== ObjectProto && protoDescriptor !== undefined) {
objectDefineProperty(ObjectProto, key, protoDescriptor);
}
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top Results From Across the Web
Google recaptcha error in ie 11 - Stack Overflow
It works with IE, but Chrome return an error : document.querySelector(...).setActive is not a function . See my answer. – Matthieu Charbonnier.
Read more >Script errors in Internet Explorer - Browsers - Microsoft Learn
A script error occurs in Internet Explorer, the webpage cannot be displayed correctly and you receive an error message.
Read more >Javascript code not working in IE11
Your .success function has 338 lines of code, ... o[f] = function () { try { var args = slice.call(arguments); args.unshift(new Date().
Read more >Debug JavaScript in Internet Explorer 11 in 7 easy steps
Need to debug JavaScript in Internet Explorer? Simply follow these 7 steps. Includes examples. Read our debugging guide today.
Read more >Calling external API not working in IE 11 - Microsoft Dynamics ...
Calling external API not working in IE 11 ... I am using an external API to call data using JavaScript and i am...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. Sorry, I’ve meant to get back to you for a week now.
So, it turned out there were two polyfills running: core-js and this one. The problem is that for IE11, core-js doesn’t provide nearly enough polyfilling. I did try manually creating an extract of the missing prototype definitions, copied directly from your library, but once these errors were resolved, some obscure errors remained. So for the time being, I’ve resigned myself to running two polyfills for ie11 alone, but applying the manual fix I described in the initial bug report. It’s far from an ideal scenario, but it does work, so I’m going with that.
On Sun, 22 Aug 2021 at 08:38, Romain Menke @.***> wrote:
Thanks for looking into this both of you. That Babel plugin looks great!