input.js 927 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // ---------------------
  2. // Should pass through unaltered
  3. // ---------------------
  4. var f1 = function({value}) {
  5. return "somestring"
  6. }
  7. function f2({value}) {
  8. return "somestring"
  9. }
  10. class f3 {
  11. method1() {
  12. return "whatever"
  13. }
  14. }
  15. var f4 = (
  16. <div>
  17. {(() => <span></span>)()}
  18. </div>
  19. )
  20. // Known component which doesn't sit directly on the `Program` node get left alone
  21. {
  22. var Component5c = function () {
  23. function Component5c () {}
  24. return Component5c
  25. }()
  26. }
  27. // ---------------------
  28. // Not supported
  29. // ---------------------
  30. // High-order things will be hard to catch
  31. var jsxChunk = <div>{value}</div>
  32. function UnsupportedComponent1({value}) {
  33. return function() {
  34. return jsxChunk
  35. }
  36. }
  37. var a = {
  38. smoke: function() {},
  39. Component1d: function ({value}) {
  40. return <div>{value}</div>
  41. }
  42. }
  43. var external = function() {
  44. var internal = function() {
  45. return <div />
  46. }
  47. return internal
  48. }