-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript error in "AdGuard Extra.user.js" in older browsers versions #4
Comments
Also script https://userscripts.adtidy.org/beta/adguard-extra/1.0/adguard-extra.user.js contains the same function repeated five times with different names: function d(e) {
return function(e) {
if (Array.isArray(e)) {
for (var t = 0, n = new Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
}(e) || function(e) {
if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) return Array.from(e)
}(e) || function() {
throw new TypeError("Invalid attempt to spread non-iterable instance")
}()
}
...
function g(e) {
return function(e) {
if (Array.isArray(e)) {
for (var t = 0, n = new Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
}(e) || function(e) {
if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) return Array.from(e)
}(e) || function() {
throw new TypeError("Invalid attempt to spread non-iterable instance")
}()
}
...
function m(e) {
return function(e) {
if (Array.isArray(e)) {
for (var t = 0, n = new Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
}(e) || function(e) {
if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) return Array.from(e)
}(e) || function() {
throw new TypeError("Invalid attempt to spread non-iterable instance")
}()
}
...
function w(e) {
return function(e) {
if (Array.isArray(e)) {
for (var t = 0, n = new Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
}(e) || function(e) {
if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) return Array.from(e)
}(e) || function() {
throw new TypeError("Invalid attempt to spread non-iterable instance")
}()
}
function S(e) {
return function(e) {
if (Array.isArray(e)) {
for (var t = 0, n = new Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
}(e) || function(e) {
if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) return Array.from(e)
}(e) || function() {
throw new TypeError("Invalid attempt to spread non-iterable instance")
}()
} Looks like a new function is inserted for each transpiled spread operator. In any case there is an opportunity for improvement. |
Yeah, we don't use plugin-transform-runtime as it tends to pollute global scope even when corejs 3 is enabled. Anyways, we can improve the build process to avoid duplications, thanks for reporting it! |
@victor-homyakov commented on Wed Jun 19 2019
Steps to reproduce
Expected behavior
No errors should happen
Actual behavior
Older browsers (Opera 40 and older, Chrome 53 and older) will throw JavaScript error
because JavaScript in
AdGuard Extra.user.js
usesObject.values()
, which isn't supported in older browser versions https://caniuse.com/#search=Object.values.Your environment
The text was updated successfully, but these errors were encountered: