CommonPropertyNames.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/FlyString.h>
  8. #include <LibJS/Forward.h>
  9. namespace JS {
  10. #define ENUMERATE_STANDARD_PROPERTY_NAMES(P) \
  11. P(__proto__) \
  12. P(__defineGetter__) \
  13. P(__defineSetter__) \
  14. P(__lookupGetter__) \
  15. P(__lookupSetter__) \
  16. P(Atomics) \
  17. P(BYTES_PER_ELEMENT) \
  18. P(BigInt) \
  19. P(Boolean) \
  20. P(E) \
  21. P(EPSILON) \
  22. P(Function) \
  23. P(Infinity) \
  24. P(JSON) \
  25. P(LN10) \
  26. P(LN2) \
  27. P(LOG10E) \
  28. P(LOG2E) \
  29. P(MAX_SAFE_INTEGER) \
  30. P(MAX_VALUE) \
  31. P(MIN_SAFE_INTEGER) \
  32. P(MIN_VALUE) \
  33. P(Math) \
  34. P(NEGATIVE_INFINITY) \
  35. P(NaN) \
  36. P(Now) \
  37. P(Number) \
  38. P(PI) \
  39. P(POSITIVE_INFINITY) \
  40. P(Proxy) \
  41. P(Reflect) \
  42. P(RegExp) \
  43. P(SQRT1_2) \
  44. P(SQRT2) \
  45. P(String) \
  46. P(Symbol) \
  47. P(Temporal) \
  48. P(UTC) \
  49. P(abs) \
  50. P(acos) \
  51. P(acosh) \
  52. P(add) \
  53. P(all) \
  54. P(allSettled) \
  55. P(anchor) \
  56. P(any) \
  57. P(apply) \
  58. P(arguments) \
  59. P(asIntN) \
  60. P(asUintN) \
  61. P(asin) \
  62. P(asinh) \
  63. P(assert) \
  64. P(assign) \
  65. P(at) \
  66. P(atan) \
  67. P(atan2) \
  68. P(atanh) \
  69. P(big) \
  70. P(bind) \
  71. P(blank) \
  72. P(blink) \
  73. P(bold) \
  74. P(buffer) \
  75. P(byteLength) \
  76. P(byteOffset) \
  77. P(calendar) \
  78. P(call) \
  79. P(callee) \
  80. P(caller) \
  81. P(cause) \
  82. P(cbrt) \
  83. P(ceil) \
  84. P(charAt) \
  85. P(charCodeAt) \
  86. P(cleanupSome) \
  87. P(clear) \
  88. P(clz32) \
  89. P(codePointAt) \
  90. P(compareExchange) \
  91. P(concat) \
  92. P(configurable) \
  93. P(console) \
  94. P(construct) \
  95. P(constructor) \
  96. P(compare) \
  97. P(copyWithin) \
  98. P(cos) \
  99. P(cosh) \
  100. P(count) \
  101. P(countReset) \
  102. P(create) \
  103. P(dateFromFields) \
  104. P(day) \
  105. P(days) \
  106. P(debug) \
  107. P(decodeURI) \
  108. P(decodeURIComponent) \
  109. P(defineProperties) \
  110. P(defineProperty) \
  111. P(deleteProperty) \
  112. P(deref) \
  113. P(description) \
  114. P(done) \
  115. P(dotAll) \
  116. P(encodeURI) \
  117. P(encodeURIComponent) \
  118. P(endsWith) \
  119. P(entries) \
  120. P(enumerable) \
  121. P(epochMicroseconds) \
  122. P(epochMilliseconds) \
  123. P(epochNanoseconds) \
  124. P(epochSeconds) \
  125. P(equals) \
  126. P(error) \
  127. P(errors) \
  128. P(escape) \
  129. P(eval) \
  130. P(every) \
  131. P(exchange) \
  132. P(exec) \
  133. P(exp) \
  134. P(expm1) \
  135. P(fields) \
  136. P(fill) \
  137. P(filter) \
  138. P(finally) \
  139. P(find) \
  140. P(findIndex) \
  141. P(fixed) \
  142. P(flags) \
  143. P(flat) \
  144. P(flatMap) \
  145. P(floor) \
  146. P(fontcolor) \
  147. P(fontsize) \
  148. P(forEach) \
  149. P(freeze) \
  150. P(from) \
  151. P(fromCharCode) \
  152. P(fromCodePoint) \
  153. P(fromEntries) \
  154. P(fromEpochMicroseconds) \
  155. P(fromEpochMilliseconds) \
  156. P(fromEpochNanoseconds) \
  157. P(fromEpochSeconds) \
  158. P(fround) \
  159. P(gc) \
  160. P(get) \
  161. P(getBigInt64) \
  162. P(getBigUint64) \
  163. P(getDate) \
  164. P(getDay) \
  165. P(getFloat32) \
  166. P(getFloat64) \
  167. P(getFullYear) \
  168. P(getHours) \
  169. P(getInt8) \
  170. P(getInt16) \
  171. P(getInt32) \
  172. P(getISOFields) \
  173. P(getMilliseconds) \
  174. P(getMinutes) \
  175. P(getMonth) \
  176. P(getOwnPropertyDescriptor) \
  177. P(getOwnPropertyDescriptors) \
  178. P(getOwnPropertyNames) \
  179. P(getOwnPropertySymbols) \
  180. P(getPrototypeOf) \
  181. P(getSeconds) \
  182. P(getTime) \
  183. P(getTimezoneOffset) \
  184. P(getUint8) \
  185. P(getUint16) \
  186. P(getUint32) \
  187. P(getUTCDate) \
  188. P(getUTCDay) \
  189. P(getUTCFullYear) \
  190. P(getUTCHours) \
  191. P(getUTCMilliseconds) \
  192. P(getUTCMinutes) \
  193. P(getUTCMonth) \
  194. P(getUTCSeconds) \
  195. P(getYear) \
  196. P(global) \
  197. P(globalThis) \
  198. P(groups) \
  199. P(has) \
  200. P(hasIndices) \
  201. P(hasOwn) \
  202. P(hasOwnProperty) \
  203. P(hours) \
  204. P(hypot) \
  205. P(id) \
  206. P(ignoreCase) \
  207. P(imul) \
  208. P(includes) \
  209. P(index) \
  210. P(indexOf) \
  211. P(indices) \
  212. P(info) \
  213. P(input) \
  214. P(instant) \
  215. P(is) \
  216. P(isArray) \
  217. P(isExtensible) \
  218. P(isFinite) \
  219. P(isFrozen) \
  220. P(isInteger) \
  221. P(isLockFree) \
  222. P(isNaN) \
  223. P(isPrototypeOf) \
  224. P(isSafeInteger) \
  225. P(isSealed) \
  226. P(isView) \
  227. P(isoDay) \
  228. P(isoHour) \
  229. P(isoMicrosecond) \
  230. P(isoMillisecond) \
  231. P(isoMinute) \
  232. P(isoMonth) \
  233. P(isoNanosecond) \
  234. P(isoSecond) \
  235. P(isoYear) \
  236. P(italics) \
  237. P(join) \
  238. P(keyFor) \
  239. P(keys) \
  240. P(lastIndex) \
  241. P(lastIndexOf) \
  242. P(length) \
  243. P(link) \
  244. P(load) \
  245. P(log) \
  246. P(log1p) \
  247. P(log2) \
  248. P(log10) \
  249. P(map) \
  250. P(max) \
  251. P(message) \
  252. P(microseconds) \
  253. P(milliseconds) \
  254. P(min) \
  255. P(minutes) \
  256. P(month) \
  257. P(monthCode) \
  258. P(months) \
  259. P(multiline) \
  260. P(name) \
  261. P(nanoseconds) \
  262. P(negated) \
  263. P(next) \
  264. P(now) \
  265. P(of) \
  266. P(ownKeys) \
  267. P(padEnd) \
  268. P(padStart) \
  269. P(parse) \
  270. P(parseFloat) \
  271. P(parseInt) \
  272. P(pop) \
  273. P(pow) \
  274. P(preventExtensions) \
  275. P(propertyIsEnumerable) \
  276. P(prototype) \
  277. P(proxy) \
  278. P(push) \
  279. P(race) \
  280. P(random) \
  281. P(raw) \
  282. P(reduce) \
  283. P(reduceRight) \
  284. P(reject) \
  285. P(repeat) \
  286. P(resolve) \
  287. P(reverse) \
  288. P(revocable) \
  289. P(revoke) \
  290. P(round) \
  291. P(seal) \
  292. P(seconds) \
  293. P(set) \
  294. P(setBigInt64) \
  295. P(setBigUint64) \
  296. P(setDate) \
  297. P(setFloat32) \
  298. P(setFloat64) \
  299. P(setFullYear) \
  300. P(setHours) \
  301. P(setInt8) \
  302. P(setInt16) \
  303. P(setInt32) \
  304. P(setMilliseconds) \
  305. P(setMinutes) \
  306. P(setMonth) \
  307. P(setPrototypeOf) \
  308. P(setSeconds) \
  309. P(setTime) \
  310. P(setUint8) \
  311. P(setUint16) \
  312. P(setUint32) \
  313. P(setUTCDate) \
  314. P(setUTCFullYear) \
  315. P(setUTCHours) \
  316. P(setUTCMilliseconds) \
  317. P(setUTCMinutes) \
  318. P(setUTCMonth) \
  319. P(setUTCSeconds) \
  320. P(setYear) \
  321. P(shift) \
  322. P(sign) \
  323. P(sin) \
  324. P(sinh) \
  325. P(size) \
  326. P(slice) \
  327. P(small) \
  328. P(some) \
  329. P(sort) \
  330. P(source) \
  331. P(splice) \
  332. P(sqrt) \
  333. P(startsWith) \
  334. P(sticky) \
  335. P(store) \
  336. P(strike) \
  337. P(stringify) \
  338. P(sub) \
  339. P(subarray) \
  340. P(substr) \
  341. P(substring) \
  342. P(sup) \
  343. P(tan) \
  344. P(tanh) \
  345. P(test) \
  346. P(then) \
  347. P(timeZone) \
  348. P(toDateString) \
  349. P(toFixed) \
  350. P(toGMTString) \
  351. P(toISOString) \
  352. P(toJSON) \
  353. P(toLocaleDateString) \
  354. P(toLocaleString) \
  355. P(toLocaleTimeString) \
  356. P(toLowerCase) \
  357. P(toPlainDate) \
  358. P(toString) \
  359. P(toTemporalInstant) \
  360. P(toTimeString) \
  361. P(toUpperCase) \
  362. P(toUTCString) \
  363. P(trace) \
  364. P(trim) \
  365. P(trimEnd) \
  366. P(trimLeft) \
  367. P(trimRight) \
  368. P(trimStart) \
  369. P(trunc) \
  370. P(undefined) \
  371. P(unescape) \
  372. P(unicode) \
  373. P(unregister) \
  374. P(unshift) \
  375. P(value) \
  376. P(valueOf) \
  377. P(values) \
  378. P(warn) \
  379. P(weeks) \
  380. P(with) \
  381. P(withCalendar) \
  382. P(writable) \
  383. P(year) \
  384. P(years)
  385. struct CommonPropertyNames {
  386. PropertyName and_ { "and", PropertyName::StringMayBeNumber::No };
  387. PropertyName catch_ { "catch", PropertyName::StringMayBeNumber::No };
  388. PropertyName delete_ { "delete", PropertyName::StringMayBeNumber::No };
  389. PropertyName for_ { "for", PropertyName::StringMayBeNumber::No };
  390. PropertyName or_ { "or", PropertyName::StringMayBeNumber::No };
  391. PropertyName register_ { "register", PropertyName::StringMayBeNumber::No };
  392. PropertyName return_ { "return", PropertyName::StringMayBeNumber::No };
  393. PropertyName throw_ { "throw", PropertyName::StringMayBeNumber::No };
  394. PropertyName xor_ { "xor", PropertyName::StringMayBeNumber::No };
  395. #define __ENUMERATE(x) PropertyName x { #x, PropertyName::StringMayBeNumber::No };
  396. ENUMERATE_STANDARD_PROPERTY_NAMES(__ENUMERATE)
  397. #undef __ENUMERATE
  398. #define __JS_ENUMERATE(x, a, b, c, t) PropertyName x { #x, PropertyName::StringMayBeNumber::No };
  399. JS_ENUMERATE_BUILTIN_TYPES
  400. #undef __JS_ENUMERATE
  401. #define __JS_ENUMERATE(x, a, b, c) PropertyName x { #x, PropertyName::StringMayBeNumber::No };
  402. JS_ENUMERATE_TEMPORAL_OBJECTS
  403. #undef __JS_ENUMERATE
  404. #define __JS_ENUMERATE(x, a) PropertyName x { #x, PropertyName::StringMayBeNumber::No };
  405. JS_ENUMERATE_WELL_KNOWN_SYMBOLS
  406. #undef __JS_ENUMERATE
  407. };
  408. }