Upgrade to ECMAScript 2020

This is needed in order to use `globalThis`, see #1894.
It also made it possible to remove some old polyfills and fallbacks.
This commit is contained in:
Jakob Linskeseder
2022-10-19 22:25:44 +02:00
committed by Jay Linski
parent da41887377
commit f6ff3bf52b
21 changed files with 1200 additions and 1627 deletions
@@ -128,6 +128,7 @@ JavaScriptCompiler.prototype = {
this.decorators.push('return fn;');
if (asObject) {
// eslint-disable-next-line no-new-func
this.decorators = Function.apply(this, [
'fn',
'props',
@@ -260,7 +261,7 @@ JavaScriptCompiler.prototype = {
if (asObject) {
params.push(source);
return Function.apply(this, params);
return Function.apply(this, params); // eslint-disable-line no-new-func
} else {
return this.source.wrap([
'function(',
+2 -15
View File
@@ -30,23 +30,10 @@ export function extend(obj /* , ...source */) {
export let toString = Object.prototype.toString;
// Sourced from lodash
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
/* eslint-disable func-style */
let isFunction = function(value) {
// https://github.com/lodash/lodash/blob/4.17.21/LICENSE
export function isFunction(value) {
return typeof value === 'function';
};
// fallback for older versions of Chrome and Safari
/* istanbul ignore next */
if (isFunction(/x/)) {
isFunction = function(value) {
return (
typeof value === 'function' &&
toString.call(value) === '[object Function]'
);
};
}
export { isFunction };
/* eslint-enable func-style */
/* istanbul ignore next */
export const isArray =