bundle-test.js 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409
  1. 'use strict';
  2. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  3. var syntaxJsx = _interopDefault(require('babel-plugin-syntax-jsx'));
  4. var cov_10u8a89794 = function () {
  5. var path = '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/group-event-attributes.js',
  6. hash = '27cab2aae265cb2fd54e5c36a9c17d8fe4d5cfc5',
  7. global = new Function('return this')(),
  8. gcv = '__coverage__',
  9. coverageData = {
  10. path: '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/group-event-attributes.js',
  11. statementMap: {
  12. '0': {
  13. start: {
  14. line: 1,
  15. column: 20
  16. },
  17. end: {
  18. line: 42,
  19. column: 1
  20. }
  21. },
  22. '1': {
  23. start: {
  24. line: 2,
  25. column: 2
  26. },
  27. end: {
  28. line: 4,
  29. column: 3
  30. }
  31. },
  32. '2': {
  33. start: {
  34. line: 3,
  35. column: 4
  36. },
  37. end: {
  38. line: 3,
  39. column: 14
  40. }
  41. },
  42. '3': {
  43. start: {
  44. line: 6,
  45. column: 23
  46. },
  47. end: {
  48. line: 6,
  49. column: 67
  50. }
  51. },
  52. '4': {
  53. start: {
  54. line: 7,
  55. column: 16
  56. },
  57. end: {
  58. line: 7,
  59. column: 112
  60. }
  61. },
  62. '5': {
  63. start: {
  64. line: 8,
  65. column: 20
  66. },
  67. end: {
  68. line: 8,
  69. column: 117
  70. }
  71. },
  72. '6': {
  73. start: {
  74. line: 10,
  75. column: 2
  76. },
  77. end: {
  78. line: 12,
  79. column: 3
  80. }
  81. },
  82. '7': {
  83. start: {
  84. line: 11,
  85. column: 4
  86. },
  87. end: {
  88. line: 11,
  89. column: 14
  90. }
  91. },
  92. '8': {
  93. start: {
  94. line: 14,
  95. column: 16
  96. },
  97. end: {
  98. line: 14,
  99. column: 38
  100. }
  101. },
  102. '9': {
  103. start: {
  104. line: 16,
  105. column: 2
  106. },
  107. end: {
  108. line: 16,
  109. column: 20
  110. }
  111. },
  112. '10': {
  113. start: {
  114. line: 17,
  115. column: 2
  116. },
  117. end: {
  118. line: 19,
  119. column: 3
  120. }
  121. },
  122. '11': {
  123. start: {
  124. line: 18,
  125. column: 4
  126. },
  127. end: {
  128. line: 18,
  129. column: 14
  130. }
  131. },
  132. '12': {
  133. start: {
  134. line: 21,
  135. column: 21
  136. },
  137. end: {
  138. line: 21,
  139. column: 49
  140. }
  141. },
  142. '13': {
  143. start: {
  144. line: 23,
  145. column: 18
  146. },
  147. end: {
  148. line: 23,
  149. column: 33
  150. }
  151. },
  152. '14': {
  153. start: {
  154. line: 24,
  155. column: 2
  156. },
  157. end: {
  158. line: 26,
  159. column: 3
  160. }
  161. },
  162. '15': {
  163. start: {
  164. line: 25,
  165. column: 4
  166. },
  167. end: {
  168. line: 25,
  169. column: 35
  170. }
  171. },
  172. '16': {
  173. start: {
  174. line: 27,
  175. column: 2
  176. },
  177. end: {
  178. line: 27,
  179. column: 62
  180. }
  181. },
  182. '17': {
  183. start: {
  184. line: 28,
  185. column: 2
  186. },
  187. end: {
  188. line: 30,
  189. column: 3
  190. }
  191. },
  192. '18': {
  193. start: {
  194. line: 29,
  195. column: 4
  196. },
  197. end: {
  198. line: 29,
  199. column: 31
  200. }
  201. },
  202. '19': {
  203. start: {
  204. line: 31,
  205. column: 2
  206. },
  207. end: {
  208. line: 33,
  209. column: 3
  210. }
  211. },
  212. '20': {
  213. start: {
  214. line: 32,
  215. column: 4
  216. },
  217. end: {
  218. line: 32,
  219. column: 31
  220. }
  221. },
  222. '21': {
  223. start: {
  224. line: 35,
  225. column: 2
  226. },
  227. end: {
  228. line: 37,
  229. column: 3
  230. }
  231. },
  232. '22': {
  233. start: {
  234. line: 36,
  235. column: 4
  236. },
  237. end: {
  238. line: 36,
  239. column: 23
  240. }
  241. },
  242. '23': {
  243. start: {
  244. line: 39,
  245. column: 2
  246. },
  247. end: {
  248. line: 39,
  249. column: 59
  250. }
  251. },
  252. '24': {
  253. start: {
  254. line: 41,
  255. column: 2
  256. },
  257. end: {
  258. line: 41,
  259. column: 12
  260. }
  261. }
  262. },
  263. fnMap: {
  264. '0': {
  265. name: '(anonymous_0)',
  266. decl: {
  267. start: {
  268. line: 1,
  269. column: 15
  270. },
  271. end: {
  272. line: 1,
  273. column: 16
  274. }
  275. },
  276. loc: {
  277. start: {
  278. line: 1,
  279. column: 20
  280. },
  281. end: {
  282. line: 42,
  283. column: 1
  284. }
  285. },
  286. line: 1
  287. },
  288. '1': {
  289. name: '(anonymous_1)',
  290. decl: {
  291. start: {
  292. line: 1,
  293. column: 20
  294. },
  295. end: {
  296. line: 1,
  297. column: 21
  298. }
  299. },
  300. loc: {
  301. start: {
  302. line: 1,
  303. column: 40
  304. },
  305. end: {
  306. line: 42,
  307. column: 1
  308. }
  309. },
  310. line: 1
  311. }
  312. },
  313. branchMap: {
  314. '0': {
  315. loc: {
  316. start: {
  317. line: 2,
  318. column: 2
  319. },
  320. end: {
  321. line: 4,
  322. column: 3
  323. }
  324. },
  325. type: 'if',
  326. locations: [{
  327. start: {
  328. line: 2,
  329. column: 2
  330. },
  331. end: {
  332. line: 4,
  333. column: 3
  334. }
  335. }, {
  336. start: {
  337. line: 2,
  338. column: 2
  339. },
  340. end: {
  341. line: 4,
  342. column: 3
  343. }
  344. }],
  345. line: 2
  346. },
  347. '1': {
  348. loc: {
  349. start: {
  350. line: 7,
  351. column: 17
  352. },
  353. end: {
  354. line: 7,
  355. column: 94
  356. }
  357. },
  358. type: 'cond-expr',
  359. locations: [{
  360. start: {
  361. line: 7,
  362. column: 32
  363. },
  364. end: {
  365. line: 7,
  366. column: 70
  367. }
  368. }, {
  369. start: {
  370. line: 7,
  371. column: 73
  372. },
  373. end: {
  374. line: 7,
  375. column: 94
  376. }
  377. }],
  378. line: 7
  379. },
  380. '2': {
  381. loc: {
  382. start: {
  383. line: 8,
  384. column: 20
  385. },
  386. end: {
  387. line: 8,
  388. column: 117
  389. }
  390. },
  391. type: 'cond-expr',
  392. locations: [{
  393. start: {
  394. line: 8,
  395. column: 35
  396. },
  397. end: {
  398. line: 8,
  399. column: 105
  400. }
  401. }, {
  402. start: {
  403. line: 8,
  404. column: 108
  405. },
  406. end: {
  407. line: 8,
  408. column: 117
  409. }
  410. }],
  411. line: 8
  412. },
  413. '3': {
  414. loc: {
  415. start: {
  416. line: 10,
  417. column: 2
  418. },
  419. end: {
  420. line: 12,
  421. column: 3
  422. }
  423. },
  424. type: 'if',
  425. locations: [{
  426. start: {
  427. line: 10,
  428. column: 2
  429. },
  430. end: {
  431. line: 12,
  432. column: 3
  433. }
  434. }, {
  435. start: {
  436. line: 10,
  437. column: 2
  438. },
  439. end: {
  440. line: 12,
  441. column: 3
  442. }
  443. }],
  444. line: 10
  445. },
  446. '4': {
  447. loc: {
  448. start: {
  449. line: 17,
  450. column: 2
  451. },
  452. end: {
  453. line: 19,
  454. column: 3
  455. }
  456. },
  457. type: 'if',
  458. locations: [{
  459. start: {
  460. line: 17,
  461. column: 2
  462. },
  463. end: {
  464. line: 19,
  465. column: 3
  466. }
  467. }, {
  468. start: {
  469. line: 17,
  470. column: 2
  471. },
  472. end: {
  473. line: 19,
  474. column: 3
  475. }
  476. }],
  477. line: 17
  478. },
  479. '5': {
  480. loc: {
  481. start: {
  482. line: 24,
  483. column: 2
  484. },
  485. end: {
  486. line: 26,
  487. column: 3
  488. }
  489. },
  490. type: 'if',
  491. locations: [{
  492. start: {
  493. line: 24,
  494. column: 2
  495. },
  496. end: {
  497. line: 26,
  498. column: 3
  499. }
  500. }, {
  501. start: {
  502. line: 24,
  503. column: 2
  504. },
  505. end: {
  506. line: 26,
  507. column: 3
  508. }
  509. }],
  510. line: 24
  511. },
  512. '6': {
  513. loc: {
  514. start: {
  515. line: 28,
  516. column: 2
  517. },
  518. end: {
  519. line: 30,
  520. column: 3
  521. }
  522. },
  523. type: 'if',
  524. locations: [{
  525. start: {
  526. line: 28,
  527. column: 2
  528. },
  529. end: {
  530. line: 30,
  531. column: 3
  532. }
  533. }, {
  534. start: {
  535. line: 28,
  536. column: 2
  537. },
  538. end: {
  539. line: 30,
  540. column: 3
  541. }
  542. }],
  543. line: 28
  544. },
  545. '7': {
  546. loc: {
  547. start: {
  548. line: 31,
  549. column: 2
  550. },
  551. end: {
  552. line: 33,
  553. column: 3
  554. }
  555. },
  556. type: 'if',
  557. locations: [{
  558. start: {
  559. line: 31,
  560. column: 2
  561. },
  562. end: {
  563. line: 33,
  564. column: 3
  565. }
  566. }, {
  567. start: {
  568. line: 31,
  569. column: 2
  570. },
  571. end: {
  572. line: 33,
  573. column: 3
  574. }
  575. }],
  576. line: 31
  577. },
  578. '8': {
  579. loc: {
  580. start: {
  581. line: 35,
  582. column: 2
  583. },
  584. end: {
  585. line: 37,
  586. column: 3
  587. }
  588. },
  589. type: 'if',
  590. locations: [{
  591. start: {
  592. line: 35,
  593. column: 2
  594. },
  595. end: {
  596. line: 37,
  597. column: 3
  598. }
  599. }, {
  600. start: {
  601. line: 35,
  602. column: 2
  603. },
  604. end: {
  605. line: 37,
  606. column: 3
  607. }
  608. }],
  609. line: 35
  610. }
  611. },
  612. s: {
  613. '0': 0,
  614. '1': 0,
  615. '2': 0,
  616. '3': 0,
  617. '4': 0,
  618. '5': 0,
  619. '6': 0,
  620. '7': 0,
  621. '8': 0,
  622. '9': 0,
  623. '10': 0,
  624. '11': 0,
  625. '12': 0,
  626. '13': 0,
  627. '14': 0,
  628. '15': 0,
  629. '16': 0,
  630. '17': 0,
  631. '18': 0,
  632. '19': 0,
  633. '20': 0,
  634. '21': 0,
  635. '22': 0,
  636. '23': 0,
  637. '24': 0
  638. },
  639. f: {
  640. '0': 0,
  641. '1': 0
  642. },
  643. b: {
  644. '0': [0, 0],
  645. '1': [0, 0],
  646. '2': [0, 0],
  647. '3': [0, 0],
  648. '4': [0, 0],
  649. '5': [0, 0],
  650. '6': [0, 0],
  651. '7': [0, 0],
  652. '8': [0, 0]
  653. },
  654. _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c'
  655. },
  656. coverage = global[gcv] || (global[gcv] = {});
  657. if (coverage[path] && coverage[path].hash === hash) {
  658. return coverage[path];
  659. }
  660. coverageData.hash = hash;
  661. return coverage[path] = coverageData;
  662. }();
  663. var groupEventAttributes = (function (t) {
  664. cov_10u8a89794.f[0]++;
  665. cov_10u8a89794.s[0]++;
  666. return function (obj, attribute) {
  667. cov_10u8a89794.f[1]++;
  668. cov_10u8a89794.s[1]++;
  669. if (t.isJSXSpreadAttribute(attribute)) {
  670. cov_10u8a89794.b[0][0]++;
  671. cov_10u8a89794.s[2]++;
  672. return obj;
  673. } else {
  674. cov_10u8a89794.b[0][1]++;
  675. }
  676. var isNamespaced = (cov_10u8a89794.s[3]++, t.isJSXNamespacedName(attribute.get('name')));
  677. var event = (cov_10u8a89794.s[4]++, (isNamespaced ? (cov_10u8a89794.b[1][0]++, attribute.get('name').get('namespace')) : (cov_10u8a89794.b[1][1]++, attribute.get('name'))).get('name').node);
  678. var modifiers = (cov_10u8a89794.s[5]++, isNamespaced ? (cov_10u8a89794.b[2][0]++, new Set(attribute.get('name').get('name').get('name').node.split('-'))) : (cov_10u8a89794.b[2][1]++, new Set()));
  679. cov_10u8a89794.s[6]++;
  680. if (event.indexOf('on') !== 0) {
  681. cov_10u8a89794.b[3][0]++;
  682. cov_10u8a89794.s[7]++;
  683. return obj;
  684. } else {
  685. cov_10u8a89794.b[3][1]++;
  686. }
  687. var value = (cov_10u8a89794.s[8]++, attribute.get('value'));
  688. cov_10u8a89794.s[9]++;
  689. attribute.remove();
  690. cov_10u8a89794.s[10]++;
  691. if (!t.isJSXExpressionContainer(value)) {
  692. cov_10u8a89794.b[4][0]++;
  693. cov_10u8a89794.s[11]++;
  694. return obj;
  695. } else {
  696. cov_10u8a89794.b[4][1]++;
  697. }
  698. var expression = (cov_10u8a89794.s[12]++, value.get('expression').node);
  699. var eventName = (cov_10u8a89794.s[13]++, event.substr(2));
  700. cov_10u8a89794.s[14]++;
  701. if (eventName[0] === '-') {
  702. cov_10u8a89794.b[5][0]++;
  703. cov_10u8a89794.s[15]++;
  704. eventName = eventName.substr(1);
  705. } else {
  706. cov_10u8a89794.b[5][1]++;
  707. }
  708. cov_10u8a89794.s[16]++;
  709. eventName = eventName[0].toLowerCase() + eventName.substr(1);
  710. cov_10u8a89794.s[17]++;
  711. if (modifiers.has('capture')) {
  712. cov_10u8a89794.b[6][0]++;
  713. cov_10u8a89794.s[18]++;
  714. eventName = '!' + eventName;
  715. } else {
  716. cov_10u8a89794.b[6][1]++;
  717. }
  718. cov_10u8a89794.s[19]++;
  719. if (modifiers.has('once')) {
  720. cov_10u8a89794.b[7][0]++;
  721. cov_10u8a89794.s[20]++;
  722. eventName = '~' + eventName;
  723. } else {
  724. cov_10u8a89794.b[7][1]++;
  725. }
  726. cov_10u8a89794.s[21]++;
  727. if (!obj[eventName]) {
  728. cov_10u8a89794.b[8][0]++;
  729. cov_10u8a89794.s[22]++;
  730. obj[eventName] = [];
  731. } else {
  732. cov_10u8a89794.b[8][1]++;
  733. }
  734. cov_10u8a89794.s[23]++;
  735. obj[eventName].push({ modifiers, expression, attribute });
  736. cov_10u8a89794.s[24]++;
  737. return obj;
  738. };
  739. });
  740. var cov_1rltg07vsx = function () {
  741. var path = '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/constants.js',
  742. hash = '5e383c3f2b1f822d166abc9d641e15bf0fc99eba',
  743. global = new Function('return this')(),
  744. gcv = '__coverage__',
  745. coverageData = {
  746. path: '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/constants.js',
  747. statementMap: {
  748. '0': {
  749. start: {
  750. line: 1,
  751. column: 23
  752. },
  753. end: {
  754. line: 11,
  755. column: 1
  756. }
  757. },
  758. '1': {
  759. start: {
  760. line: 13,
  761. column: 28
  762. },
  763. end: {
  764. line: 13,
  765. column: 60
  766. }
  767. },
  768. '2': {
  769. start: {
  770. line: 15,
  771. column: 25
  772. },
  773. end: {
  774. line: 15,
  775. column: 38
  776. }
  777. }
  778. },
  779. fnMap: {},
  780. branchMap: {},
  781. s: {
  782. '0': 0,
  783. '1': 0,
  784. '2': 0
  785. },
  786. f: {},
  787. b: {},
  788. _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c'
  789. },
  790. coverage = global[gcv] || (global[gcv] = {});
  791. if (coverage[path] && coverage[path].hash === hash) {
  792. return coverage[path];
  793. }
  794. coverageData.hash = hash;
  795. return coverage[path] = coverageData;
  796. }();
  797. var aliases = (cov_1rltg07vsx.s[0]++, {
  798. esc: 27,
  799. tab: 9,
  800. enter: 13,
  801. space: 32,
  802. up: 38,
  803. left: 37,
  804. right: 39,
  805. down: 40,
  806. delete: [8, 46]
  807. });
  808. var keyModifiers = (cov_1rltg07vsx.s[1]++, ['ctrl', 'shift', 'alt', 'meta']);
  809. var keyCodeRE = (cov_1rltg07vsx.s[2]++, /^k(\d{1,})$/);
  810. var cov_28cz23z0dk = function () {
  811. var path = '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/generate-binding-body.js',
  812. hash = '034116a2beaa240e6479f1fafe6f22bfb8397848',
  813. global = new Function('return this')(),
  814. gcv = '__coverage__',
  815. coverageData = {
  816. path: '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/generate-binding-body.js',
  817. statementMap: {
  818. '0': {
  819. start: {
  820. line: 4,
  821. column: 24
  822. },
  823. end: {
  824. line: 6,
  825. column: 3
  826. }
  827. },
  828. '1': {
  829. start: {
  830. line: 7,
  831. column: 17
  832. },
  833. end: {
  834. line: 7,
  835. column: 19
  836. }
  837. },
  838. '2': {
  839. start: {
  840. line: 8,
  841. column: 21
  842. },
  843. end: {
  844. line: 8,
  845. column: 23
  846. }
  847. },
  848. '3': {
  849. start: {
  850. line: 9,
  851. column: 24
  852. },
  853. end: {
  854. line: 11,
  855. column: 3
  856. }
  857. },
  858. '4': {
  859. start: {
  860. line: 13,
  861. column: 2
  862. },
  863. end: {
  864. line: 65,
  865. column: 4
  866. }
  867. },
  868. '5': {
  869. start: {
  870. line: 14,
  871. column: 4
  872. },
  873. end: {
  874. line: 64,
  875. column: 5
  876. }
  877. },
  878. '6': {
  879. start: {
  880. line: 15,
  881. column: 6
  882. },
  883. end: {
  884. line: 19,
  885. column: 7
  886. }
  887. },
  888. '7': {
  889. start: {
  890. line: 20,
  891. column: 11
  892. },
  893. end: {
  894. line: 64,
  895. column: 5
  896. }
  897. },
  898. '8': {
  899. start: {
  900. line: 21,
  901. column: 6
  902. },
  903. end: {
  904. line: 25,
  905. column: 7
  906. }
  907. },
  908. '9': {
  909. start: {
  910. line: 26,
  911. column: 11
  912. },
  913. end: {
  914. line: 64,
  915. column: 5
  916. }
  917. },
  918. '10': {
  919. start: {
  920. line: 27,
  921. column: 6
  922. },
  923. end: {
  924. line: 33,
  925. column: 7
  926. }
  927. },
  928. '11': {
  929. start: {
  930. line: 34,
  931. column: 11
  932. },
  933. end: {
  934. line: 64,
  935. column: 5
  936. }
  937. },
  938. '12': {
  939. start: {
  940. line: 35,
  941. column: 6
  942. },
  943. end: {
  944. line: 37,
  945. column: 7
  946. }
  947. },
  948. '13': {
  949. start: {
  950. line: 38,
  951. column: 11
  952. },
  953. end: {
  954. line: 64,
  955. column: 5
  956. }
  957. },
  958. '14': {
  959. start: {
  960. line: 39,
  961. column: 6
  962. },
  963. end: {
  964. line: 44,
  965. column: 7
  966. }
  967. },
  968. '15': {
  969. start: {
  970. line: 41,
  971. column: 33
  972. },
  973. end: {
  974. line: 41,
  975. column: 60
  976. }
  977. },
  978. '16': {
  979. start: {
  980. line: 42,
  981. column: 30
  982. },
  983. end: {
  984. line: 42,
  985. column: 107
  986. }
  987. },
  988. '17': {
  989. start: {
  990. line: 43,
  991. column: 53
  992. },
  993. end: {
  994. line: 43,
  995. column: 109
  996. }
  997. },
  998. '18': {
  999. start: {
  1000. line: 45,
  1001. column: 11
  1002. },
  1003. end: {
  1004. line: 64,
  1005. column: 5
  1006. }
  1007. },
  1008. '19': {
  1009. start: {
  1010. line: 46,
  1011. column: 6
  1012. },
  1013. end: {
  1014. line: 54,
  1015. column: 7
  1016. }
  1017. },
  1018. '20': {
  1019. start: {
  1020. line: 51,
  1021. column: 60
  1022. },
  1023. end: {
  1024. line: 51,
  1025. column: 80
  1026. }
  1027. },
  1028. '21': {
  1029. start: {
  1030. line: 55,
  1031. column: 11
  1032. },
  1033. end: {
  1034. line: 64,
  1035. column: 5
  1036. }
  1037. },
  1038. '22': {
  1039. start: {
  1040. line: 56,
  1041. column: 22
  1042. },
  1043. end: {
  1044. line: 56,
  1045. column: 51
  1046. }
  1047. },
  1048. '23': {
  1049. start: {
  1050. line: 57,
  1051. column: 6
  1052. },
  1053. end: {
  1054. line: 63,
  1055. column: 7
  1056. }
  1057. },
  1058. '24': {
  1059. start: {
  1060. line: 67,
  1061. column: 2
  1062. },
  1063. end: {
  1064. line: 71,
  1065. column: 3
  1066. }
  1067. },
  1068. '25': {
  1069. start: {
  1070. line: 68,
  1071. column: 4
  1072. },
  1073. end: {
  1074. line: 70,
  1075. column: 5
  1076. }
  1077. },
  1078. '26': {
  1079. start: {
  1080. line: 69,
  1081. column: 62
  1082. },
  1083. end: {
  1084. line: 69,
  1085. column: 118
  1086. }
  1087. },
  1088. '27': {
  1089. start: {
  1090. line: 73,
  1091. column: 2
  1092. },
  1093. end: {
  1094. line: 80,
  1095. column: 3
  1096. }
  1097. },
  1098. '28': {
  1099. start: {
  1100. line: 74,
  1101. column: 4
  1102. },
  1103. end: {
  1104. line: 79,
  1105. column: 5
  1106. }
  1107. },
  1108. '29': {
  1109. start: {
  1110. line: 76,
  1111. column: 61
  1112. },
  1113. end: {
  1114. line: 76,
  1115. column: 117
  1116. }
  1117. },
  1118. '30': {
  1119. start: {
  1120. line: 82,
  1121. column: 2
  1122. },
  1123. end: {
  1124. line: 82,
  1125. column: 28
  1126. }
  1127. },
  1128. '31': {
  1129. start: {
  1130. line: 83,
  1131. column: 2
  1132. },
  1133. end: {
  1134. line: 83,
  1135. column: 15
  1136. }
  1137. }
  1138. },
  1139. fnMap: {
  1140. '0': {
  1141. name: '(anonymous_0)',
  1142. decl: {
  1143. start: {
  1144. line: 3,
  1145. column: 15
  1146. },
  1147. end: {
  1148. line: 3,
  1149. column: 16
  1150. }
  1151. },
  1152. loc: {
  1153. start: {
  1154. line: 3,
  1155. column: 49
  1156. },
  1157. end: {
  1158. line: 84,
  1159. column: 1
  1160. }
  1161. },
  1162. line: 3
  1163. },
  1164. '1': {
  1165. name: '(anonymous_1)',
  1166. decl: {
  1167. start: {
  1168. line: 13,
  1169. column: 20
  1170. },
  1171. end: {
  1172. line: 13,
  1173. column: 21
  1174. }
  1175. },
  1176. loc: {
  1177. start: {
  1178. line: 13,
  1179. column: 32
  1180. },
  1181. end: {
  1182. line: 65,
  1183. column: 3
  1184. }
  1185. },
  1186. line: 13
  1187. },
  1188. '2': {
  1189. name: '(anonymous_2)',
  1190. decl: {
  1191. start: {
  1192. line: 41,
  1193. column: 18
  1194. },
  1195. end: {
  1196. line: 41,
  1197. column: 19
  1198. }
  1199. },
  1200. loc: {
  1201. start: {
  1202. line: 41,
  1203. column: 33
  1204. },
  1205. end: {
  1206. line: 41,
  1207. column: 60
  1208. }
  1209. },
  1210. line: 41
  1211. },
  1212. '3': {
  1213. name: '(anonymous_3)',
  1214. decl: {
  1215. start: {
  1216. line: 42,
  1217. column: 15
  1218. },
  1219. end: {
  1220. line: 42,
  1221. column: 16
  1222. }
  1223. },
  1224. loc: {
  1225. start: {
  1226. line: 42,
  1227. column: 30
  1228. },
  1229. end: {
  1230. line: 42,
  1231. column: 107
  1232. }
  1233. },
  1234. line: 42
  1235. },
  1236. '4': {
  1237. name: '(anonymous_4)',
  1238. decl: {
  1239. start: {
  1240. line: 43,
  1241. column: 18
  1242. },
  1243. end: {
  1244. line: 43,
  1245. column: 19
  1246. }
  1247. },
  1248. loc: {
  1249. start: {
  1250. line: 43,
  1251. column: 53
  1252. },
  1253. end: {
  1254. line: 43,
  1255. column: 109
  1256. }
  1257. },
  1258. line: 43
  1259. },
  1260. '5': {
  1261. name: '(anonymous_5)',
  1262. decl: {
  1263. start: {
  1264. line: 51,
  1265. column: 54
  1266. },
  1267. end: {
  1268. line: 51,
  1269. column: 55
  1270. }
  1271. },
  1272. loc: {
  1273. start: {
  1274. line: 51,
  1275. column: 60
  1276. },
  1277. end: {
  1278. line: 51,
  1279. column: 80
  1280. }
  1281. },
  1282. line: 51
  1283. },
  1284. '6': {
  1285. name: '(anonymous_6)',
  1286. decl: {
  1287. start: {
  1288. line: 69,
  1289. column: 27
  1290. },
  1291. end: {
  1292. line: 69,
  1293. column: 28
  1294. }
  1295. },
  1296. loc: {
  1297. start: {
  1298. line: 69,
  1299. column: 62
  1300. },
  1301. end: {
  1302. line: 69,
  1303. column: 118
  1304. }
  1305. },
  1306. line: 69
  1307. },
  1308. '7': {
  1309. name: '(anonymous_7)',
  1310. decl: {
  1311. start: {
  1312. line: 76,
  1313. column: 26
  1314. },
  1315. end: {
  1316. line: 76,
  1317. column: 27
  1318. }
  1319. },
  1320. loc: {
  1321. start: {
  1322. line: 76,
  1323. column: 61
  1324. },
  1325. end: {
  1326. line: 76,
  1327. column: 117
  1328. }
  1329. },
  1330. line: 76
  1331. }
  1332. },
  1333. branchMap: {
  1334. '0': {
  1335. loc: {
  1336. start: {
  1337. line: 14,
  1338. column: 4
  1339. },
  1340. end: {
  1341. line: 64,
  1342. column: 5
  1343. }
  1344. },
  1345. type: 'if',
  1346. locations: [{
  1347. start: {
  1348. line: 14,
  1349. column: 4
  1350. },
  1351. end: {
  1352. line: 64,
  1353. column: 5
  1354. }
  1355. }, {
  1356. start: {
  1357. line: 14,
  1358. column: 4
  1359. },
  1360. end: {
  1361. line: 64,
  1362. column: 5
  1363. }
  1364. }],
  1365. line: 14
  1366. },
  1367. '1': {
  1368. loc: {
  1369. start: {
  1370. line: 20,
  1371. column: 11
  1372. },
  1373. end: {
  1374. line: 64,
  1375. column: 5
  1376. }
  1377. },
  1378. type: 'if',
  1379. locations: [{
  1380. start: {
  1381. line: 20,
  1382. column: 11
  1383. },
  1384. end: {
  1385. line: 64,
  1386. column: 5
  1387. }
  1388. }, {
  1389. start: {
  1390. line: 20,
  1391. column: 11
  1392. },
  1393. end: {
  1394. line: 64,
  1395. column: 5
  1396. }
  1397. }],
  1398. line: 20
  1399. },
  1400. '2': {
  1401. loc: {
  1402. start: {
  1403. line: 26,
  1404. column: 11
  1405. },
  1406. end: {
  1407. line: 64,
  1408. column: 5
  1409. }
  1410. },
  1411. type: 'if',
  1412. locations: [{
  1413. start: {
  1414. line: 26,
  1415. column: 11
  1416. },
  1417. end: {
  1418. line: 64,
  1419. column: 5
  1420. }
  1421. }, {
  1422. start: {
  1423. line: 26,
  1424. column: 11
  1425. },
  1426. end: {
  1427. line: 64,
  1428. column: 5
  1429. }
  1430. }],
  1431. line: 26
  1432. },
  1433. '3': {
  1434. loc: {
  1435. start: {
  1436. line: 34,
  1437. column: 11
  1438. },
  1439. end: {
  1440. line: 64,
  1441. column: 5
  1442. }
  1443. },
  1444. type: 'if',
  1445. locations: [{
  1446. start: {
  1447. line: 34,
  1448. column: 11
  1449. },
  1450. end: {
  1451. line: 64,
  1452. column: 5
  1453. }
  1454. }, {
  1455. start: {
  1456. line: 34,
  1457. column: 11
  1458. },
  1459. end: {
  1460. line: 64,
  1461. column: 5
  1462. }
  1463. }],
  1464. line: 34
  1465. },
  1466. '4': {
  1467. loc: {
  1468. start: {
  1469. line: 38,
  1470. column: 11
  1471. },
  1472. end: {
  1473. line: 64,
  1474. column: 5
  1475. }
  1476. },
  1477. type: 'if',
  1478. locations: [{
  1479. start: {
  1480. line: 38,
  1481. column: 11
  1482. },
  1483. end: {
  1484. line: 64,
  1485. column: 5
  1486. }
  1487. }, {
  1488. start: {
  1489. line: 38,
  1490. column: 11
  1491. },
  1492. end: {
  1493. line: 64,
  1494. column: 5
  1495. }
  1496. }],
  1497. line: 38
  1498. },
  1499. '5': {
  1500. loc: {
  1501. start: {
  1502. line: 45,
  1503. column: 11
  1504. },
  1505. end: {
  1506. line: 64,
  1507. column: 5
  1508. }
  1509. },
  1510. type: 'if',
  1511. locations: [{
  1512. start: {
  1513. line: 45,
  1514. column: 11
  1515. },
  1516. end: {
  1517. line: 64,
  1518. column: 5
  1519. }
  1520. }, {
  1521. start: {
  1522. line: 45,
  1523. column: 11
  1524. },
  1525. end: {
  1526. line: 64,
  1527. column: 5
  1528. }
  1529. }],
  1530. line: 45
  1531. },
  1532. '6': {
  1533. loc: {
  1534. start: {
  1535. line: 50,
  1536. column: 10
  1537. },
  1538. end: {
  1539. line: 52,
  1540. column: 49
  1541. }
  1542. },
  1543. type: 'cond-expr',
  1544. locations: [{
  1545. start: {
  1546. line: 51,
  1547. column: 14
  1548. },
  1549. end: {
  1550. line: 51,
  1551. column: 82
  1552. }
  1553. }, {
  1554. start: {
  1555. line: 52,
  1556. column: 14
  1557. },
  1558. end: {
  1559. line: 52,
  1560. column: 49
  1561. }
  1562. }],
  1563. line: 50
  1564. },
  1565. '7': {
  1566. loc: {
  1567. start: {
  1568. line: 55,
  1569. column: 11
  1570. },
  1571. end: {
  1572. line: 64,
  1573. column: 5
  1574. }
  1575. },
  1576. type: 'if',
  1577. locations: [{
  1578. start: {
  1579. line: 55,
  1580. column: 11
  1581. },
  1582. end: {
  1583. line: 64,
  1584. column: 5
  1585. }
  1586. }, {
  1587. start: {
  1588. line: 55,
  1589. column: 11
  1590. },
  1591. end: {
  1592. line: 64,
  1593. column: 5
  1594. }
  1595. }],
  1596. line: 55
  1597. },
  1598. '8': {
  1599. loc: {
  1600. start: {
  1601. line: 67,
  1602. column: 2
  1603. },
  1604. end: {
  1605. line: 71,
  1606. column: 3
  1607. }
  1608. },
  1609. type: 'if',
  1610. locations: [{
  1611. start: {
  1612. line: 67,
  1613. column: 2
  1614. },
  1615. end: {
  1616. line: 71,
  1617. column: 3
  1618. }
  1619. }, {
  1620. start: {
  1621. line: 67,
  1622. column: 2
  1623. },
  1624. end: {
  1625. line: 71,
  1626. column: 3
  1627. }
  1628. }],
  1629. line: 67
  1630. },
  1631. '9': {
  1632. loc: {
  1633. start: {
  1634. line: 73,
  1635. column: 2
  1636. },
  1637. end: {
  1638. line: 80,
  1639. column: 3
  1640. }
  1641. },
  1642. type: 'if',
  1643. locations: [{
  1644. start: {
  1645. line: 73,
  1646. column: 2
  1647. },
  1648. end: {
  1649. line: 80,
  1650. column: 3
  1651. }
  1652. }, {
  1653. start: {
  1654. line: 73,
  1655. column: 2
  1656. },
  1657. end: {
  1658. line: 80,
  1659. column: 3
  1660. }
  1661. }],
  1662. line: 73
  1663. }
  1664. },
  1665. s: {
  1666. '0': 0,
  1667. '1': 0,
  1668. '2': 0,
  1669. '3': 0,
  1670. '4': 0,
  1671. '5': 0,
  1672. '6': 0,
  1673. '7': 0,
  1674. '8': 0,
  1675. '9': 0,
  1676. '10': 0,
  1677. '11': 0,
  1678. '12': 0,
  1679. '13': 0,
  1680. '14': 0,
  1681. '15': 0,
  1682. '16': 0,
  1683. '17': 0,
  1684. '18': 0,
  1685. '19': 0,
  1686. '20': 0,
  1687. '21': 0,
  1688. '22': 0,
  1689. '23': 0,
  1690. '24': 0,
  1691. '25': 0,
  1692. '26': 0,
  1693. '27': 0,
  1694. '28': 0,
  1695. '29': 0,
  1696. '30': 0,
  1697. '31': 0
  1698. },
  1699. f: {
  1700. '0': 0,
  1701. '1': 0,
  1702. '2': 0,
  1703. '3': 0,
  1704. '4': 0,
  1705. '5': 0,
  1706. '6': 0,
  1707. '7': 0
  1708. },
  1709. b: {
  1710. '0': [0, 0],
  1711. '1': [0, 0],
  1712. '2': [0, 0],
  1713. '3': [0, 0],
  1714. '4': [0, 0],
  1715. '5': [0, 0],
  1716. '6': [0, 0],
  1717. '7': [0, 0],
  1718. '8': [0, 0],
  1719. '9': [0, 0]
  1720. },
  1721. _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c'
  1722. },
  1723. coverage = global[gcv] || (global[gcv] = {});
  1724. if (coverage[path] && coverage[path].hash === hash) {
  1725. return coverage[path];
  1726. }
  1727. coverageData.hash = hash;
  1728. return coverage[path] = coverageData;
  1729. }();
  1730. var generateBindingBody = (function (t, _ref) {
  1731. var modifiers = _ref.modifiers,
  1732. expression = _ref.expression;
  1733. cov_28cz23z0dk.f[0]++;
  1734. var callStatement = (cov_28cz23z0dk.s[0]++, t.expressionStatement(t.callExpression(expression, [t.identifier('$event'), t.spreadElement(t.identifier('attrs'))])));
  1735. var result = (cov_28cz23z0dk.s[1]++, []);
  1736. var conditions = (cov_28cz23z0dk.s[2]++, []);
  1737. var keyConditions = (cov_28cz23z0dk.s[3]++, [t.unaryExpression('!', t.binaryExpression('in', t.stringLiteral('button'), t.identifier('$event')))]);
  1738. cov_28cz23z0dk.s[4]++;
  1739. modifiers.forEach(function (modifier) {
  1740. cov_28cz23z0dk.f[1]++;
  1741. cov_28cz23z0dk.s[5]++;
  1742. if (modifier === 'stop') {
  1743. cov_28cz23z0dk.b[0][0]++;
  1744. cov_28cz23z0dk.s[6]++;
  1745. result.push(t.expressionStatement(t.callExpression(t.memberExpression(t.identifier('$event'), t.identifier('stopPropagation')), [])));
  1746. } else {
  1747. cov_28cz23z0dk.b[0][1]++;
  1748. cov_28cz23z0dk.s[7]++;
  1749. if (modifier === 'prevent') {
  1750. cov_28cz23z0dk.b[1][0]++;
  1751. cov_28cz23z0dk.s[8]++;
  1752. result.push(t.expressionStatement(t.callExpression(t.memberExpression(t.identifier('$event'), t.identifier('preventDefault')), [])));
  1753. } else {
  1754. cov_28cz23z0dk.b[1][1]++;
  1755. cov_28cz23z0dk.s[9]++;
  1756. if (modifier === 'self') {
  1757. cov_28cz23z0dk.b[2][0]++;
  1758. cov_28cz23z0dk.s[10]++;
  1759. conditions.push(t.binaryExpression('!==', t.memberExpression(t.identifier('$event'), t.identifier('target')), t.memberExpression(t.identifier('$event'), t.identifier('currentTarget'))));
  1760. } else {
  1761. cov_28cz23z0dk.b[2][1]++;
  1762. cov_28cz23z0dk.s[11]++;
  1763. if (keyModifiers.includes(modifier)) {
  1764. cov_28cz23z0dk.b[3][0]++;
  1765. cov_28cz23z0dk.s[12]++;
  1766. conditions.push(t.unaryExpression('!', t.memberExpression(t.identifier('$event'), t.identifier(`${modifier}Key`))));
  1767. } else {
  1768. cov_28cz23z0dk.b[3][1]++;
  1769. cov_28cz23z0dk.s[13]++;
  1770. if (modifier === 'bare') {
  1771. cov_28cz23z0dk.b[4][0]++;
  1772. cov_28cz23z0dk.s[14]++;
  1773. conditions.push(keyModifiers.filter(function (keyModifier) {
  1774. cov_28cz23z0dk.f[2]++;
  1775. cov_28cz23z0dk.s[15]++;
  1776. return !modifiers.has(keyModifier);
  1777. }).map(function (keyModifier) {
  1778. cov_28cz23z0dk.f[3]++;
  1779. cov_28cz23z0dk.s[16]++;
  1780. return t.memberExpression(t.identifier('$event'), t.identifier(`${keyModifier}Key`));
  1781. }).reduce(function (leftCondition, rightCondition) {
  1782. cov_28cz23z0dk.f[4]++;
  1783. cov_28cz23z0dk.s[17]++;
  1784. return t.logicalExpression('||', leftCondition, rightCondition);
  1785. }));
  1786. } else {
  1787. cov_28cz23z0dk.b[4][1]++;
  1788. cov_28cz23z0dk.s[18]++;
  1789. if (aliases[modifier]) {
  1790. cov_28cz23z0dk.b[5][0]++;
  1791. cov_28cz23z0dk.s[19]++;
  1792. keyConditions.push(t.callExpression(t.memberExpression(t.thisExpression(), t.identifier('_k')), [t.memberExpression(t.identifier('$event'), t.identifier('keyCode')), t.stringLiteral(modifier), Array.isArray(aliases[modifier]) ? (cov_28cz23z0dk.b[6][0]++, t.arrayExpression(aliases[modifier].map(function (el) {
  1793. cov_28cz23z0dk.f[5]++;
  1794. cov_28cz23z0dk.s[20]++;
  1795. return t.numericLiteral(el);
  1796. }))) : (cov_28cz23z0dk.b[6][1]++, t.numericLiteral(aliases[modifier]))]));
  1797. } else {
  1798. cov_28cz23z0dk.b[5][1]++;
  1799. cov_28cz23z0dk.s[21]++;
  1800. if (modifier.match(keyCodeRE)) {
  1801. cov_28cz23z0dk.b[7][0]++;
  1802. var keyCode = (cov_28cz23z0dk.s[22]++, +modifier.match(keyCodeRE)[1]);
  1803. cov_28cz23z0dk.s[23]++;
  1804. keyConditions.push(t.binaryExpression('!==', t.memberExpression(t.identifier('$event'), t.identifier('keyCode')), t.numericLiteral(keyCode)));
  1805. } else {
  1806. cov_28cz23z0dk.b[7][1]++;
  1807. }
  1808. }
  1809. }
  1810. }
  1811. }
  1812. }
  1813. }
  1814. });
  1815. cov_28cz23z0dk.s[24]++;
  1816. if (keyConditions.length > 1) {
  1817. cov_28cz23z0dk.b[8][0]++;
  1818. cov_28cz23z0dk.s[25]++;
  1819. conditions.push(keyConditions.reduce(function (leftCondition, rightCondition) {
  1820. cov_28cz23z0dk.f[6]++;
  1821. cov_28cz23z0dk.s[26]++;
  1822. return t.logicalExpression('&&', leftCondition, rightCondition);
  1823. }));
  1824. } else {
  1825. cov_28cz23z0dk.b[8][1]++;
  1826. }
  1827. cov_28cz23z0dk.s[27]++;
  1828. if (conditions.length > 0) {
  1829. cov_28cz23z0dk.b[9][0]++;
  1830. cov_28cz23z0dk.s[28]++;
  1831. result.push(t.ifStatement(conditions.reduce(function (leftCondition, rightCondition) {
  1832. cov_28cz23z0dk.f[7]++;
  1833. cov_28cz23z0dk.s[29]++;
  1834. return t.logicalExpression('||', leftCondition, rightCondition);
  1835. }), t.returnStatement(t.nullLiteral())));
  1836. } else {
  1837. cov_28cz23z0dk.b[9][1]++;
  1838. }
  1839. cov_28cz23z0dk.s[30]++;
  1840. result.push(callStatement);
  1841. cov_28cz23z0dk.s[31]++;
  1842. return result;
  1843. });
  1844. var cov_2jta5ux1ch = function () {
  1845. var path = '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/generate-bindings-list.js',
  1846. hash = 'f199c9e4c60d7dbdd94379c8a9a7443b1cc5d62f',
  1847. global = new Function('return this')(),
  1848. gcv = '__coverage__',
  1849. coverageData = {
  1850. path: '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/generate-bindings-list.js',
  1851. statementMap: {
  1852. '0': {
  1853. start: {
  1854. line: 4,
  1855. column: 2
  1856. },
  1857. end: {
  1858. line: 9,
  1859. column: 3
  1860. }
  1861. },
  1862. '1': {
  1863. start: {
  1864. line: 5,
  1865. column: 4
  1866. },
  1867. end: {
  1868. line: 8,
  1869. column: 5
  1870. }
  1871. }
  1872. },
  1873. fnMap: {
  1874. '0': {
  1875. name: '(anonymous_0)',
  1876. decl: {
  1877. start: {
  1878. line: 3,
  1879. column: 15
  1880. },
  1881. end: {
  1882. line: 3,
  1883. column: 16
  1884. }
  1885. },
  1886. loc: {
  1887. start: {
  1888. line: 3,
  1889. column: 32
  1890. },
  1891. end: {
  1892. line: 10,
  1893. column: 1
  1894. }
  1895. },
  1896. line: 3
  1897. },
  1898. '1': {
  1899. name: '(anonymous_1)',
  1900. decl: {
  1901. start: {
  1902. line: 4,
  1903. column: 22
  1904. },
  1905. end: {
  1906. line: 4,
  1907. column: 23
  1908. }
  1909. },
  1910. loc: {
  1911. start: {
  1912. line: 5,
  1913. column: 4
  1914. },
  1915. end: {
  1916. line: 8,
  1917. column: 5
  1918. }
  1919. },
  1920. line: 5
  1921. }
  1922. },
  1923. branchMap: {},
  1924. s: {
  1925. '0': 0,
  1926. '1': 0
  1927. },
  1928. f: {
  1929. '0': 0,
  1930. '1': 0
  1931. },
  1932. b: {},
  1933. _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c'
  1934. },
  1935. coverage = global[gcv] || (global[gcv] = {});
  1936. if (coverage[path] && coverage[path].hash === hash) {
  1937. return coverage[path];
  1938. }
  1939. coverageData.hash = hash;
  1940. return coverage[path] = coverageData;
  1941. }();
  1942. var generateBindingsList = (function (t, bindings) {
  1943. cov_2jta5ux1ch.f[0]++;
  1944. cov_2jta5ux1ch.s[0]++;
  1945. return bindings.map(function (binding) {
  1946. cov_2jta5ux1ch.f[1]++;
  1947. cov_2jta5ux1ch.s[1]++;
  1948. return t.arrowFunctionExpression([t.identifier('$event'), t.restElement(t.identifier('attrs'))], t.blockStatement(generateBindingBody(t, binding)));
  1949. });
  1950. });
  1951. var cov_34300l8ld = function () {
  1952. var path = '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/generate-spread-event.js',
  1953. hash = '691af611be9161f1f796a7d48f0d856cdb5d2ae7',
  1954. global = new Function('return this')(),
  1955. gcv = '__coverage__',
  1956. coverageData = {
  1957. path: '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/generate-spread-event.js',
  1958. statementMap: {
  1959. '0': {
  1960. start: {
  1961. line: 3,
  1962. column: 20
  1963. },
  1964. end: {
  1965. line: 6,
  1966. column: 1
  1967. }
  1968. },
  1969. '1': {
  1970. start: {
  1971. line: 4,
  1972. column: 20
  1973. },
  1974. end: {
  1975. line: 4,
  1976. column: 53
  1977. }
  1978. },
  1979. '2': {
  1980. start: {
  1981. line: 5,
  1982. column: 2
  1983. },
  1984. end: {
  1985. line: 5,
  1986. column: 119
  1987. }
  1988. }
  1989. },
  1990. fnMap: {
  1991. '0': {
  1992. name: '(anonymous_0)',
  1993. decl: {
  1994. start: {
  1995. line: 3,
  1996. column: 15
  1997. },
  1998. end: {
  1999. line: 3,
  2000. column: 16
  2001. }
  2002. },
  2003. loc: {
  2004. start: {
  2005. line: 3,
  2006. column: 20
  2007. },
  2008. end: {
  2009. line: 6,
  2010. column: 1
  2011. }
  2012. },
  2013. line: 3
  2014. },
  2015. '1': {
  2016. name: '(anonymous_1)',
  2017. decl: {
  2018. start: {
  2019. line: 3,
  2020. column: 20
  2021. },
  2022. end: {
  2023. line: 3,
  2024. column: 21
  2025. }
  2026. },
  2027. loc: {
  2028. start: {
  2029. line: 3,
  2030. column: 43
  2031. },
  2032. end: {
  2033. line: 6,
  2034. column: 1
  2035. }
  2036. },
  2037. line: 3
  2038. }
  2039. },
  2040. branchMap: {
  2041. '0': {
  2042. loc: {
  2043. start: {
  2044. line: 5,
  2045. column: 50
  2046. },
  2047. end: {
  2048. line: 5,
  2049. column: 118
  2050. }
  2051. },
  2052. type: 'cond-expr',
  2053. locations: [{
  2054. start: {
  2055. line: 5,
  2056. column: 75
  2057. },
  2058. end: {
  2059. line: 5,
  2060. column: 87
  2061. }
  2062. }, {
  2063. start: {
  2064. line: 5,
  2065. column: 90
  2066. },
  2067. end: {
  2068. line: 5,
  2069. column: 118
  2070. }
  2071. }],
  2072. line: 5
  2073. }
  2074. },
  2075. s: {
  2076. '0': 0,
  2077. '1': 0,
  2078. '2': 0
  2079. },
  2080. f: {
  2081. '0': 0,
  2082. '1': 0
  2083. },
  2084. b: {
  2085. '0': [0, 0]
  2086. },
  2087. _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c'
  2088. },
  2089. coverage = global[gcv] || (global[gcv] = {});
  2090. if (coverage[path] && coverage[path].hash === hash) {
  2091. return coverage[path];
  2092. }
  2093. coverageData.hash = hash;
  2094. return coverage[path] = coverageData;
  2095. }();
  2096. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  2097. var generateSpreadEvent = (function (t) {
  2098. cov_34300l8ld.f[0]++;
  2099. cov_34300l8ld.s[0]++;
  2100. return function (_ref) {
  2101. var _ref2 = _slicedToArray(_ref, 2),
  2102. event = _ref2[0],
  2103. bindings = _ref2[1];
  2104. cov_34300l8ld.f[1]++;
  2105. var callbacks = (cov_34300l8ld.s[1]++, generateBindingsList(t, bindings));
  2106. cov_34300l8ld.s[2]++;
  2107. return t.objectProperty(t.stringLiteral(event), callbacks.length === 1 ? (cov_34300l8ld.b[0][0]++, callbacks[0]) : (cov_34300l8ld.b[0][1]++, t.arrayExpression(callbacks)));
  2108. };
  2109. });
  2110. var cov_131o2j1ear = function () {
  2111. var path = '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/index.js',
  2112. hash = '014199d1d98abed5c3c5abff53ae757229b98206',
  2113. global = new Function('return this')(),
  2114. gcv = '__coverage__',
  2115. coverageData = {
  2116. path: '/home/nick/Projects/babel-plugin-jsx-event-modifiers/src/index.js',
  2117. statementMap: {
  2118. '0': {
  2119. start: {
  2120. line: 5,
  2121. column: 34
  2122. },
  2123. end: {
  2124. line: 28,
  2125. column: 1
  2126. }
  2127. },
  2128. '1': {
  2129. start: {
  2130. line: 9,
  2131. column: 6
  2132. },
  2133. end: {
  2134. line: 25,
  2135. column: 8
  2136. }
  2137. },
  2138. '2': {
  2139. start: {
  2140. line: 11,
  2141. column: 29
  2142. },
  2143. end: {
  2144. line: 11,
  2145. column: 51
  2146. }
  2147. },
  2148. '3': {
  2149. start: {
  2150. line: 12,
  2151. column: 41
  2152. },
  2153. end: {
  2154. line: 12,
  2155. column: 87
  2156. }
  2157. },
  2158. '4': {
  2159. start: {
  2160. line: 13,
  2161. column: 25
  2162. },
  2163. end: {
  2164. line: 13,
  2165. column: 107
  2166. }
  2167. },
  2168. '5': {
  2169. start: {
  2170. line: 13,
  2171. column: 72
  2172. },
  2173. end: {
  2174. line: 13,
  2175. column: 106
  2176. }
  2177. },
  2178. '6': {
  2179. start: {
  2180. line: 14,
  2181. column: 10
  2182. },
  2183. end: {
  2184. line: 23,
  2185. column: 11
  2186. }
  2187. },
  2188. '7': {
  2189. start: {
  2190. line: 15,
  2191. column: 12
  2192. },
  2193. end: {
  2194. line: 22,
  2195. column: 13
  2196. }
  2197. }
  2198. },
  2199. fnMap: {
  2200. '0': {
  2201. name: '(anonymous_0)',
  2202. decl: {
  2203. start: {
  2204. line: 5,
  2205. column: 15
  2206. },
  2207. end: {
  2208. line: 5,
  2209. column: 16
  2210. }
  2211. },
  2212. loc: {
  2213. start: {
  2214. line: 5,
  2215. column: 34
  2216. },
  2217. end: {
  2218. line: 28,
  2219. column: 1
  2220. }
  2221. },
  2222. line: 5
  2223. },
  2224. '1': {
  2225. name: '(anonymous_1)',
  2226. decl: {
  2227. start: {
  2228. line: 13,
  2229. column: 65
  2230. },
  2231. end: {
  2232. line: 13,
  2233. column: 66
  2234. }
  2235. },
  2236. loc: {
  2237. start: {
  2238. line: 13,
  2239. column: 72
  2240. },
  2241. end: {
  2242. line: 13,
  2243. column: 106
  2244. }
  2245. },
  2246. line: 13
  2247. }
  2248. },
  2249. branchMap: {
  2250. '0': {
  2251. loc: {
  2252. start: {
  2253. line: 14,
  2254. column: 10
  2255. },
  2256. end: {
  2257. line: 23,
  2258. column: 11
  2259. }
  2260. },
  2261. type: 'if',
  2262. locations: [{
  2263. start: {
  2264. line: 14,
  2265. column: 10
  2266. },
  2267. end: {
  2268. line: 23,
  2269. column: 11
  2270. }
  2271. }, {
  2272. start: {
  2273. line: 14,
  2274. column: 10
  2275. },
  2276. end: {
  2277. line: 23,
  2278. column: 11
  2279. }
  2280. }],
  2281. line: 14
  2282. }
  2283. },
  2284. s: {
  2285. '0': 0,
  2286. '1': 0,
  2287. '2': 0,
  2288. '3': 0,
  2289. '4': 0,
  2290. '5': 0,
  2291. '6': 0,
  2292. '7': 0
  2293. },
  2294. f: {
  2295. '0': 0,
  2296. '1': 0
  2297. },
  2298. b: {
  2299. '0': [0, 0]
  2300. },
  2301. _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c'
  2302. },
  2303. coverage = global[gcv] || (global[gcv] = {});
  2304. if (coverage[path] && coverage[path].hash === hash) {
  2305. return coverage[path];
  2306. }
  2307. coverageData.hash = hash;
  2308. return coverage[path] = coverageData;
  2309. }();
  2310. var index = (function (_ref) {
  2311. var t = _ref.types;
  2312. cov_131o2j1ear.f[0]++;
  2313. cov_131o2j1ear.s[0]++;
  2314. return {
  2315. inherits: syntaxJsx,
  2316. visitor: {
  2317. Program(path) {
  2318. cov_131o2j1ear.s[1]++;
  2319. path.traverse({
  2320. JSXOpeningElement(path) {
  2321. var attributes = (cov_131o2j1ear.s[2]++, path.get('attributes'));
  2322. var groupedEventAttributes = (cov_131o2j1ear.s[3]++, attributes.reduce(groupEventAttributes(t), {}));
  2323. var events = (cov_131o2j1ear.s[4]++, Object.keys(groupedEventAttributes).map(function (key) {
  2324. cov_131o2j1ear.f[1]++;
  2325. cov_131o2j1ear.s[5]++;
  2326. return [key, groupedEventAttributes[key]];
  2327. }));
  2328. cov_131o2j1ear.s[6]++;
  2329. if (events.length > 0) {
  2330. cov_131o2j1ear.b[0][0]++;
  2331. cov_131o2j1ear.s[7]++;
  2332. path.pushContainer('attributes', t.jSXSpreadAttribute(t.objectExpression([t.objectProperty(t.identifier('on'), t.objectExpression(events.map(generateSpreadEvent(t))))])));
  2333. } else {
  2334. cov_131o2j1ear.b[0][1]++;
  2335. }
  2336. }
  2337. });
  2338. }
  2339. }
  2340. };
  2341. });
  2342. module.exports = index;