CommonPropertyNames.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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. #include <LibJS/Runtime/PropertyKey.h>
  10. namespace JS {
  11. #define ENUMERATE_STANDARD_PROPERTY_NAMES(P) \
  12. P(__proto__) \
  13. P(__defineGetter__) \
  14. P(__defineSetter__) \
  15. P(__lookupGetter__) \
  16. P(__lookupSetter__) \
  17. P(Atomics) \
  18. P(BYTES_PER_ELEMENT) \
  19. P(BigInt) \
  20. P(Boolean) \
  21. P(E) \
  22. P(EPSILON) \
  23. P(Function) \
  24. P(Infinity) \
  25. P(Intl) \
  26. P(JSON) \
  27. P(LN10) \
  28. P(LN2) \
  29. P(LOG10E) \
  30. P(LOG2E) \
  31. P(MAX_SAFE_INTEGER) \
  32. P(MAX_VALUE) \
  33. P(MIN_SAFE_INTEGER) \
  34. P(MIN_VALUE) \
  35. P(Math) \
  36. P(NEGATIVE_INFINITY) \
  37. P(NaN) \
  38. P(Now) \
  39. P(Number) \
  40. P(PI) \
  41. P(POSITIVE_INFINITY) \
  42. P(Proxy) \
  43. P(Reflect) \
  44. P(RegExp) \
  45. P(SQRT1_2) \
  46. P(SQRT2) \
  47. P(String) \
  48. P(Symbol) \
  49. P(Temporal) \
  50. P(UTC) \
  51. P(abs) \
  52. P(acos) \
  53. P(acosh) \
  54. P(add) \
  55. P(all) \
  56. P(allSettled) \
  57. P(anchor) \
  58. P(any) \
  59. P(apply) \
  60. P(arguments) \
  61. P(asIntN) \
  62. P(asUintN) \
  63. P(asin) \
  64. P(asinh) \
  65. P(assert) \
  66. P(assign) \
  67. P(at) \
  68. P(atan) \
  69. P(atan2) \
  70. P(atanh) \
  71. P(baseName) \
  72. P(big) \
  73. P(bind) \
  74. P(blank) \
  75. P(blink) \
  76. P(bold) \
  77. P(buffer) \
  78. P(byteLength) \
  79. P(byteOffset) \
  80. P(calendar) \
  81. P(calendarName) \
  82. P(call) \
  83. P(callee) \
  84. P(caller) \
  85. P(caseFirst) \
  86. P(cause) \
  87. P(cbrt) \
  88. P(ceil) \
  89. P(charAt) \
  90. P(charCodeAt) \
  91. P(cleanupSome) \
  92. P(clear) \
  93. P(clz32) \
  94. P(codePointAt) \
  95. P(collation) \
  96. P(compactDisplay) \
  97. P(compareExchange) \
  98. P(compile) \
  99. P(concat) \
  100. P(configurable) \
  101. P(console) \
  102. P(construct) \
  103. P(constructor) \
  104. P(compare) \
  105. P(copyWithin) \
  106. P(cos) \
  107. P(cosh) \
  108. P(count) \
  109. P(countReset) \
  110. P(create) \
  111. P(currency) \
  112. P(currencyDisplay) \
  113. P(currencySign) \
  114. P(dateAdd) \
  115. P(dateFromFields) \
  116. P(dateUntil) \
  117. P(day) \
  118. P(dayOfWeek) \
  119. P(dayOfYear) \
  120. P(days) \
  121. P(daysInMonth) \
  122. P(daysInWeek) \
  123. P(daysInYear) \
  124. P(debug) \
  125. P(decodeURI) \
  126. P(decodeURIComponent) \
  127. P(defineProperties) \
  128. P(defineProperty) \
  129. P(deleteProperty) \
  130. P(deref) \
  131. P(description) \
  132. P(disambiguation) \
  133. P(done) \
  134. P(dotAll) \
  135. P(encodeURI) \
  136. P(encodeURIComponent) \
  137. P(endsWith) \
  138. P(entries) \
  139. P(enumerable) \
  140. P(epochMicroseconds) \
  141. P(epochMilliseconds) \
  142. P(epochNanoseconds) \
  143. P(epochSeconds) \
  144. P(equals) \
  145. P(era) \
  146. P(eraYear) \
  147. P(error) \
  148. P(errors) \
  149. P(escape) \
  150. P(eval) \
  151. P(evaluate) \
  152. P(every) \
  153. P(exchange) \
  154. P(exec) \
  155. P(exp) \
  156. P(expm1) \
  157. P(fallback) \
  158. P(fields) \
  159. P(fill) \
  160. P(filter) \
  161. P(finally) \
  162. P(find) \
  163. P(findLast) \
  164. P(findLastIndex) \
  165. P(findIndex) \
  166. P(fixed) \
  167. P(flags) \
  168. P(flat) \
  169. P(flatMap) \
  170. P(floor) \
  171. P(fontcolor) \
  172. P(fontsize) \
  173. P(forEach) \
  174. P(format) \
  175. P(formatToParts) \
  176. P(fractionalSecondDigits) \
  177. P(freeze) \
  178. P(from) \
  179. P(fromCharCode) \
  180. P(fromCodePoint) \
  181. P(fromEntries) \
  182. P(fromEpochMicroseconds) \
  183. P(fromEpochMilliseconds) \
  184. P(fromEpochNanoseconds) \
  185. P(fromEpochSeconds) \
  186. P(fround) \
  187. P(gc) \
  188. P(get) \
  189. P(getBigInt64) \
  190. P(getBigUint64) \
  191. P(getCanonicalLocales) \
  192. P(getDate) \
  193. P(getDay) \
  194. P(getFloat32) \
  195. P(getFloat64) \
  196. P(getFullYear) \
  197. P(getHours) \
  198. P(getInstantFor) \
  199. P(getInt8) \
  200. P(getInt16) \
  201. P(getInt32) \
  202. P(getISOFields) \
  203. P(getMilliseconds) \
  204. P(getMinutes) \
  205. P(getMonth) \
  206. P(getNextTransition) \
  207. P(getOffsetNanosecondsFor) \
  208. P(getOffsetStringFor) \
  209. P(getOwnPropertyDescriptor) \
  210. P(getOwnPropertyDescriptors) \
  211. P(getOwnPropertyNames) \
  212. P(getOwnPropertySymbols) \
  213. P(getPlainDateTimeFor) \
  214. P(getPossibleInstantsFor) \
  215. P(getPreviousTransition) \
  216. P(getPrototypeOf) \
  217. P(getSeconds) \
  218. P(getTime) \
  219. P(getTimezoneOffset) \
  220. P(getUint8) \
  221. P(getUint16) \
  222. P(getUint32) \
  223. P(getUTCDate) \
  224. P(getUTCDay) \
  225. P(getUTCFullYear) \
  226. P(getUTCHours) \
  227. P(getUTCMilliseconds) \
  228. P(getUTCMinutes) \
  229. P(getUTCMonth) \
  230. P(getUTCSeconds) \
  231. P(getYear) \
  232. P(global) \
  233. P(globalThis) \
  234. P(groups) \
  235. P(has) \
  236. P(hasIndices) \
  237. P(hasOwn) \
  238. P(hasOwnProperty) \
  239. P(hour) \
  240. P(hourCycle) \
  241. P(hours) \
  242. P(hoursInDay) \
  243. P(hypot) \
  244. P(id) \
  245. P(ignoreCase) \
  246. P(imul) \
  247. P(importValue) \
  248. P(includes) \
  249. P(index) \
  250. P(indexOf) \
  251. P(indices) \
  252. P(info) \
  253. P(inLeapYear) \
  254. P(input) \
  255. P(instant) \
  256. P(is) \
  257. P(isArray) \
  258. P(isExtensible) \
  259. P(isFinite) \
  260. P(isFrozen) \
  261. P(isInteger) \
  262. P(isLockFree) \
  263. P(isNaN) \
  264. P(isPrototypeOf) \
  265. P(isSafeInteger) \
  266. P(isSealed) \
  267. P(isView) \
  268. P(isoDay) \
  269. P(isoHour) \
  270. P(isoMicrosecond) \
  271. P(isoMillisecond) \
  272. P(isoMinute) \
  273. P(isoMonth) \
  274. P(isoNanosecond) \
  275. P(isoSecond) \
  276. P(isoYear) \
  277. P(italics) \
  278. P(join) \
  279. P(keyFor) \
  280. P(keys) \
  281. P(language) \
  282. P(largestUnit) \
  283. P(lastIndex) \
  284. P(lastIndexOf) \
  285. P(length) \
  286. P(link) \
  287. P(load) \
  288. P(locale) \
  289. P(localeCompare) \
  290. P(localeMatcher) \
  291. P(log) \
  292. P(log1p) \
  293. P(log2) \
  294. P(log10) \
  295. P(map) \
  296. P(max) \
  297. P(maximize) \
  298. P(mergeFields) \
  299. P(message) \
  300. P(microsecond) \
  301. P(microseconds) \
  302. P(millisecond) \
  303. P(milliseconds) \
  304. P(min) \
  305. P(minimize) \
  306. P(maximumFractionDigits) \
  307. P(maximumSignificantDigits) \
  308. P(minimumFractionDigits) \
  309. P(minimumIntegerDigits) \
  310. P(minimumSignificantDigits) \
  311. P(minute) \
  312. P(minutes) \
  313. P(month) \
  314. P(monthCode) \
  315. P(monthDayFromFields) \
  316. P(months) \
  317. P(monthsInYear) \
  318. P(multiline) \
  319. P(name) \
  320. P(nanosecond) \
  321. P(nanoseconds) \
  322. P(negated) \
  323. P(next) \
  324. P(notation) \
  325. P(now) \
  326. P(numberingSystem) \
  327. P(numeric) \
  328. P(of) \
  329. P(offset) \
  330. P(offsetNanoseconds) \
  331. P(overflow) \
  332. P(ownKeys) \
  333. P(padEnd) \
  334. P(padStart) \
  335. P(parse) \
  336. P(parseFloat) \
  337. P(parseInt) \
  338. P(plainDate) \
  339. P(plainDateISO) \
  340. P(plainDateTime) \
  341. P(plainDateTimeISO) \
  342. P(plainTime) \
  343. P(plainTimeISO) \
  344. P(pop) \
  345. P(pow) \
  346. P(preventExtensions) \
  347. P(propertyIsEnumerable) \
  348. P(prototype) \
  349. P(proxy) \
  350. P(push) \
  351. P(race) \
  352. P(random) \
  353. P(raw) \
  354. P(reason) \
  355. P(reduce) \
  356. P(reduceRight) \
  357. P(region) \
  358. P(reject) \
  359. P(relativeTo) \
  360. P(repeat) \
  361. P(resolve) \
  362. P(resolvedOptions) \
  363. P(reverse) \
  364. P(revocable) \
  365. P(revoke) \
  366. P(round) \
  367. P(roundingIncrement) \
  368. P(roundingMode) \
  369. P(script) \
  370. P(seal) \
  371. P(second) \
  372. P(seconds) \
  373. P(set) \
  374. P(setBigInt64) \
  375. P(setBigUint64) \
  376. P(setDate) \
  377. P(setFloat32) \
  378. P(setFloat64) \
  379. P(setFullYear) \
  380. P(setHours) \
  381. P(setInt8) \
  382. P(setInt16) \
  383. P(setInt32) \
  384. P(setMilliseconds) \
  385. P(setMinutes) \
  386. P(setMonth) \
  387. P(setPrototypeOf) \
  388. P(setSeconds) \
  389. P(setTime) \
  390. P(setUint8) \
  391. P(setUint16) \
  392. P(setUint32) \
  393. P(setUTCDate) \
  394. P(setUTCFullYear) \
  395. P(setUTCHours) \
  396. P(setUTCMilliseconds) \
  397. P(setUTCMinutes) \
  398. P(setUTCMonth) \
  399. P(setUTCSeconds) \
  400. P(setYear) \
  401. P(shift) \
  402. P(sign) \
  403. P(signDisplay) \
  404. P(sin) \
  405. P(since) \
  406. P(sinh) \
  407. P(size) \
  408. P(slice) \
  409. P(small) \
  410. P(smallestUnit) \
  411. P(some) \
  412. P(sort) \
  413. P(source) \
  414. P(splice) \
  415. P(sqrt) \
  416. P(startOfDay) \
  417. P(startsWith) \
  418. P(status) \
  419. P(sticky) \
  420. P(store) \
  421. P(strike) \
  422. P(stringify) \
  423. P(style) \
  424. P(sub) \
  425. P(subarray) \
  426. P(substr) \
  427. P(substring) \
  428. P(subtract) \
  429. P(sup) \
  430. P(supportedLocalesOf) \
  431. P(tan) \
  432. P(tanh) \
  433. P(test) \
  434. P(then) \
  435. P(timeZone) \
  436. P(timeZoneName) \
  437. P(toDateString) \
  438. P(toFixed) \
  439. P(toGMTString) \
  440. P(toInstant) \
  441. P(toISOString) \
  442. P(toJSON) \
  443. P(toLocaleDateString) \
  444. P(toLocaleLowerCase) \
  445. P(toLocaleString) \
  446. P(toLocaleTimeString) \
  447. P(toLocaleUpperCase) \
  448. P(toLowerCase) \
  449. P(toPlainDate) \
  450. P(toPlainDateTime) \
  451. P(toPlainMonthDay) \
  452. P(toPlainTime) \
  453. P(toPlainYearMonth) \
  454. P(toString) \
  455. P(total) \
  456. P(toTemporalInstant) \
  457. P(toTimeString) \
  458. P(toUpperCase) \
  459. P(toUTCString) \
  460. P(toZonedDateTime) \
  461. P(toZonedDateTimeISO) \
  462. P(trace) \
  463. P(trim) \
  464. P(trimEnd) \
  465. P(trimLeft) \
  466. P(trimRight) \
  467. P(trimStart) \
  468. P(trunc) \
  469. P(type) \
  470. P(undefined) \
  471. P(unescape) \
  472. P(unicode) \
  473. P(unit) \
  474. P(unitDisplay) \
  475. P(until) \
  476. P(unregister) \
  477. P(unshift) \
  478. P(useGrouping) \
  479. P(value) \
  480. P(valueOf) \
  481. P(values) \
  482. P(warn) \
  483. P(weekOfYear) \
  484. P(weeks) \
  485. P(with) \
  486. P(withCalendar) \
  487. P(withPlainDate) \
  488. P(withPlainTime) \
  489. P(withTimeZone) \
  490. P(writable) \
  491. P(year) \
  492. P(yearMonthFromFields) \
  493. P(years) \
  494. P(zonedDateTime) \
  495. P(zonedDateTimeISO)
  496. struct CommonPropertyNames {
  497. PropertyKey and_ { "and", PropertyKey::StringMayBeNumber::No };
  498. PropertyKey catch_ { "catch", PropertyKey::StringMayBeNumber::No };
  499. PropertyKey delete_ { "delete", PropertyKey::StringMayBeNumber::No };
  500. PropertyKey for_ { "for", PropertyKey::StringMayBeNumber::No };
  501. PropertyKey or_ { "or", PropertyKey::StringMayBeNumber::No };
  502. PropertyKey register_ { "register", PropertyKey::StringMayBeNumber::No };
  503. PropertyKey return_ { "return", PropertyKey::StringMayBeNumber::No };
  504. PropertyKey throw_ { "throw", PropertyKey::StringMayBeNumber::No };
  505. PropertyKey xor_ { "xor", PropertyKey::StringMayBeNumber::No };
  506. #define __ENUMERATE(x) PropertyKey x { #x, PropertyKey::StringMayBeNumber::No };
  507. ENUMERATE_STANDARD_PROPERTY_NAMES(__ENUMERATE)
  508. #undef __ENUMERATE
  509. #define __JS_ENUMERATE(x, a, b, c, t) PropertyKey x { #x, PropertyKey::StringMayBeNumber::No };
  510. JS_ENUMERATE_BUILTIN_TYPES
  511. #undef __JS_ENUMERATE
  512. #define __JS_ENUMERATE(x, a, b, c) PropertyKey x { #x, PropertyKey::StringMayBeNumber::No };
  513. JS_ENUMERATE_INTL_OBJECTS
  514. #undef __JS_ENUMERATE
  515. #define __JS_ENUMERATE(x, a, b, c) PropertyKey x { #x, PropertyKey::StringMayBeNumber::No };
  516. JS_ENUMERATE_TEMPORAL_OBJECTS
  517. #undef __JS_ENUMERATE
  518. #define __JS_ENUMERATE(x, a) PropertyKey x { #x, PropertyKey::StringMayBeNumber::No };
  519. JS_ENUMERATE_WELL_KNOWN_SYMBOLS
  520. #undef __JS_ENUMERATE
  521. };
  522. }