BVB Source Codes

prettier Show create_class_statics_sealed.js Source code

Return Download prettier: download create_class_statics_sealed.js Source code - Download prettier Source code - Type:.js
  1. import React from "react";
  2.  
  3. // statics = None
  4. const A = React.createClass({ p: 0 });
  5. (A.bar: empty); // number ~> empty (inflow below)
  6. A.bar = 0;
  7.  
  8. // statics = Some (exact & sealed) [lit]
  9. const B = React.createClass({
  10.   statics: { foo: 0 },
  11. });
  12. (B.foo: empty); // number ~> empty
  13. (B.bar: empty); // number ~> empty (inflow below)
  14. B.bar = 0;
  15.  
  16. // statics = Some (exact & sealed) [annot]
  17. const C = React.createClass({
  18.   statics: ({ foo: 0 }: {| foo: number |}),
  19. });
  20. (C.foo: empty); // number ~> empty
  21. (C.bar: empty); // number ~> empty (inflow below)
  22. C.bar = 0;
  23.  
  24. // statics = Some (inexact & sealed) [annot]
  25. const D = React.createClass({
  26.   statics: ({ foo: 0 }: { foo: number }),
  27. });
  28. (D.foo: empty); // number ~> empty
  29. (D.bar: empty); // property `bar` not found
  30. D.bar = 0; // property `bar` not found
  31.  
  32. // mixins: (exact & sealed) + (exact & sealed)
  33. const E = React.createClass({
  34.   mixins: [{
  35.     statics: { foo: 0 },
  36.   }],
  37.   statics: { bar: 0 },
  38. });
  39. (E.foo: empty); // number ~> empty
  40. (E.bar: empty); // number ~> empty
  41. (E.baz: empty); // number ~> empty (inflow below)
  42. E.baz = 0;
  43.  
  44. // mixins: (exact & sealed) + (inexact & sealed)
  45. const F = React.createClass({
  46.   mixins: [{
  47.     statics: ({ foo: 0 }: { foo: number }),
  48.   }],
  49.   statics: { bar: 0 },
  50. });
  51. (F.foo: empty); // number ~> empty
  52. (F.bar: empty); // number ~> empty
  53. (F.baz: empty); // number ~> empty (inflow below)
  54. F.baz = 0;
  55.  
downloadcreate_class_statics_sealed.js Source code - Download prettier Source code
Related Source Codes/Software:
storybook - 2017-06-07
ionicons - The premium icon font for Ionic ... 2017-06-07
AsyncDisplayKit - Smooth asynchronous user interfaces for iOS apps. ... 2017-06-07
lottie-android - Render After Effects animations natively on Androi... 2017-06-07
parse-server - Parse-compatible API server module for Node/Expres... 2017-06-07
inferno - An extremely fast, React-like JavaScript library f... 2017-06-08
guetzli - Perceptual JPEG encoder 2017-06-08
cs-video-courses - List of Computer Science courses with video lectur... 2017-06-08
interviews - Everything you need to know to get the job. 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top