corejs2-built-in-features.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. const typedArrayMethods = [
  2. "typed arrays / %TypedArray%.from",
  3. "typed arrays / %TypedArray%.of",
  4. "typed arrays / %TypedArray%.prototype.subarray",
  5. "typed arrays / %TypedArray%.prototype.join",
  6. "typed arrays / %TypedArray%.prototype.indexOf",
  7. "typed arrays / %TypedArray%.prototype.lastIndexOf",
  8. "typed arrays / %TypedArray%.prototype.slice",
  9. "typed arrays / %TypedArray%.prototype.every",
  10. "typed arrays / %TypedArray%.prototype.filter",
  11. "typed arrays / %TypedArray%.prototype.forEach",
  12. "typed arrays / %TypedArray%.prototype.map",
  13. "typed arrays / %TypedArray%.prototype.reduce",
  14. "typed arrays / %TypedArray%.prototype.reduceRight",
  15. "typed arrays / %TypedArray%.prototype.reverse",
  16. "typed arrays / %TypedArray%.prototype.some",
  17. "typed arrays / %TypedArray%.prototype.sort",
  18. "typed arrays / %TypedArray%.prototype.copyWithin",
  19. "typed arrays / %TypedArray%.prototype.find",
  20. "typed arrays / %TypedArray%.prototype.findIndex",
  21. "typed arrays / %TypedArray%.prototype.fill",
  22. "typed arrays / %TypedArray%.prototype.keys",
  23. "typed arrays / %TypedArray%.prototype.values",
  24. "typed arrays / %TypedArray%.prototype.entries",
  25. "typed arrays / %TypedArray%.prototype[Symbol.iterator]",
  26. "typed arrays / %TypedArray%[Symbol.species]",
  27. ];
  28. const es = {
  29. // compat-table missing babel6 mapping
  30. // "es6.array.concat": {
  31. // features: [
  32. // "well-known symbols / Symbol.isConcatSpreadable",
  33. // "well-known symbols / Symbol.species, Array.prototype.concat",
  34. // ]
  35. // },
  36. "es6.array.copy-within": "Array.prototype methods / Array.prototype.copyWithin",
  37. "es6.array.every": "Array methods / Array.prototype.every",
  38. "es6.array.fill": "Array.prototype methods / Array.prototype.fill",
  39. "es6.array.filter": {
  40. features: [
  41. "Array methods / Array.prototype.filter",
  42. // compat-table missing babel6 mapping
  43. // "well-known symbols / Symbol.species, Array.prototype.filter",
  44. ],
  45. },
  46. "es6.array.find": "Array.prototype methods / Array.prototype.find",
  47. "es6.array.find-index": "Array.prototype methods / Array.prototype.findIndex",
  48. "es7.array.flat-map": "Array.prototype.{flat, flatMap} / Array.prototype.flatMap",
  49. "es6.array.for-each": "Array methods / Array.prototype.forEach",
  50. "es6.array.from": "Array static methods / Array.from",
  51. "es7.array.includes": "Array.prototype.includes",
  52. "es6.array.index-of": "Array methods / Array.prototype.indexOf",
  53. "es6.array.is-array": "Array methods / Array.isArray",
  54. // "es.array.join": "", required tests for that
  55. "es6.array.iterator": {
  56. features: [
  57. "Array.prototype methods / Array.prototype.keys",
  58. // can use Symbol.iterator, not implemented in many environments
  59. // "Array.prototype methods / Array.prototype.values",
  60. "Array.prototype methods / Array.prototype.entries",
  61. ],
  62. },
  63. "es6.array.last-index-of": "Array methods / Array.prototype.lastIndexOf",
  64. "es6.array.map": {
  65. features: [
  66. "Array methods / Array.prototype.map",
  67. // compat-table missing babel6 mapping
  68. // "well-known symbols / Symbol.species, Array.prototype.map",
  69. ],
  70. },
  71. "es6.array.of": "Array static methods / Array.of",
  72. "es6.array.reduce": "Array methods / Array.prototype.reduce",
  73. "es6.array.reduce-right": "Array methods / Array.prototype.reduceRight",
  74. // compat-table missing babel6 mapping
  75. // "es6.array.slice": "well-known symbols / Symbol.species, Array.prototype.slice",
  76. "es6.array.some": "Array methods / Array.prototype.some",
  77. "es6.array.sort": "Array methods / Array.prototype.sort",
  78. "es6.array.species": "Array static methods / Array[Symbol.species]",
  79. // compat-table missing babel6 mapping
  80. //"es6.array.splice": "well-known symbols / Symbol.species, Array.prototype.splice",
  81. "es6.date.now": "Date methods / Date.now",
  82. "es6.date.to-iso-string": "Date methods / Date.prototype.toISOString",
  83. "es6.date.to-json": "Date methods / Date.prototype.toJSON",
  84. "es6.date.to-primitive": "Date.prototype[Symbol.toPrimitive]",
  85. "es6.date.to-string": "miscellaneous / Invalid Date",
  86. "es6.function.bind": "Function.prototype.bind",
  87. "es6.function.has-instance": "well-known symbols / Symbol.hasInstance",
  88. "es6.function.name": {
  89. features: [
  90. "function \"name\" property / function statements",
  91. "function \"name\" property / function expressions",
  92. ],
  93. },
  94. "es6.map": "Map",
  95. "es6.math.acosh": "Math methods / Math.acosh",
  96. "es6.math.asinh": "Math methods / Math.asinh",
  97. "es6.math.atanh": "Math methods / Math.atanh",
  98. "es6.math.cbrt": "Math methods / Math.cbrt",
  99. "es6.math.clz32": "Math methods / Math.clz32",
  100. "es6.math.cosh": "Math methods / Math.cosh",
  101. "es6.math.expm1": "Math methods / Math.expm1",
  102. "es6.math.fround": "Math methods / Math.fround",
  103. "es6.math.hypot": "Math methods / Math.hypot",
  104. "es6.math.imul": "Math methods / Math.imul",
  105. "es6.math.log1p": "Math methods / Math.log1p",
  106. "es6.math.log10": "Math methods / Math.log10",
  107. "es6.math.log2": "Math methods / Math.log2",
  108. "es6.math.sign": "Math methods / Math.sign",
  109. "es6.math.sinh": "Math methods / Math.sinh",
  110. "es6.math.tanh": "Math methods / Math.tanh",
  111. "es6.math.trunc": "Math methods / Math.trunc",
  112. "es6.number.constructor": {
  113. features: [
  114. "octal and binary literals / octal supported by Number()",
  115. "octal and binary literals / binary supported by Number()",
  116. ],
  117. },
  118. "es6.number.epsilon": "Number properties / Number.EPSILON",
  119. "es6.number.is-finite": "Number properties / Number.isFinite",
  120. "es6.number.is-integer": "Number properties / Number.isInteger",
  121. "es6.number.is-nan": "Number properties / Number.isNaN",
  122. "es6.number.is-safe-integer": "Number properties / Number.isSafeInteger",
  123. "es6.number.max-safe-integer": "Number properties / Number.MAX_SAFE_INTEGER",
  124. "es6.number.min-safe-integer": "Number properties / Number.MIN_SAFE_INTEGER",
  125. "es6.number.parse-float": "Number properties / Number.parseFloat",
  126. "es6.number.parse-int": "Number properties / Number.parseInt",
  127. "es6.object.assign": {
  128. features: ["Object static methods / Object.assign", "Symbol"],
  129. },
  130. "es6.object.create": "Object static methods / Object.create",
  131. "es7.object.define-getter": {
  132. features: [
  133. "Object.prototype getter/setter methods / __defineGetter__",
  134. "Object.prototype getter/setter methods / __defineGetter__, symbols",
  135. "Object.prototype getter/setter methods / __defineGetter__, ToObject(this)",
  136. ],
  137. },
  138. "es7.object.define-setter": {
  139. features: [
  140. "Object.prototype getter/setter methods / __defineSetter__",
  141. "Object.prototype getter/setter methods / __defineSetter__, symbols",
  142. "Object.prototype getter/setter methods / __defineSetter__, ToObject(this)",
  143. ],
  144. },
  145. "es6.object.define-property": "Object static methods / Object.defineProperty",
  146. "es6.object.define-properties": "Object static methods / Object.defineProperties",
  147. "es7.object.entries": "Object static methods / Object.entries",
  148. "es6.object.freeze": "Object static methods accept primitives / Object.freeze",
  149. "es6.object.get-own-property-descriptor": "Object static methods accept primitives / Object.getOwnPropertyDescriptor",
  150. "es7.object.get-own-property-descriptors": "Object static methods / Object.getOwnPropertyDescriptors",
  151. "es6.object.get-own-property-names": "Object static methods accept primitives / Object.getOwnPropertyNames",
  152. "es6.object.get-prototype-of": "Object static methods accept primitives / Object.getPrototypeOf",
  153. "es7.object.lookup-getter": {
  154. features: [
  155. "Object.prototype getter/setter methods / __lookupGetter__",
  156. "Object.prototype getter/setter methods / __lookupGetter__, prototype chain",
  157. "Object.prototype getter/setter methods / __lookupGetter__, symbols",
  158. "Object.prototype getter/setter methods / __lookupGetter__, ToObject(this)",
  159. "Object.prototype getter/setter methods / __lookupGetter__, data properties can shadow accessors",
  160. ],
  161. },
  162. "es7.object.lookup-setter": {
  163. features: [
  164. "Object.prototype getter/setter methods / __lookupSetter__",
  165. "Object.prototype getter/setter methods / __lookupSetter__, prototype chain",
  166. "Object.prototype getter/setter methods / __lookupSetter__, symbols",
  167. "Object.prototype getter/setter methods / __lookupSetter__, ToObject(this)",
  168. "Object.prototype getter/setter methods / __lookupSetter__, data properties can shadow accessors",
  169. ],
  170. },
  171. "es6.object.prevent-extensions": "Object static methods accept primitives / Object.preventExtensions",
  172. "es6.object.to-string": "well-known symbols / Symbol.toStringTag",
  173. "es6.object.is": "Object static methods / Object.is",
  174. "es6.object.is-frozen": "Object static methods accept primitives / Object.isFrozen",
  175. "es6.object.is-sealed": "Object static methods accept primitives / Object.isSealed",
  176. "es6.object.is-extensible": "Object static methods accept primitives / Object.isExtensible",
  177. "es6.object.keys": "Object static methods accept primitives / Object.keys",
  178. "es6.object.seal": "Object static methods accept primitives / Object.seal",
  179. "es6.object.set-prototype-of": "Object static methods / Object.setPrototypeOf",
  180. "es7.object.values": "Object static methods / Object.values",
  181. "es6.promise": {
  182. features: [
  183. // required unhandled rejection tracking tests
  184. "Promise",
  185. "well-known symbols / Symbol.species, Promise.prototype.then",
  186. ],
  187. },
  188. "es7.promise.finally": "Promise.prototype.finally",
  189. "es6.reflect.apply": "Reflect / Reflect.apply",
  190. "es6.reflect.construct": "Reflect / Reflect.construct",
  191. "es6.reflect.define-property": "Reflect / Reflect.defineProperty",
  192. "es6.reflect.delete-property": "Reflect / Reflect.deleteProperty",
  193. "es6.reflect.get": "Reflect / Reflect.get",
  194. "es6.reflect.get-own-property-descriptor": "Reflect / Reflect.getOwnPropertyDescriptor",
  195. "es6.reflect.get-prototype-of": "Reflect / Reflect.getPrototypeOf",
  196. "es6.reflect.has": "Reflect / Reflect.has",
  197. "es6.reflect.is-extensible": "Reflect / Reflect.isExtensible",
  198. "es6.reflect.own-keys": "Reflect / Reflect.ownKeys",
  199. "es6.reflect.prevent-extensions": "Reflect / Reflect.preventExtensions",
  200. "es6.reflect.set": "Reflect / Reflect.set",
  201. "es6.reflect.set-prototype-of": "Reflect / Reflect.setPrototypeOf",
  202. "es6.regexp.constructor": {
  203. features: [
  204. "miscellaneous / RegExp constructor can alter flags",
  205. "well-known symbols / Symbol.match, RegExp constructor",
  206. ],
  207. },
  208. "es6.regexp.flags": "RegExp.prototype properties / RegExp.prototype.flags",
  209. "es6.regexp.match": "RegExp.prototype properties / RegExp.prototype[Symbol.match]",
  210. "es6.regexp.replace": "RegExp.prototype properties / RegExp.prototype[Symbol.replace]",
  211. "es6.regexp.split": "RegExp.prototype properties / RegExp.prototype[Symbol.split]",
  212. "es6.regexp.search": "RegExp.prototype properties / RegExp.prototype[Symbol.search]",
  213. "es6.regexp.to-string": "miscellaneous / RegExp.prototype.toString generic and uses \"flags\" property",
  214. // This is explicit due to prevent the stage-1 Set proposals under the
  215. // category "Set methods" from being included.
  216. "es6.set": {
  217. features: [
  218. "Set / basic functionality",
  219. "Set / constructor arguments",
  220. "Set / constructor requires new",
  221. "Set / constructor accepts null",
  222. "Set / constructor invokes add",
  223. "Set / iterator closing",
  224. "Set / Set.prototype.add returns this",
  225. "Set / -0 key converts to +0",
  226. "Set / Set.prototype.size",
  227. "Set / Set.prototype.delete",
  228. "Set / Set.prototype.clear",
  229. "Set / Set.prototype.forEach",
  230. "Set / Set.prototype.keys",
  231. "Set / Set.prototype.values",
  232. "Set / Set.prototype.entries",
  233. "Set / Set.prototype[Symbol.iterator]",
  234. "Set / Set.prototype isn't an instance",
  235. "Set / Set iterator prototype chain",
  236. "Set / Set[Symbol.species]",
  237. ],
  238. },
  239. "es6.symbol": {
  240. features: [
  241. "Symbol",
  242. "Object static methods / Object.getOwnPropertySymbols",
  243. "well-known symbols / Symbol.hasInstance",
  244. "well-known symbols / Symbol.isConcatSpreadable",
  245. "well-known symbols / Symbol.iterator",
  246. "well-known symbols / Symbol.match",
  247. "well-known symbols / Symbol.replace",
  248. "well-known symbols / Symbol.search",
  249. "well-known symbols / Symbol.species",
  250. "well-known symbols / Symbol.split",
  251. "well-known symbols / Symbol.toPrimitive",
  252. "well-known symbols / Symbol.toStringTag",
  253. "well-known symbols / Symbol.unscopables",
  254. ],
  255. },
  256. "es7.symbol.async-iterator": "Asynchronous Iterators",
  257. "es6.string.anchor": "String.prototype HTML methods",
  258. "es6.string.big": "String.prototype HTML methods",
  259. "es6.string.blink": "String.prototype HTML methods",
  260. "es6.string.bold": "String.prototype HTML methods",
  261. "es6.string.code-point-at": "String.prototype methods / String.prototype.codePointAt",
  262. "es6.string.ends-with": "String.prototype methods / String.prototype.endsWith",
  263. "es6.string.fixed": "String.prototype HTML methods",
  264. "es6.string.fontcolor": "String.prototype HTML methods",
  265. "es6.string.fontsize": "String.prototype HTML methods",
  266. "es6.string.from-code-point": "String static methods / String.fromCodePoint",
  267. "es6.string.includes": "String.prototype methods / String.prototype.includes",
  268. "es6.string.italics": "String.prototype HTML methods",
  269. "es6.string.iterator": "String.prototype methods / String.prototype[Symbol.iterator]",
  270. "es6.string.link": "String.prototype HTML methods",
  271. // "String.prototype methods / String.prototype.normalize" not implemented
  272. "es7.string.pad-start": "String padding / String.prototype.padStart",
  273. "es7.string.pad-end": "String padding / String.prototype.padEnd",
  274. "es6.string.raw": "String static methods / String.raw",
  275. "es6.string.repeat": "String.prototype methods / String.prototype.repeat",
  276. "es6.string.small": "String.prototype HTML methods",
  277. "es6.string.starts-with": "String.prototype methods / String.prototype.startsWith",
  278. "es6.string.strike": "String.prototype HTML methods",
  279. "es6.string.sub": "String.prototype HTML methods",
  280. "es6.string.sup": "String.prototype HTML methods",
  281. "es6.string.trim": "String properties and methods / String.prototype.trim",
  282. "es7.string.trim-left": "string trimming / String.prototype.trimStart",
  283. "es7.string.trim-right": "string trimming / String.prototype.trimEnd",
  284. "es6.typed.array-buffer": "typed arrays / ArrayBuffer[Symbol.species]",
  285. "es6.typed.data-view": "typed arrays / DataView",
  286. "es6.typed.int8-array": {
  287. features: ["typed arrays / Int8Array"].concat(typedArrayMethods),
  288. },
  289. "es6.typed.uint8-array": {
  290. features: ["typed arrays / Uint8Array"].concat(typedArrayMethods),
  291. },
  292. "es6.typed.uint8-clamped-array": {
  293. features: ["typed arrays / Uint8ClampedArray"].concat(typedArrayMethods),
  294. },
  295. "es6.typed.int16-array": {
  296. features: ["typed arrays / Int16Array"].concat(typedArrayMethods),
  297. },
  298. "es6.typed.uint16-array": {
  299. features: ["typed arrays / Uint16Array"].concat(typedArrayMethods),
  300. },
  301. "es6.typed.int32-array": {
  302. features: ["typed arrays / Int32Array"].concat(typedArrayMethods),
  303. },
  304. "es6.typed.uint32-array": {
  305. features: ["typed arrays / Uint32Array"].concat(typedArrayMethods),
  306. },
  307. "es6.typed.float32-array": {
  308. features: ["typed arrays / Float32Array"].concat(typedArrayMethods),
  309. },
  310. "es6.typed.float64-array": {
  311. features: ["typed arrays / Float64Array"].concat(typedArrayMethods),
  312. },
  313. "es6.weak-map": "WeakMap",
  314. "es6.weak-set": "WeakSet",
  315. };
  316. const proposals = require("./shipped-proposals").builtIns;
  317. module.exports = Object.assign({}, es, proposals);