plugin-features.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. const es = {
  2. "transform-template-literals": {
  3. features: ["template literals"],
  4. },
  5. "transform-literals": {
  6. features: ["Unicode code point escapes"],
  7. },
  8. "transform-function-name": {
  9. features: ['function "name" property'],
  10. },
  11. "transform-arrow-functions": {
  12. features: ["arrow functions"],
  13. },
  14. "transform-block-scoped-functions": {
  15. features: ["block-level function declaration"],
  16. },
  17. "transform-classes": {
  18. features: ["class", "super"],
  19. },
  20. "transform-object-super": {
  21. features: ["super"],
  22. },
  23. "transform-shorthand-properties": {
  24. features: ["object literal extensions / shorthand properties"],
  25. },
  26. "transform-duplicate-keys": {
  27. features: ["miscellaneous / duplicate property names in strict mode"],
  28. },
  29. "transform-computed-properties": {
  30. features: ["object literal extensions / computed properties"],
  31. },
  32. "transform-for-of": {
  33. features: ["for..of loops"],
  34. },
  35. "transform-sticky-regex": {
  36. features: [
  37. 'RegExp "y" and "u" flags / "y" flag, lastIndex',
  38. 'RegExp "y" and "u" flags / "y" flag',
  39. ],
  40. },
  41. // We want to apply this prior to unicode regex so that "." and "u"
  42. // are properly handled.
  43. //
  44. // Ref: https://github.com/babel/babel/pull/7065#issuecomment-395959112
  45. "transform-dotall-regex": "s (dotAll) flag for regular expressions",
  46. "transform-unicode-regex": {
  47. features: [
  48. 'RegExp "y" and "u" flags / "u" flag, case folding',
  49. 'RegExp "y" and "u" flags / "u" flag, Unicode code point escapes',
  50. 'RegExp "y" and "u" flags / "u" flag, non-BMP Unicode characters',
  51. 'RegExp "y" and "u" flags / "u" flag',
  52. ],
  53. },
  54. "transform-spread": {
  55. features: "spread syntax for iterable objects",
  56. },
  57. "transform-parameters": {
  58. features: [
  59. "default function parameters",
  60. "rest parameters",
  61. "destructuring, parameters / defaults, arrow function",
  62. ],
  63. },
  64. "transform-destructuring": {
  65. features: [
  66. "destructuring, assignment",
  67. "destructuring, declarations",
  68. "destructuring, parameters",
  69. ],
  70. },
  71. "transform-block-scoping": {
  72. features: ["const", "let"],
  73. },
  74. "transform-typeof-symbol": {
  75. features: ["Symbol / typeof support"],
  76. },
  77. "transform-new-target": {
  78. features: ["new.target"],
  79. },
  80. "transform-regenerator": {
  81. features: ["generators"],
  82. },
  83. "transform-exponentiation-operator": {
  84. features: ["exponentiation (**) operator"],
  85. },
  86. "transform-async-to-generator": {
  87. features: ["async functions"],
  88. },
  89. "proposal-async-generator-functions": "Asynchronous Iterators",
  90. "proposal-object-rest-spread": "object rest/spread properties",
  91. "proposal-unicode-property-regex": "RegExp Unicode Property Escapes",
  92. "proposal-json-strings": "JSON superset",
  93. "proposal-optional-catch-binding": "optional catch binding",
  94. "transform-named-capturing-groups-regex": "RegExp named capture groups",
  95. };
  96. const proposals = require("./shipped-proposals").features;
  97. module.exports = Object.assign({}, es, proposals);