55ef40eb7a8e978ced907906c8388c7b53d44e658a33c667ecdb031fb22b4635596594f2dccd2676f049c979478439839cd1ee8166bcfdab5f9e333986f32f 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. "use strict";
  2. var _index = require("../index");
  3. var t = _interopRequireWildcard(_index);
  4. var _constants = require("../constants");
  5. var _index2 = require("./index");
  6. var _index3 = _interopRequireDefault(_index2);
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  9. (0, _index3.default)("ArrayExpression", {
  10. fields: {
  11. elements: {
  12. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
  13. default: []
  14. }
  15. },
  16. visitor: ["elements"],
  17. aliases: ["Expression"]
  18. });
  19. (0, _index3.default)("AssignmentExpression", {
  20. fields: {
  21. operator: {
  22. validate: (0, _index2.assertValueType)("string")
  23. },
  24. left: {
  25. validate: (0, _index2.assertNodeType)("LVal")
  26. },
  27. right: {
  28. validate: (0, _index2.assertNodeType)("Expression")
  29. }
  30. },
  31. builder: ["operator", "left", "right"],
  32. visitor: ["left", "right"],
  33. aliases: ["Expression"]
  34. });
  35. (0, _index3.default)("BinaryExpression", {
  36. builder: ["operator", "left", "right"],
  37. fields: {
  38. operator: {
  39. validate: _index2.assertOneOf.apply(undefined, _constants.BINARY_OPERATORS)
  40. },
  41. left: {
  42. validate: (0, _index2.assertNodeType)("Expression")
  43. },
  44. right: {
  45. validate: (0, _index2.assertNodeType)("Expression")
  46. }
  47. },
  48. visitor: ["left", "right"],
  49. aliases: ["Binary", "Expression"]
  50. });
  51. (0, _index3.default)("Directive", {
  52. visitor: ["value"],
  53. fields: {
  54. value: {
  55. validate: (0, _index2.assertNodeType)("DirectiveLiteral")
  56. }
  57. }
  58. });
  59. (0, _index3.default)("DirectiveLiteral", {
  60. builder: ["value"],
  61. fields: {
  62. value: {
  63. validate: (0, _index2.assertValueType)("string")
  64. }
  65. }
  66. });
  67. (0, _index3.default)("BlockStatement", {
  68. builder: ["body", "directives"],
  69. visitor: ["directives", "body"],
  70. fields: {
  71. directives: {
  72. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))),
  73. default: []
  74. },
  75. body: {
  76. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement")))
  77. }
  78. },
  79. aliases: ["Scopable", "BlockParent", "Block", "Statement"]
  80. });
  81. (0, _index3.default)("BreakStatement", {
  82. visitor: ["label"],
  83. fields: {
  84. label: {
  85. validate: (0, _index2.assertNodeType)("Identifier"),
  86. optional: true
  87. }
  88. },
  89. aliases: ["Statement", "Terminatorless", "CompletionStatement"]
  90. });
  91. (0, _index3.default)("CallExpression", {
  92. visitor: ["callee", "arguments"],
  93. fields: {
  94. callee: {
  95. validate: (0, _index2.assertNodeType)("Expression")
  96. },
  97. arguments: {
  98. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement")))
  99. }
  100. },
  101. aliases: ["Expression"]
  102. });
  103. (0, _index3.default)("CatchClause", {
  104. visitor: ["param", "body"],
  105. fields: {
  106. param: {
  107. validate: (0, _index2.assertNodeType)("Identifier")
  108. },
  109. body: {
  110. validate: (0, _index2.assertNodeType)("BlockStatement")
  111. }
  112. },
  113. aliases: ["Scopable"]
  114. });
  115. (0, _index3.default)("ConditionalExpression", {
  116. visitor: ["test", "consequent", "alternate"],
  117. fields: {
  118. test: {
  119. validate: (0, _index2.assertNodeType)("Expression")
  120. },
  121. consequent: {
  122. validate: (0, _index2.assertNodeType)("Expression")
  123. },
  124. alternate: {
  125. validate: (0, _index2.assertNodeType)("Expression")
  126. }
  127. },
  128. aliases: ["Expression", "Conditional"]
  129. });
  130. (0, _index3.default)("ContinueStatement", {
  131. visitor: ["label"],
  132. fields: {
  133. label: {
  134. validate: (0, _index2.assertNodeType)("Identifier"),
  135. optional: true
  136. }
  137. },
  138. aliases: ["Statement", "Terminatorless", "CompletionStatement"]
  139. });
  140. (0, _index3.default)("DebuggerStatement", {
  141. aliases: ["Statement"]
  142. });
  143. (0, _index3.default)("DoWhileStatement", {
  144. visitor: ["test", "body"],
  145. fields: {
  146. test: {
  147. validate: (0, _index2.assertNodeType)("Expression")
  148. },
  149. body: {
  150. validate: (0, _index2.assertNodeType)("Statement")
  151. }
  152. },
  153. aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
  154. });
  155. (0, _index3.default)("EmptyStatement", {
  156. aliases: ["Statement"]
  157. });
  158. (0, _index3.default)("ExpressionStatement", {
  159. visitor: ["expression"],
  160. fields: {
  161. expression: {
  162. validate: (0, _index2.assertNodeType)("Expression")
  163. }
  164. },
  165. aliases: ["Statement", "ExpressionWrapper"]
  166. });
  167. (0, _index3.default)("File", {
  168. builder: ["program", "comments", "tokens"],
  169. visitor: ["program"],
  170. fields: {
  171. program: {
  172. validate: (0, _index2.assertNodeType)("Program")
  173. }
  174. }
  175. });
  176. (0, _index3.default)("ForInStatement", {
  177. visitor: ["left", "right", "body"],
  178. aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
  179. fields: {
  180. left: {
  181. validate: (0, _index2.assertNodeType)("VariableDeclaration", "LVal")
  182. },
  183. right: {
  184. validate: (0, _index2.assertNodeType)("Expression")
  185. },
  186. body: {
  187. validate: (0, _index2.assertNodeType)("Statement")
  188. }
  189. }
  190. });
  191. (0, _index3.default)("ForStatement", {
  192. visitor: ["init", "test", "update", "body"],
  193. aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
  194. fields: {
  195. init: {
  196. validate: (0, _index2.assertNodeType)("VariableDeclaration", "Expression"),
  197. optional: true
  198. },
  199. test: {
  200. validate: (0, _index2.assertNodeType)("Expression"),
  201. optional: true
  202. },
  203. update: {
  204. validate: (0, _index2.assertNodeType)("Expression"),
  205. optional: true
  206. },
  207. body: {
  208. validate: (0, _index2.assertNodeType)("Statement")
  209. }
  210. }
  211. });
  212. (0, _index3.default)("FunctionDeclaration", {
  213. builder: ["id", "params", "body", "generator", "async"],
  214. visitor: ["id", "params", "body", "returnType", "typeParameters"],
  215. fields: {
  216. id: {
  217. validate: (0, _index2.assertNodeType)("Identifier")
  218. },
  219. params: {
  220. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal")))
  221. },
  222. body: {
  223. validate: (0, _index2.assertNodeType)("BlockStatement")
  224. },
  225. generator: {
  226. default: false,
  227. validate: (0, _index2.assertValueType)("boolean")
  228. },
  229. async: {
  230. default: false,
  231. validate: (0, _index2.assertValueType)("boolean")
  232. }
  233. },
  234. aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"]
  235. });
  236. (0, _index3.default)("FunctionExpression", {
  237. inherits: "FunctionDeclaration",
  238. aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
  239. fields: {
  240. id: {
  241. validate: (0, _index2.assertNodeType)("Identifier"),
  242. optional: true
  243. },
  244. params: {
  245. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal")))
  246. },
  247. body: {
  248. validate: (0, _index2.assertNodeType)("BlockStatement")
  249. },
  250. generator: {
  251. default: false,
  252. validate: (0, _index2.assertValueType)("boolean")
  253. },
  254. async: {
  255. default: false,
  256. validate: (0, _index2.assertValueType)("boolean")
  257. }
  258. }
  259. });
  260. (0, _index3.default)("Identifier", {
  261. builder: ["name"],
  262. visitor: ["typeAnnotation"],
  263. aliases: ["Expression", "LVal"],
  264. fields: {
  265. name: {
  266. validate: function validate(node, key, val) {
  267. if (!t.isValidIdentifier(val)) {}
  268. }
  269. },
  270. decorators: {
  271. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator")))
  272. }
  273. }
  274. });
  275. (0, _index3.default)("IfStatement", {
  276. visitor: ["test", "consequent", "alternate"],
  277. aliases: ["Statement", "Conditional"],
  278. fields: {
  279. test: {
  280. validate: (0, _index2.assertNodeType)("Expression")
  281. },
  282. consequent: {
  283. validate: (0, _index2.assertNodeType)("Statement")
  284. },
  285. alternate: {
  286. optional: true,
  287. validate: (0, _index2.assertNodeType)("Statement")
  288. }
  289. }
  290. });
  291. (0, _index3.default)("LabeledStatement", {
  292. visitor: ["label", "body"],
  293. aliases: ["Statement"],
  294. fields: {
  295. label: {
  296. validate: (0, _index2.assertNodeType)("Identifier")
  297. },
  298. body: {
  299. validate: (0, _index2.assertNodeType)("Statement")
  300. }
  301. }
  302. });
  303. (0, _index3.default)("StringLiteral", {
  304. builder: ["value"],
  305. fields: {
  306. value: {
  307. validate: (0, _index2.assertValueType)("string")
  308. }
  309. },
  310. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  311. });
  312. (0, _index3.default)("NumericLiteral", {
  313. builder: ["value"],
  314. deprecatedAlias: "NumberLiteral",
  315. fields: {
  316. value: {
  317. validate: (0, _index2.assertValueType)("number")
  318. }
  319. },
  320. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  321. });
  322. (0, _index3.default)("NullLiteral", {
  323. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  324. });
  325. (0, _index3.default)("BooleanLiteral", {
  326. builder: ["value"],
  327. fields: {
  328. value: {
  329. validate: (0, _index2.assertValueType)("boolean")
  330. }
  331. },
  332. aliases: ["Expression", "Pureish", "Literal", "Immutable"]
  333. });
  334. (0, _index3.default)("RegExpLiteral", {
  335. builder: ["pattern", "flags"],
  336. deprecatedAlias: "RegexLiteral",
  337. aliases: ["Expression", "Literal"],
  338. fields: {
  339. pattern: {
  340. validate: (0, _index2.assertValueType)("string")
  341. },
  342. flags: {
  343. validate: (0, _index2.assertValueType)("string"),
  344. default: ""
  345. }
  346. }
  347. });
  348. (0, _index3.default)("LogicalExpression", {
  349. builder: ["operator", "left", "right"],
  350. visitor: ["left", "right"],
  351. aliases: ["Binary", "Expression"],
  352. fields: {
  353. operator: {
  354. validate: _index2.assertOneOf.apply(undefined, _constants.LOGICAL_OPERATORS)
  355. },
  356. left: {
  357. validate: (0, _index2.assertNodeType)("Expression")
  358. },
  359. right: {
  360. validate: (0, _index2.assertNodeType)("Expression")
  361. }
  362. }
  363. });
  364. (0, _index3.default)("MemberExpression", {
  365. builder: ["object", "property", "computed"],
  366. visitor: ["object", "property"],
  367. aliases: ["Expression", "LVal"],
  368. fields: {
  369. object: {
  370. validate: (0, _index2.assertNodeType)("Expression")
  371. },
  372. property: {
  373. validate: function validate(node, key, val) {
  374. var expectedType = node.computed ? "Expression" : "Identifier";
  375. (0, _index2.assertNodeType)(expectedType)(node, key, val);
  376. }
  377. },
  378. computed: {
  379. default: false
  380. }
  381. }
  382. });
  383. (0, _index3.default)("NewExpression", {
  384. visitor: ["callee", "arguments"],
  385. aliases: ["Expression"],
  386. fields: {
  387. callee: {
  388. validate: (0, _index2.assertNodeType)("Expression")
  389. },
  390. arguments: {
  391. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement")))
  392. }
  393. }
  394. });
  395. (0, _index3.default)("Program", {
  396. visitor: ["directives", "body"],
  397. builder: ["body", "directives"],
  398. fields: {
  399. directives: {
  400. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))),
  401. default: []
  402. },
  403. body: {
  404. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement")))
  405. }
  406. },
  407. aliases: ["Scopable", "BlockParent", "Block", "FunctionParent"]
  408. });
  409. (0, _index3.default)("ObjectExpression", {
  410. visitor: ["properties"],
  411. aliases: ["Expression"],
  412. fields: {
  413. properties: {
  414. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadProperty")))
  415. }
  416. }
  417. });
  418. (0, _index3.default)("ObjectMethod", {
  419. builder: ["kind", "key", "params", "body", "computed"],
  420. fields: {
  421. kind: {
  422. validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("method", "get", "set")),
  423. default: "method"
  424. },
  425. computed: {
  426. validate: (0, _index2.assertValueType)("boolean"),
  427. default: false
  428. },
  429. key: {
  430. validate: function validate(node, key, val) {
  431. var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
  432. _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
  433. }
  434. },
  435. decorators: {
  436. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator")))
  437. },
  438. body: {
  439. validate: (0, _index2.assertNodeType)("BlockStatement")
  440. },
  441. generator: {
  442. default: false,
  443. validate: (0, _index2.assertValueType)("boolean")
  444. },
  445. async: {
  446. default: false,
  447. validate: (0, _index2.assertValueType)("boolean")
  448. }
  449. },
  450. visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
  451. aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
  452. });
  453. (0, _index3.default)("ObjectProperty", {
  454. builder: ["key", "value", "computed", "shorthand", "decorators"],
  455. fields: {
  456. computed: {
  457. validate: (0, _index2.assertValueType)("boolean"),
  458. default: false
  459. },
  460. key: {
  461. validate: function validate(node, key, val) {
  462. var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
  463. _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
  464. }
  465. },
  466. value: {
  467. validate: (0, _index2.assertNodeType)("Expression", "Pattern", "RestElement")
  468. },
  469. shorthand: {
  470. validate: (0, _index2.assertValueType)("boolean"),
  471. default: false
  472. },
  473. decorators: {
  474. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))),
  475. optional: true
  476. }
  477. },
  478. visitor: ["key", "value", "decorators"],
  479. aliases: ["UserWhitespacable", "Property", "ObjectMember"]
  480. });
  481. (0, _index3.default)("RestElement", {
  482. visitor: ["argument", "typeAnnotation"],
  483. aliases: ["LVal"],
  484. fields: {
  485. argument: {
  486. validate: (0, _index2.assertNodeType)("LVal")
  487. },
  488. decorators: {
  489. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator")))
  490. }
  491. }
  492. });
  493. (0, _index3.default)("ReturnStatement", {
  494. visitor: ["argument"],
  495. aliases: ["Statement", "Terminatorless", "CompletionStatement"],
  496. fields: {
  497. argument: {
  498. validate: (0, _index2.assertNodeType)("Expression"),
  499. optional: true
  500. }
  501. }
  502. });
  503. (0, _index3.default)("SequenceExpression", {
  504. visitor: ["expressions"],
  505. fields: {
  506. expressions: {
  507. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression")))
  508. }
  509. },
  510. aliases: ["Expression"]
  511. });
  512. (0, _index3.default)("SwitchCase", {
  513. visitor: ["test", "consequent"],
  514. fields: {
  515. test: {
  516. validate: (0, _index2.assertNodeType)("Expression"),
  517. optional: true
  518. },
  519. consequent: {
  520. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement")))
  521. }
  522. }
  523. });
  524. (0, _index3.default)("SwitchStatement", {
  525. visitor: ["discriminant", "cases"],
  526. aliases: ["Statement", "BlockParent", "Scopable"],
  527. fields: {
  528. discriminant: {
  529. validate: (0, _index2.assertNodeType)("Expression")
  530. },
  531. cases: {
  532. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("SwitchCase")))
  533. }
  534. }
  535. });
  536. (0, _index3.default)("ThisExpression", {
  537. aliases: ["Expression"]
  538. });
  539. (0, _index3.default)("ThrowStatement", {
  540. visitor: ["argument"],
  541. aliases: ["Statement", "Terminatorless", "CompletionStatement"],
  542. fields: {
  543. argument: {
  544. validate: (0, _index2.assertNodeType)("Expression")
  545. }
  546. }
  547. });
  548. (0, _index3.default)("TryStatement", {
  549. visitor: ["block", "handler", "finalizer"],
  550. aliases: ["Statement"],
  551. fields: {
  552. body: {
  553. validate: (0, _index2.assertNodeType)("BlockStatement")
  554. },
  555. handler: {
  556. optional: true,
  557. handler: (0, _index2.assertNodeType)("BlockStatement")
  558. },
  559. finalizer: {
  560. optional: true,
  561. validate: (0, _index2.assertNodeType)("BlockStatement")
  562. }
  563. }
  564. });
  565. (0, _index3.default)("UnaryExpression", {
  566. builder: ["operator", "argument", "prefix"],
  567. fields: {
  568. prefix: {
  569. default: true
  570. },
  571. argument: {
  572. validate: (0, _index2.assertNodeType)("Expression")
  573. },
  574. operator: {
  575. validate: _index2.assertOneOf.apply(undefined, _constants.UNARY_OPERATORS)
  576. }
  577. },
  578. visitor: ["argument"],
  579. aliases: ["UnaryLike", "Expression"]
  580. });
  581. (0, _index3.default)("UpdateExpression", {
  582. builder: ["operator", "argument", "prefix"],
  583. fields: {
  584. prefix: {
  585. default: false
  586. },
  587. argument: {
  588. validate: (0, _index2.assertNodeType)("Expression")
  589. },
  590. operator: {
  591. validate: _index2.assertOneOf.apply(undefined, _constants.UPDATE_OPERATORS)
  592. }
  593. },
  594. visitor: ["argument"],
  595. aliases: ["Expression"]
  596. });
  597. (0, _index3.default)("VariableDeclaration", {
  598. builder: ["kind", "declarations"],
  599. visitor: ["declarations"],
  600. aliases: ["Statement", "Declaration"],
  601. fields: {
  602. kind: {
  603. validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("var", "let", "const"))
  604. },
  605. declarations: {
  606. validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("VariableDeclarator")))
  607. }
  608. }
  609. });
  610. (0, _index3.default)("VariableDeclarator", {
  611. visitor: ["id", "init"],
  612. fields: {
  613. id: {
  614. validate: (0, _index2.assertNodeType)("LVal")
  615. },
  616. init: {
  617. optional: true,
  618. validate: (0, _index2.assertNodeType)("Expression")
  619. }
  620. }
  621. });
  622. (0, _index3.default)("WhileStatement", {
  623. visitor: ["test", "body"],
  624. aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
  625. fields: {
  626. test: {
  627. validate: (0, _index2.assertNodeType)("Expression")
  628. },
  629. body: {
  630. validate: (0, _index2.assertNodeType)("BlockStatement", "Statement")
  631. }
  632. }
  633. });
  634. (0, _index3.default)("WithStatement", {
  635. visitor: ["object", "body"],
  636. aliases: ["Statement"],
  637. fields: {
  638. object: {
  639. object: (0, _index2.assertNodeType)("Expression")
  640. },
  641. body: {
  642. validate: (0, _index2.assertNodeType)("BlockStatement", "Statement")
  643. }
  644. }
  645. });