diff --git a/data/es3.mjs b/data/es3.mjs new file mode 100644 index 0000000..4031803 --- /dev/null +++ b/data/es3.mjs @@ -0,0 +1,32 @@ +export default { + Array: false, + Boolean: false, + Date: false, + decodeURI: false, + decodeURIComponent: false, + encodeURI: false, + encodeURIComponent: false, + Error: false, + escape: false, + eval: false, + EvalError: false, + Function: false, + Infinity: false, + isFinite: false, + isNaN: false, + Math: false, + NaN: false, + Number: false, + Object: false, + parseFloat: false, + parseInt: false, + RangeError: false, + ReferenceError: false, + RegExp: false, + String: false, + SyntaxError: false, + TypeError: false, + undefined: false, + unescape: false, + URIError: false, +}; diff --git a/data/es5.mjs b/data/es5.mjs index 8d05b23..a925874 100644 --- a/data/es5.mjs +++ b/data/es5.mjs @@ -1,33 +1,6 @@ -export default { - Array: false, - Boolean: false, - Date: false, - decodeURI: false, - decodeURIComponent: false, - encodeURI: false, - encodeURIComponent: false, - Error: false, - escape: false, - eval: false, - EvalError: false, - Function: false, - Infinity: false, - isFinite: false, - isNaN: false, +import {mergeGlobals} from '../utilities.mjs'; +import es3Globals from './es3.mjs'; + +export default mergeGlobals(es3Globals, { JSON: false, - Math: false, - NaN: false, - Number: false, - Object: false, - parseFloat: false, - parseInt: false, - RangeError: false, - ReferenceError: false, - RegExp: false, - String: false, - SyntaxError: false, - TypeError: false, - undefined: false, - unescape: false, - URIError: false, -}; +}); diff --git a/globals.json b/globals.json index 8eebe1d..b42afed 100644 --- a/globals.json +++ b/globals.json @@ -1925,6 +1925,38 @@ "WeakRef": false, "WeakSet": false }, + "es3": { + "Array": false, + "Boolean": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Function": false, + "Infinity": false, + "isFinite": false, + "isNaN": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "RangeError": false, + "ReferenceError": false, + "RegExp": false, + "String": false, + "SyntaxError": false, + "TypeError": false, + "undefined": false, + "unescape": false, + "URIError": false + }, "es5": { "Array": false, "Boolean": false, diff --git a/test.mjs b/test.mjs index 932dac9..8c0c118 100644 --- a/test.mjs +++ b/test.mjs @@ -62,7 +62,10 @@ test('should not contain builtins', t => { test('es versions', t => { const builtins = new Map(Object.entries(globals.builtin)); - const esVersions = ['es5', ...Array.from({length: 2024 - 2015 + 1}, (_, index) => `es${2015 + index}`)]; + const esVersions = Object.keys(globals) + .filter(key => /^es(?:3|5|\d{4})$/.test(key)) + .sort((versionA, versionB) => Number(versionA.slice(2)) - Number(versionB.slice(2))); + let previousVersion; for (const esVersion of esVersions) {