Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
NeeEoo committed Sep 3, 2024
1 parent 8cd8c6f commit c2bc132
Showing 1 changed file with 5 additions and 76 deletions.
81 changes: 5 additions & 76 deletions src/haxeformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,26 @@ const ECMA_KEYWORDS = [
"else",
"break",
"catch",
"instanceof",
"with",
"throw",
"case",
"default",
"try",
"switch",
"continue",
"typeof",
"delete",
"let",
"yield",
"const",
"final",
"class",
// JS handles these with a special rule
// "get",
// "set",
"debugger",
"async",
"await",
"static",
"import",
"from",
"export",
"extends"
];
const ECMA_LITERALS = [
"true",
"false",
"null",
"undefined",
"NaN",
"Infinity"
];

// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
Expand All @@ -64,51 +51,19 @@ const ECMA_TYPES = [
"Object",
"Function",
"Boolean",
"Symbol",
// numbers and dates
"Math",
"Date",
"Number",
"BigInt",
"Int",
"Float",
// text
"String",
"RegExp",
// Indexed collections
"Array",
"Float32Array",
"Float64Array",
"Int8Array",
"Uint8Array",
"Uint8ClampedArray",
"Int16Array",
"Int32Array",
"Uint16Array",
"Uint32Array",
"BigInt64Array",
"BigUint64Array",
// Keyed collections
"Set",
"Map",
"WeakSet",
"WeakMap",
// Structured data
"ArrayBuffer",
"SharedArrayBuffer",
"Atomics",
"DataView",
"JSON",
// Control abstraction objects
"Promise",
"Generator",
"GeneratorFunction",
"AsyncFunction",
// Reflection
"Json",
"Reflect",
"Proxy",
// Internationalization
"Intl",
// WebAssembly
"WebAssembly"
];

const ECMA_ERROR_TYPES = [
Expand All @@ -123,38 +78,12 @@ const ECMA_ERROR_TYPES = [
];

const ECMA_BUILT_IN_GLOBALS = [
"setInterval",
"setTimeout",
"clearInterval",
"clearTimeout",

"require",
"exports",

"eval",
"isFinite",
"isNaN",
"parseFloat",
"parseInt",
"decodeURI",
"decodeURIComponent",
"encodeURI",
"encodeURIComponent",
"escape",
"unescape"
];

const ECMA_BUILT_IN_VARIABLES = [
"arguments",
"this",
"super",
"console",
"window",
"document",
"localStorage",
"sessionStorage",
"module",
"global" // Node.js
"trace",
];

const ECMA_BUILT_INS = [].concat(
Expand Down

0 comments on commit c2bc132

Please sign in to comment.