You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently had a problem running a webapp in IE11 which includes holmes. IE doesn't recognize some ES6 methods and properties of your source code and it was blocking part of my own js.
Errors come when IE is trying to recognize Object.assign() and String.prototype.includes()
I tried to add the polyfills included in the MDN documentation at the start of your source code. And it works! Now holmes.js runs fine in IE11 with this hack:
if (typeof Object.assign != 'function') {
Object.assign = function (target, varArgs) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var to = Object(target);
for (var index = 1; index < arguments.length; index++) {
var nextSource = arguments[index];
if (nextSource != null) {
for (var nextKey in nextSource) {
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey];
}
}
}
}
return to;
};
}
if (!String.prototype.includes) {
String.prototype.includes = function() {
'use strict';
return String.prototype.indexOf.apply(this, arguments) !== -1;
};
}
Hi guys!
I recently had a problem running a webapp in IE11 which includes holmes. IE doesn't recognize some ES6 methods and properties of your source code and it was blocking part of my own js.
Errors come when IE is trying to recognize Object.assign() and String.prototype.includes()
I tried to add the polyfills included in the MDN documentation at the start of your source code. And it works! Now holmes.js runs fine in IE11 with this hack:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
I hope you can find this fix useful for adding it in a future upgrade :)
Regards!
The text was updated successfully, but these errors were encountered: