built-in-features.js 15 KB

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