├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md ├── examples └── async-generator.js └── src ├── main.rs └── runtime.js /.gitignore: -------------------------------------------------------------------------------- 1 | /target -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "Inflector" 7 | version = "0.11.4" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" 10 | dependencies = [ 11 | "lazy_static", 12 | "regex", 13 | ] 14 | 15 | [[package]] 16 | name = "ahash" 17 | version = "0.7.6" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 20 | dependencies = [ 21 | "getrandom 0.2.4", 22 | "once_cell", 23 | "serde", 24 | "version_check", 25 | ] 26 | 27 | [[package]] 28 | name = "aho-corasick" 29 | version = "0.7.18" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" 32 | dependencies = [ 33 | "memchr", 34 | ] 35 | 36 | [[package]] 37 | name = "anyhow" 38 | version = "1.0.53" 39 | source = "registry+https://github.com/rust-lang/crates.io-index" 40 | checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" 41 | 42 | [[package]] 43 | name = "arrayvec" 44 | version = "0.5.2" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 47 | 48 | [[package]] 49 | name = "arrayvec" 50 | version = "0.7.2" 51 | source = "registry+https://github.com/rust-lang/crates.io-index" 52 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 53 | 54 | [[package]] 55 | name = "ast_node" 56 | version = "0.7.6" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "82b2dd56b7c509b3a0bb47a97a066cba459983470d3b8a3c20428737270f70bd" 59 | dependencies = [ 60 | "darling", 61 | "pmutil", 62 | "proc-macro2", 63 | "quote", 64 | "swc_macros_common", 65 | "syn", 66 | ] 67 | 68 | [[package]] 69 | name = "auto_impl" 70 | version = "0.5.0" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" 73 | dependencies = [ 74 | "proc-macro-error", 75 | "proc-macro2", 76 | "quote", 77 | "syn", 78 | ] 79 | 80 | [[package]] 81 | name = "autocfg" 82 | version = "1.0.1" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 85 | 86 | [[package]] 87 | name = "base64" 88 | version = "0.11.0" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" 91 | 92 | [[package]] 93 | name = "base64" 94 | version = "0.13.0" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 97 | 98 | [[package]] 99 | name = "bitflags" 100 | version = "1.3.2" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 103 | 104 | [[package]] 105 | name = "block-buffer" 106 | version = "0.9.0" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 109 | dependencies = [ 110 | "generic-array", 111 | ] 112 | 113 | [[package]] 114 | name = "browserslist-rs" 115 | version = "0.7.0" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "38854056e7d44ad7af1214b7de30ceb71fff036ed67f3d1b48cc1200bb722cba" 118 | dependencies = [ 119 | "ahash", 120 | "anyhow", 121 | "chrono", 122 | "either", 123 | "itertools", 124 | "js-sys", 125 | "nom", 126 | "once_cell", 127 | "quote", 128 | "serde", 129 | "serde-wasm-bindgen", 130 | "serde_json", 131 | "string_cache", 132 | "string_cache_codegen", 133 | "thiserror", 134 | "wasm-bindgen", 135 | ] 136 | 137 | [[package]] 138 | name = "bumpalo" 139 | version = "3.9.1" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" 142 | 143 | [[package]] 144 | name = "cfg-if" 145 | version = "0.1.10" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 148 | 149 | [[package]] 150 | name = "cfg-if" 151 | version = "1.0.0" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 154 | 155 | [[package]] 156 | name = "chrono" 157 | version = "0.4.19" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" 160 | dependencies = [ 161 | "js-sys", 162 | "libc", 163 | "num-integer", 164 | "num-traits", 165 | "time", 166 | "wasm-bindgen", 167 | "winapi", 168 | ] 169 | 170 | [[package]] 171 | name = "cpufeatures" 172 | version = "0.2.1" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" 175 | dependencies = [ 176 | "libc", 177 | ] 178 | 179 | [[package]] 180 | name = "crossbeam-channel" 181 | version = "0.5.2" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" 184 | dependencies = [ 185 | "cfg-if 1.0.0", 186 | "crossbeam-utils", 187 | ] 188 | 189 | [[package]] 190 | name = "crossbeam-deque" 191 | version = "0.8.1" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" 194 | dependencies = [ 195 | "cfg-if 1.0.0", 196 | "crossbeam-epoch", 197 | "crossbeam-utils", 198 | ] 199 | 200 | [[package]] 201 | name = "crossbeam-epoch" 202 | version = "0.9.6" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" 205 | dependencies = [ 206 | "cfg-if 1.0.0", 207 | "crossbeam-utils", 208 | "lazy_static", 209 | "memoffset", 210 | "scopeguard", 211 | ] 212 | 213 | [[package]] 214 | name = "crossbeam-utils" 215 | version = "0.8.6" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" 218 | dependencies = [ 219 | "cfg-if 1.0.0", 220 | "lazy_static", 221 | ] 222 | 223 | [[package]] 224 | name = "darling" 225 | version = "0.10.2" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" 228 | dependencies = [ 229 | "darling_core", 230 | "darling_macro", 231 | ] 232 | 233 | [[package]] 234 | name = "darling_core" 235 | version = "0.10.2" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" 238 | dependencies = [ 239 | "fnv", 240 | "ident_case", 241 | "proc-macro2", 242 | "quote", 243 | "strsim", 244 | "syn", 245 | ] 246 | 247 | [[package]] 248 | name = "darling_macro" 249 | version = "0.10.2" 250 | source = "registry+https://github.com/rust-lang/crates.io-index" 251 | checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" 252 | dependencies = [ 253 | "darling_core", 254 | "quote", 255 | "syn", 256 | ] 257 | 258 | [[package]] 259 | name = "dashmap" 260 | version = "4.0.2" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" 263 | dependencies = [ 264 | "cfg-if 1.0.0", 265 | "num_cpus", 266 | ] 267 | 268 | [[package]] 269 | name = "debug_unreachable" 270 | version = "0.1.1" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "9a032eac705ca39214d169f83e3d3da290af06d8d1d344d1baad2fd002dca4b3" 273 | dependencies = [ 274 | "unreachable", 275 | ] 276 | 277 | [[package]] 278 | name = "digest" 279 | version = "0.9.0" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 282 | dependencies = [ 283 | "generic-array", 284 | ] 285 | 286 | [[package]] 287 | name = "either" 288 | version = "1.6.1" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" 291 | 292 | [[package]] 293 | name = "enum_kind" 294 | version = "0.2.1" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "78b940da354ae81ef0926c5eaa428207b8f4f091d3956c891dfbd124162bed99" 297 | dependencies = [ 298 | "pmutil", 299 | "proc-macro2", 300 | "swc_macros_common", 301 | "syn", 302 | ] 303 | 304 | [[package]] 305 | name = "fnv" 306 | version = "1.0.7" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 309 | 310 | [[package]] 311 | name = "form_urlencoded" 312 | version = "1.0.1" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 315 | dependencies = [ 316 | "matches", 317 | "percent-encoding", 318 | ] 319 | 320 | [[package]] 321 | name = "from_variant" 322 | version = "0.1.3" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "0951635027ca477be98f8774abd6f0345233439d63f307e47101acb40c7cc63d" 325 | dependencies = [ 326 | "pmutil", 327 | "proc-macro2", 328 | "swc_macros_common", 329 | "syn", 330 | ] 331 | 332 | [[package]] 333 | name = "generic-array" 334 | version = "0.14.5" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" 337 | dependencies = [ 338 | "typenum", 339 | "version_check", 340 | ] 341 | 342 | [[package]] 343 | name = "getrandom" 344 | version = "0.1.16" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 347 | dependencies = [ 348 | "cfg-if 1.0.0", 349 | "libc", 350 | "wasi 0.9.0+wasi-snapshot-preview1", 351 | ] 352 | 353 | [[package]] 354 | name = "getrandom" 355 | version = "0.2.4" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" 358 | dependencies = [ 359 | "cfg-if 1.0.0", 360 | "libc", 361 | "wasi 0.10.2+wasi-snapshot-preview1", 362 | ] 363 | 364 | [[package]] 365 | name = "hashbrown" 366 | version = "0.11.2" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 369 | dependencies = [ 370 | "ahash", 371 | ] 372 | 373 | [[package]] 374 | name = "hermit-abi" 375 | version = "0.1.19" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 378 | dependencies = [ 379 | "libc", 380 | ] 381 | 382 | [[package]] 383 | name = "ident_case" 384 | version = "1.0.1" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 387 | 388 | [[package]] 389 | name = "idna" 390 | version = "0.2.3" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 393 | dependencies = [ 394 | "matches", 395 | "unicode-bidi", 396 | "unicode-normalization", 397 | ] 398 | 399 | [[package]] 400 | name = "if_chain" 401 | version = "1.0.2" 402 | source = "registry+https://github.com/rust-lang/crates.io-index" 403 | checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" 404 | 405 | [[package]] 406 | name = "indexmap" 407 | version = "1.8.0" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" 410 | dependencies = [ 411 | "autocfg", 412 | "hashbrown", 413 | "serde", 414 | ] 415 | 416 | [[package]] 417 | name = "instant" 418 | version = "0.1.12" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 421 | dependencies = [ 422 | "cfg-if 1.0.0", 423 | ] 424 | 425 | [[package]] 426 | name = "is-macro" 427 | version = "0.2.0" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "94b2c46692aee0d1b3aad44e781ac0f0e7db42ef27adaa0a877b627040019813" 430 | dependencies = [ 431 | "Inflector", 432 | "pmutil", 433 | "proc-macro2", 434 | "quote", 435 | "syn", 436 | ] 437 | 438 | [[package]] 439 | name = "itertools" 440 | version = "0.10.3" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" 443 | dependencies = [ 444 | "either", 445 | ] 446 | 447 | [[package]] 448 | name = "itoa" 449 | version = "1.0.1" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" 452 | 453 | [[package]] 454 | name = "js-sys" 455 | version = "0.3.49" 456 | source = "registry+https://github.com/rust-lang/crates.io-index" 457 | checksum = "dc15e39392125075f60c95ba416f5381ff6c3a948ff02ab12464715adf56c821" 458 | dependencies = [ 459 | "wasm-bindgen", 460 | ] 461 | 462 | [[package]] 463 | name = "lazy_static" 464 | version = "1.4.0" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 467 | 468 | [[package]] 469 | name = "lexical" 470 | version = "5.2.2" 471 | source = "registry+https://github.com/rust-lang/crates.io-index" 472 | checksum = "f404a90a744e32e8be729034fc33b90cf2a56418fbf594d69aa3c0214ad414e5" 473 | dependencies = [ 474 | "cfg-if 1.0.0", 475 | "lexical-core", 476 | ] 477 | 478 | [[package]] 479 | name = "lexical-core" 480 | version = "0.7.6" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" 483 | dependencies = [ 484 | "arrayvec 0.5.2", 485 | "bitflags", 486 | "cfg-if 1.0.0", 487 | "ryu", 488 | "static_assertions", 489 | ] 490 | 491 | [[package]] 492 | name = "libc" 493 | version = "0.2.114" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "b0005d08a8f7b65fb8073cb697aa0b12b631ed251ce73d862ce50eeb52ce3b50" 496 | 497 | [[package]] 498 | name = "lock_api" 499 | version = "0.4.5" 500 | source = "registry+https://github.com/rust-lang/crates.io-index" 501 | checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" 502 | dependencies = [ 503 | "scopeguard", 504 | ] 505 | 506 | [[package]] 507 | name = "log" 508 | version = "0.4.14" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 511 | dependencies = [ 512 | "cfg-if 1.0.0", 513 | ] 514 | 515 | [[package]] 516 | name = "lru" 517 | version = "0.7.2" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | checksum = "274353858935c992b13c0ca408752e2121da852d07dec7ce5f108c77dfa14d1f" 520 | dependencies = [ 521 | "hashbrown", 522 | ] 523 | 524 | [[package]] 525 | name = "matches" 526 | version = "0.1.9" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 529 | 530 | [[package]] 531 | name = "memchr" 532 | version = "2.4.1" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 535 | 536 | [[package]] 537 | name = "memoffset" 538 | version = "0.6.5" 539 | source = "registry+https://github.com/rust-lang/crates.io-index" 540 | checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" 541 | dependencies = [ 542 | "autocfg", 543 | ] 544 | 545 | [[package]] 546 | name = "minimal-lexical" 547 | version = "0.2.1" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 550 | 551 | [[package]] 552 | name = "new_debug_unreachable" 553 | version = "1.0.4" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" 556 | 557 | [[package]] 558 | name = "nom" 559 | version = "7.1.0" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" 562 | dependencies = [ 563 | "memchr", 564 | "minimal-lexical", 565 | "version_check", 566 | ] 567 | 568 | [[package]] 569 | name = "normpath" 570 | version = "0.2.0" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "2a9da8c9922c35a1033d76f7272dfc2e7ee20392083d75aeea6ced23c6266578" 573 | dependencies = [ 574 | "winapi", 575 | ] 576 | 577 | [[package]] 578 | name = "num-bigint" 579 | version = "0.2.6" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" 582 | dependencies = [ 583 | "autocfg", 584 | "num-integer", 585 | "num-traits", 586 | "serde", 587 | ] 588 | 589 | [[package]] 590 | name = "num-integer" 591 | version = "0.1.44" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" 594 | dependencies = [ 595 | "autocfg", 596 | "num-traits", 597 | ] 598 | 599 | [[package]] 600 | name = "num-traits" 601 | version = "0.2.14" 602 | source = "registry+https://github.com/rust-lang/crates.io-index" 603 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 604 | dependencies = [ 605 | "autocfg", 606 | ] 607 | 608 | [[package]] 609 | name = "num_cpus" 610 | version = "1.13.1" 611 | source = "registry+https://github.com/rust-lang/crates.io-index" 612 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 613 | dependencies = [ 614 | "hermit-abi", 615 | "libc", 616 | ] 617 | 618 | [[package]] 619 | name = "once_cell" 620 | version = "1.9.0" 621 | source = "registry+https://github.com/rust-lang/crates.io-index" 622 | checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" 623 | 624 | [[package]] 625 | name = "opaque-debug" 626 | version = "0.3.0" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 629 | 630 | [[package]] 631 | name = "ordered-float" 632 | version = "2.10.0" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" 635 | dependencies = [ 636 | "num-traits", 637 | ] 638 | 639 | [[package]] 640 | name = "owning_ref" 641 | version = "0.4.1" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" 644 | dependencies = [ 645 | "stable_deref_trait", 646 | ] 647 | 648 | [[package]] 649 | name = "parking_lot" 650 | version = "0.11.2" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 653 | dependencies = [ 654 | "instant", 655 | "lock_api", 656 | "parking_lot_core", 657 | ] 658 | 659 | [[package]] 660 | name = "parking_lot_core" 661 | version = "0.8.5" 662 | source = "registry+https://github.com/rust-lang/crates.io-index" 663 | checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" 664 | dependencies = [ 665 | "cfg-if 1.0.0", 666 | "instant", 667 | "libc", 668 | "redox_syscall", 669 | "smallvec", 670 | "winapi", 671 | ] 672 | 673 | [[package]] 674 | name = "path-clean" 675 | version = "0.1.0" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd" 678 | 679 | [[package]] 680 | name = "pathdiff" 681 | version = "0.2.1" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" 684 | 685 | [[package]] 686 | name = "percent-encoding" 687 | version = "2.1.0" 688 | source = "registry+https://github.com/rust-lang/crates.io-index" 689 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 690 | 691 | [[package]] 692 | name = "phf" 693 | version = "0.8.0" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" 696 | dependencies = [ 697 | "phf_macros", 698 | "phf_shared", 699 | "proc-macro-hack", 700 | ] 701 | 702 | [[package]] 703 | name = "phf_generator" 704 | version = "0.8.0" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" 707 | dependencies = [ 708 | "phf_shared", 709 | "rand", 710 | ] 711 | 712 | [[package]] 713 | name = "phf_macros" 714 | version = "0.8.0" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" 717 | dependencies = [ 718 | "phf_generator", 719 | "phf_shared", 720 | "proc-macro-hack", 721 | "proc-macro2", 722 | "quote", 723 | "syn", 724 | ] 725 | 726 | [[package]] 727 | name = "phf_shared" 728 | version = "0.8.0" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" 731 | dependencies = [ 732 | "siphasher", 733 | ] 734 | 735 | [[package]] 736 | name = "pin-project-lite" 737 | version = "0.2.8" 738 | source = "registry+https://github.com/rust-lang/crates.io-index" 739 | checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" 740 | 741 | [[package]] 742 | name = "pmutil" 743 | version = "0.5.3" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "3894e5d549cccbe44afecf72922f277f603cd4bb0219c8342631ef18fffbe004" 746 | dependencies = [ 747 | "proc-macro2", 748 | "quote", 749 | "syn", 750 | ] 751 | 752 | [[package]] 753 | name = "ppv-lite86" 754 | version = "0.2.16" 755 | source = "registry+https://github.com/rust-lang/crates.io-index" 756 | checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" 757 | 758 | [[package]] 759 | name = "precomputed-hash" 760 | version = "0.1.1" 761 | source = "registry+https://github.com/rust-lang/crates.io-index" 762 | checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" 763 | 764 | [[package]] 765 | name = "proc-macro-error" 766 | version = "1.0.4" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 769 | dependencies = [ 770 | "proc-macro-error-attr", 771 | "proc-macro2", 772 | "quote", 773 | "syn", 774 | "version_check", 775 | ] 776 | 777 | [[package]] 778 | name = "proc-macro-error-attr" 779 | version = "1.0.4" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 782 | dependencies = [ 783 | "proc-macro2", 784 | "quote", 785 | "version_check", 786 | ] 787 | 788 | [[package]] 789 | name = "proc-macro-hack" 790 | version = "0.5.19" 791 | source = "registry+https://github.com/rust-lang/crates.io-index" 792 | checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" 793 | 794 | [[package]] 795 | name = "proc-macro2" 796 | version = "1.0.36" 797 | source = "registry+https://github.com/rust-lang/crates.io-index" 798 | checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" 799 | dependencies = [ 800 | "unicode-xid", 801 | ] 802 | 803 | [[package]] 804 | name = "quote" 805 | version = "1.0.15" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" 808 | dependencies = [ 809 | "proc-macro2", 810 | ] 811 | 812 | [[package]] 813 | name = "rand" 814 | version = "0.7.3" 815 | source = "registry+https://github.com/rust-lang/crates.io-index" 816 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 817 | dependencies = [ 818 | "getrandom 0.1.16", 819 | "libc", 820 | "rand_chacha", 821 | "rand_core", 822 | "rand_hc", 823 | "rand_pcg", 824 | ] 825 | 826 | [[package]] 827 | name = "rand_chacha" 828 | version = "0.2.2" 829 | source = "registry+https://github.com/rust-lang/crates.io-index" 830 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 831 | dependencies = [ 832 | "ppv-lite86", 833 | "rand_core", 834 | ] 835 | 836 | [[package]] 837 | name = "rand_core" 838 | version = "0.5.1" 839 | source = "registry+https://github.com/rust-lang/crates.io-index" 840 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 841 | dependencies = [ 842 | "getrandom 0.1.16", 843 | ] 844 | 845 | [[package]] 846 | name = "rand_hc" 847 | version = "0.2.0" 848 | source = "registry+https://github.com/rust-lang/crates.io-index" 849 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 850 | dependencies = [ 851 | "rand_core", 852 | ] 853 | 854 | [[package]] 855 | name = "rand_pcg" 856 | version = "0.2.1" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" 859 | dependencies = [ 860 | "rand_core", 861 | ] 862 | 863 | [[package]] 864 | name = "rayon" 865 | version = "1.5.1" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" 868 | dependencies = [ 869 | "autocfg", 870 | "crossbeam-deque", 871 | "either", 872 | "rayon-core", 873 | ] 874 | 875 | [[package]] 876 | name = "rayon-core" 877 | version = "1.9.1" 878 | source = "registry+https://github.com/rust-lang/crates.io-index" 879 | checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" 880 | dependencies = [ 881 | "crossbeam-channel", 882 | "crossbeam-deque", 883 | "crossbeam-utils", 884 | "lazy_static", 885 | "num_cpus", 886 | ] 887 | 888 | [[package]] 889 | name = "redox_syscall" 890 | version = "0.2.10" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 893 | dependencies = [ 894 | "bitflags", 895 | ] 896 | 897 | [[package]] 898 | name = "regex" 899 | version = "1.5.4" 900 | source = "registry+https://github.com/rust-lang/crates.io-index" 901 | checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" 902 | dependencies = [ 903 | "aho-corasick", 904 | "memchr", 905 | "regex-syntax", 906 | ] 907 | 908 | [[package]] 909 | name = "regex-syntax" 910 | version = "0.6.25" 911 | source = "registry+https://github.com/rust-lang/crates.io-index" 912 | checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" 913 | 914 | [[package]] 915 | name = "retain_mut" 916 | version = "0.1.5" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "11000e6ba5020e53e7cc26f73b91ae7d5496b4977851479edb66b694c0675c21" 919 | 920 | [[package]] 921 | name = "rustc-hash" 922 | version = "1.1.0" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 925 | 926 | [[package]] 927 | name = "rustc_version" 928 | version = "0.2.3" 929 | source = "registry+https://github.com/rust-lang/crates.io-index" 930 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 931 | dependencies = [ 932 | "semver 0.9.0", 933 | ] 934 | 935 | [[package]] 936 | name = "ryu" 937 | version = "1.0.9" 938 | source = "registry+https://github.com/rust-lang/crates.io-index" 939 | checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" 940 | 941 | [[package]] 942 | name = "same-file" 943 | version = "1.0.6" 944 | source = "registry+https://github.com/rust-lang/crates.io-index" 945 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 946 | dependencies = [ 947 | "winapi-util", 948 | ] 949 | 950 | [[package]] 951 | name = "scoped-tls" 952 | version = "1.0.0" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" 955 | 956 | [[package]] 957 | name = "scopeguard" 958 | version = "1.1.0" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 961 | 962 | [[package]] 963 | name = "semver" 964 | version = "0.9.0" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 967 | dependencies = [ 968 | "semver-parser", 969 | ] 970 | 971 | [[package]] 972 | name = "semver" 973 | version = "1.0.4" 974 | source = "registry+https://github.com/rust-lang/crates.io-index" 975 | checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" 976 | dependencies = [ 977 | "serde", 978 | ] 979 | 980 | [[package]] 981 | name = "semver-parser" 982 | version = "0.7.0" 983 | source = "registry+https://github.com/rust-lang/crates.io-index" 984 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 985 | 986 | [[package]] 987 | name = "serde" 988 | version = "1.0.135" 989 | source = "registry+https://github.com/rust-lang/crates.io-index" 990 | checksum = "2cf9235533494ea2ddcdb794665461814781c53f19d87b76e571a1c35acbad2b" 991 | dependencies = [ 992 | "serde_derive", 993 | ] 994 | 995 | [[package]] 996 | name = "serde-wasm-bindgen" 997 | version = "0.3.1" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "618365e8e586c22123d692b72a7d791d5ee697817b65a218cdf12a98870af0f7" 1000 | dependencies = [ 1001 | "fnv", 1002 | "js-sys", 1003 | "serde", 1004 | "wasm-bindgen", 1005 | ] 1006 | 1007 | [[package]] 1008 | name = "serde_derive" 1009 | version = "1.0.135" 1010 | source = "registry+https://github.com/rust-lang/crates.io-index" 1011 | checksum = "8dcde03d87d4c973c04be249e7d8f0b35db1c848c487bd43032808e59dd8328d" 1012 | dependencies = [ 1013 | "proc-macro2", 1014 | "quote", 1015 | "syn", 1016 | ] 1017 | 1018 | [[package]] 1019 | name = "serde_json" 1020 | version = "1.0.78" 1021 | source = "registry+https://github.com/rust-lang/crates.io-index" 1022 | checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" 1023 | dependencies = [ 1024 | "itoa", 1025 | "ryu", 1026 | "serde", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "serde_regex" 1031 | version = "1.1.0" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" 1034 | dependencies = [ 1035 | "regex", 1036 | "serde", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "sha-1" 1041 | version = "0.9.8" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" 1044 | dependencies = [ 1045 | "block-buffer", 1046 | "cfg-if 1.0.0", 1047 | "cpufeatures", 1048 | "digest", 1049 | "opaque-debug", 1050 | ] 1051 | 1052 | [[package]] 1053 | name = "siphasher" 1054 | version = "0.3.9" 1055 | source = "registry+https://github.com/rust-lang/crates.io-index" 1056 | checksum = "a86232ab60fa71287d7f2ddae4a7073f6b7aac33631c3015abb556f08c6d0a3e" 1057 | 1058 | [[package]] 1059 | name = "smallvec" 1060 | version = "1.8.0" 1061 | source = "registry+https://github.com/rust-lang/crates.io-index" 1062 | checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" 1063 | 1064 | [[package]] 1065 | name = "sourcemap" 1066 | version = "6.0.1" 1067 | source = "registry+https://github.com/rust-lang/crates.io-index" 1068 | checksum = "6e031f2463ecbdd5f34c950f89f5c1e1032f22c0f8e3dc4bdb2e8b6658cf61eb" 1069 | dependencies = [ 1070 | "base64 0.11.0", 1071 | "if_chain", 1072 | "lazy_static", 1073 | "regex", 1074 | "rustc_version", 1075 | "serde", 1076 | "serde_json", 1077 | "url", 1078 | ] 1079 | 1080 | [[package]] 1081 | name = "st-map" 1082 | version = "0.1.4" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | checksum = "3caeb13a58f859600a7b75fffe66322e1fca0122ca02cfc7262344a7e30502d1" 1085 | dependencies = [ 1086 | "arrayvec 0.5.2", 1087 | "static-map-macro", 1088 | ] 1089 | 1090 | [[package]] 1091 | name = "stable_deref_trait" 1092 | version = "1.2.0" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1095 | 1096 | [[package]] 1097 | name = "static-map-macro" 1098 | version = "0.2.1" 1099 | source = "registry+https://github.com/rust-lang/crates.io-index" 1100 | checksum = "d5503e07f148238811bbfd578684a0457c7284bab41b60d76def35431a1295fd" 1101 | dependencies = [ 1102 | "pmutil", 1103 | "proc-macro2", 1104 | "quote", 1105 | "syn", 1106 | ] 1107 | 1108 | [[package]] 1109 | name = "static_assertions" 1110 | version = "1.1.0" 1111 | source = "registry+https://github.com/rust-lang/crates.io-index" 1112 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1113 | 1114 | [[package]] 1115 | name = "string_cache" 1116 | version = "0.8.2" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "923f0f39b6267d37d23ce71ae7235602134b250ace715dd2c90421998ddac0c6" 1119 | dependencies = [ 1120 | "lazy_static", 1121 | "new_debug_unreachable", 1122 | "parking_lot", 1123 | "phf_shared", 1124 | "precomputed-hash", 1125 | "serde", 1126 | ] 1127 | 1128 | [[package]] 1129 | name = "string_cache_codegen" 1130 | version = "0.5.1" 1131 | source = "registry+https://github.com/rust-lang/crates.io-index" 1132 | checksum = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97" 1133 | dependencies = [ 1134 | "phf_generator", 1135 | "phf_shared", 1136 | "proc-macro2", 1137 | "quote", 1138 | ] 1139 | 1140 | [[package]] 1141 | name = "string_enum" 1142 | version = "0.3.1" 1143 | source = "registry+https://github.com/rust-lang/crates.io-index" 1144 | checksum = "f584cc881e9e5f1fd6bf827b0444aa94c30d8fe6378cf241071b5f5700b2871f" 1145 | dependencies = [ 1146 | "pmutil", 1147 | "proc-macro2", 1148 | "quote", 1149 | "swc_macros_common", 1150 | "syn", 1151 | ] 1152 | 1153 | [[package]] 1154 | name = "strsim" 1155 | version = "0.9.3" 1156 | source = "registry+https://github.com/rust-lang/crates.io-index" 1157 | checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" 1158 | 1159 | [[package]] 1160 | name = "swc" 1161 | version = "0.120.0" 1162 | source = "registry+https://github.com/rust-lang/crates.io-index" 1163 | checksum = "6ea0c3f9526c54e56fc333f32d14ba57168c3d0af7d24098e2e1071dd836f737" 1164 | dependencies = [ 1165 | "ahash", 1166 | "anyhow", 1167 | "base64 0.13.0", 1168 | "dashmap", 1169 | "either", 1170 | "indexmap", 1171 | "lru", 1172 | "once_cell", 1173 | "pathdiff", 1174 | "regex", 1175 | "serde", 1176 | "serde_json", 1177 | "sourcemap", 1178 | "swc_atoms", 1179 | "swc_common", 1180 | "swc_ecma_ast", 1181 | "swc_ecma_codegen", 1182 | "swc_ecma_ext_transforms", 1183 | "swc_ecma_lints", 1184 | "swc_ecma_loader", 1185 | "swc_ecma_minifier", 1186 | "swc_ecma_parser", 1187 | "swc_ecma_preset_env", 1188 | "swc_ecma_transforms", 1189 | "swc_ecma_transforms_base", 1190 | "swc_ecma_transforms_compat", 1191 | "swc_ecma_transforms_optimization", 1192 | "swc_ecma_utils", 1193 | "swc_ecma_visit", 1194 | "swc_ecmascript", 1195 | "swc_node_comments", 1196 | "swc_visit", 1197 | "tracing", 1198 | ] 1199 | 1200 | [[package]] 1201 | name = "swc-wasi" 1202 | version = "0.1.0" 1203 | dependencies = [ 1204 | "swc", 1205 | "swc_ecma_minifier", 1206 | "swc_ecmascript", 1207 | ] 1208 | 1209 | [[package]] 1210 | name = "swc_atoms" 1211 | version = "0.2.9" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "9f5229fe227ff0060e13baa386d6e368797700eab909523f730008d191ee53ae" 1214 | dependencies = [ 1215 | "string_cache", 1216 | "string_cache_codegen", 1217 | ] 1218 | 1219 | [[package]] 1220 | name = "swc_common" 1221 | version = "0.17.2" 1222 | source = "registry+https://github.com/rust-lang/crates.io-index" 1223 | checksum = "a23e045ca915a377988b2a419cc28f4f981ce40368084d5b18b7d15a84f84872" 1224 | dependencies = [ 1225 | "ahash", 1226 | "ast_node", 1227 | "cfg-if 0.1.10", 1228 | "debug_unreachable", 1229 | "either", 1230 | "from_variant", 1231 | "num-bigint", 1232 | "once_cell", 1233 | "owning_ref", 1234 | "parking_lot", 1235 | "rustc-hash", 1236 | "scoped-tls", 1237 | "serde", 1238 | "siphasher", 1239 | "sourcemap", 1240 | "string_cache", 1241 | "swc_eq_ignore_macros", 1242 | "swc_visit", 1243 | "tracing", 1244 | "unicode-width", 1245 | "url", 1246 | ] 1247 | 1248 | [[package]] 1249 | name = "swc_ecma_ast" 1250 | version = "0.65.3" 1251 | source = "registry+https://github.com/rust-lang/crates.io-index" 1252 | checksum = "ff1aefdc512c8dfefa1de793c0e62a192bd74a7fa7e5affe3f08885751c127ee" 1253 | dependencies = [ 1254 | "is-macro", 1255 | "num-bigint", 1256 | "serde", 1257 | "string_enum", 1258 | "swc_atoms", 1259 | "swc_common", 1260 | "unicode-xid", 1261 | ] 1262 | 1263 | [[package]] 1264 | name = "swc_ecma_codegen" 1265 | version = "0.89.1" 1266 | source = "registry+https://github.com/rust-lang/crates.io-index" 1267 | checksum = "b627edd495a93306f21e435c06227fe57910c1f6054f4c966e917c001142da9e" 1268 | dependencies = [ 1269 | "bitflags", 1270 | "memchr", 1271 | "num-bigint", 1272 | "once_cell", 1273 | "sourcemap", 1274 | "swc_atoms", 1275 | "swc_common", 1276 | "swc_ecma_ast", 1277 | "swc_ecma_codegen_macros", 1278 | "swc_ecma_parser", 1279 | "tracing", 1280 | ] 1281 | 1282 | [[package]] 1283 | name = "swc_ecma_codegen_macros" 1284 | version = "0.6.0" 1285 | source = "registry+https://github.com/rust-lang/crates.io-index" 1286 | checksum = "bdbf826c739281cdb3b3c23883fd1a7586ea1c15b1287530e7123a7fad8f0e25" 1287 | dependencies = [ 1288 | "pmutil", 1289 | "proc-macro2", 1290 | "quote", 1291 | "swc_macros_common", 1292 | "syn", 1293 | ] 1294 | 1295 | [[package]] 1296 | name = "swc_ecma_ext_transforms" 1297 | version = "0.50.0" 1298 | source = "registry+https://github.com/rust-lang/crates.io-index" 1299 | checksum = "00f53e3fb1eb71059fe70497910205d86f2d148f26ed55e707598e11d5e98284" 1300 | dependencies = [ 1301 | "phf", 1302 | "swc_atoms", 1303 | "swc_common", 1304 | "swc_ecma_ast", 1305 | "swc_ecma_utils", 1306 | "swc_ecma_visit", 1307 | ] 1308 | 1309 | [[package]] 1310 | name = "swc_ecma_lints" 1311 | version = "0.12.0" 1312 | source = "registry+https://github.com/rust-lang/crates.io-index" 1313 | checksum = "69fb38c77b23b375e9dd3df8bfd1bf2ee8c214559bed73c97a0aec4efadea780" 1314 | dependencies = [ 1315 | "auto_impl", 1316 | "parking_lot", 1317 | "rayon", 1318 | "serde", 1319 | "swc_atoms", 1320 | "swc_common", 1321 | "swc_ecma_ast", 1322 | "swc_ecma_utils", 1323 | "swc_ecma_visit", 1324 | ] 1325 | 1326 | [[package]] 1327 | name = "swc_ecma_loader" 1328 | version = "0.28.0" 1329 | source = "registry+https://github.com/rust-lang/crates.io-index" 1330 | checksum = "be60d3b599557e0b49d06e9cad351ec196e2ab9e9a369a0780f000a47ab58404" 1331 | dependencies = [ 1332 | "ahash", 1333 | "anyhow", 1334 | "dashmap", 1335 | "lru", 1336 | "normpath", 1337 | "once_cell", 1338 | "path-clean", 1339 | "regex", 1340 | "serde", 1341 | "serde_json", 1342 | "swc_common", 1343 | "tracing", 1344 | ] 1345 | 1346 | [[package]] 1347 | name = "swc_ecma_minifier" 1348 | version = "0.71.4" 1349 | source = "registry+https://github.com/rust-lang/crates.io-index" 1350 | checksum = "1d347be6b2b477b8f5cebc9fa3eedecf05a4a48c7b9b0fe44b8d9f78b538b95e" 1351 | dependencies = [ 1352 | "ahash", 1353 | "indexmap", 1354 | "once_cell", 1355 | "rayon", 1356 | "regex", 1357 | "retain_mut", 1358 | "serde", 1359 | "serde_json", 1360 | "serde_regex", 1361 | "swc_atoms", 1362 | "swc_common", 1363 | "swc_ecma_ast", 1364 | "swc_ecma_codegen", 1365 | "swc_ecma_parser", 1366 | "swc_ecma_transforms", 1367 | "swc_ecma_transforms_base", 1368 | "swc_ecma_utils", 1369 | "swc_ecma_visit", 1370 | "swc_timer", 1371 | "tracing", 1372 | "unicode-xid", 1373 | ] 1374 | 1375 | [[package]] 1376 | name = "swc_ecma_parser" 1377 | version = "0.87.1" 1378 | source = "registry+https://github.com/rust-lang/crates.io-index" 1379 | checksum = "f032c57793a287a8b374e92a2b606e5eb890539285e4723fe6acb9be1fadcec6" 1380 | dependencies = [ 1381 | "either", 1382 | "enum_kind", 1383 | "lexical", 1384 | "num-bigint", 1385 | "serde", 1386 | "smallvec", 1387 | "swc_atoms", 1388 | "swc_common", 1389 | "swc_ecma_ast", 1390 | "tracing", 1391 | "typed-arena", 1392 | "unicode-xid", 1393 | ] 1394 | 1395 | [[package]] 1396 | name = "swc_ecma_preset_env" 1397 | version = "0.87.1" 1398 | source = "registry+https://github.com/rust-lang/crates.io-index" 1399 | checksum = "b0a9ea302378eac03ffe84aa3898bb8a48dc3ec939044b0cd341aae73388f9f1" 1400 | dependencies = [ 1401 | "ahash", 1402 | "anyhow", 1403 | "browserslist-rs", 1404 | "dashmap", 1405 | "indexmap", 1406 | "once_cell", 1407 | "semver 1.0.4", 1408 | "serde", 1409 | "serde_json", 1410 | "st-map", 1411 | "string_enum", 1412 | "swc_atoms", 1413 | "swc_common", 1414 | "swc_ecma_ast", 1415 | "swc_ecma_transforms", 1416 | "swc_ecma_utils", 1417 | "swc_ecma_visit", 1418 | "walkdir", 1419 | ] 1420 | 1421 | [[package]] 1422 | name = "swc_ecma_transforms" 1423 | version = "0.114.4" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "7a427f8c29e7217b0405c72544bf4049023fa7b025d1a9c300a2f706bfd04f6b" 1426 | dependencies = [ 1427 | "swc_atoms", 1428 | "swc_common", 1429 | "swc_ecma_ast", 1430 | "swc_ecma_parser", 1431 | "swc_ecma_transforms_base", 1432 | "swc_ecma_transforms_compat", 1433 | "swc_ecma_transforms_module", 1434 | "swc_ecma_transforms_optimization", 1435 | "swc_ecma_transforms_proposal", 1436 | "swc_ecma_transforms_react", 1437 | "swc_ecma_transforms_typescript", 1438 | "swc_ecma_utils", 1439 | "swc_ecma_visit", 1440 | "unicode-xid", 1441 | ] 1442 | 1443 | [[package]] 1444 | name = "swc_ecma_transforms_base" 1445 | version = "0.57.1" 1446 | source = "registry+https://github.com/rust-lang/crates.io-index" 1447 | checksum = "df852cb3c04bfde542f2fe4493ff0262a053a94a8da068fcb3ab2f6f40bffe8f" 1448 | dependencies = [ 1449 | "once_cell", 1450 | "phf", 1451 | "scoped-tls", 1452 | "serde", 1453 | "smallvec", 1454 | "swc_atoms", 1455 | "swc_common", 1456 | "swc_ecma_ast", 1457 | "swc_ecma_parser", 1458 | "swc_ecma_utils", 1459 | "swc_ecma_visit", 1460 | "tracing", 1461 | ] 1462 | 1463 | [[package]] 1464 | name = "swc_ecma_transforms_classes" 1465 | version = "0.44.0" 1466 | source = "registry+https://github.com/rust-lang/crates.io-index" 1467 | checksum = "b1b841535a8a97698a556c50fd5993a351e76b8bfd1e770ffc1b5425c1814b98" 1468 | dependencies = [ 1469 | "swc_atoms", 1470 | "swc_common", 1471 | "swc_ecma_ast", 1472 | "swc_ecma_transforms_base", 1473 | "swc_ecma_utils", 1474 | "swc_ecma_visit", 1475 | ] 1476 | 1477 | [[package]] 1478 | name = "swc_ecma_transforms_compat" 1479 | version = "0.68.7" 1480 | source = "registry+https://github.com/rust-lang/crates.io-index" 1481 | checksum = "9a6eceb515704f8048f39776fb72f008922d7d2962a01602688cfa24803c3567" 1482 | dependencies = [ 1483 | "ahash", 1484 | "arrayvec 0.7.2", 1485 | "indexmap", 1486 | "is-macro", 1487 | "num-bigint", 1488 | "ordered-float", 1489 | "serde", 1490 | "smallvec", 1491 | "swc_atoms", 1492 | "swc_common", 1493 | "swc_ecma_ast", 1494 | "swc_ecma_transforms_base", 1495 | "swc_ecma_transforms_classes", 1496 | "swc_ecma_transforms_macros", 1497 | "swc_ecma_utils", 1498 | "swc_ecma_visit", 1499 | "tracing", 1500 | ] 1501 | 1502 | [[package]] 1503 | name = "swc_ecma_transforms_macros" 1504 | version = "0.3.0" 1505 | source = "registry+https://github.com/rust-lang/crates.io-index" 1506 | checksum = "18712e4aab969c6508dff3540ade6358f1e013464aa58b3d30da2ab2d9fcbbed" 1507 | dependencies = [ 1508 | "pmutil", 1509 | "proc-macro2", 1510 | "quote", 1511 | "swc_macros_common", 1512 | "syn", 1513 | ] 1514 | 1515 | [[package]] 1516 | name = "swc_ecma_transforms_module" 1517 | version = "0.75.2" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "87e2357092a72a907c63c84885c95611c35a9a30826bcdbbd6e0ad2f7873f8a2" 1520 | dependencies = [ 1521 | "Inflector", 1522 | "ahash", 1523 | "anyhow", 1524 | "indexmap", 1525 | "pathdiff", 1526 | "serde", 1527 | "swc_atoms", 1528 | "swc_common", 1529 | "swc_ecma_ast", 1530 | "swc_ecma_loader", 1531 | "swc_ecma_parser", 1532 | "swc_ecma_transforms_base", 1533 | "swc_ecma_utils", 1534 | "swc_ecma_visit", 1535 | ] 1536 | 1537 | [[package]] 1538 | name = "swc_ecma_transforms_optimization" 1539 | version = "0.84.0" 1540 | source = "registry+https://github.com/rust-lang/crates.io-index" 1541 | checksum = "06e2e2a955083d1a95dbf42322c7f3e3ee9e331960785a453f22fd3c63589ab6" 1542 | dependencies = [ 1543 | "ahash", 1544 | "dashmap", 1545 | "indexmap", 1546 | "once_cell", 1547 | "serde_json", 1548 | "swc_atoms", 1549 | "swc_common", 1550 | "swc_ecma_ast", 1551 | "swc_ecma_parser", 1552 | "swc_ecma_transforms_base", 1553 | "swc_ecma_transforms_macros", 1554 | "swc_ecma_utils", 1555 | "swc_ecma_visit", 1556 | "tracing", 1557 | ] 1558 | 1559 | [[package]] 1560 | name = "swc_ecma_transforms_proposal" 1561 | version = "0.75.1" 1562 | source = "registry+https://github.com/rust-lang/crates.io-index" 1563 | checksum = "b2d08a837960a7547435ccb94e860d81b3c3d67c52f7296c8753520cfba45b31" 1564 | dependencies = [ 1565 | "either", 1566 | "serde", 1567 | "smallvec", 1568 | "swc_atoms", 1569 | "swc_common", 1570 | "swc_ecma_ast", 1571 | "swc_ecma_parser", 1572 | "swc_ecma_transforms_base", 1573 | "swc_ecma_transforms_classes", 1574 | "swc_ecma_transforms_macros", 1575 | "swc_ecma_utils", 1576 | "swc_ecma_visit", 1577 | ] 1578 | 1579 | [[package]] 1580 | name = "swc_ecma_transforms_react" 1581 | version = "0.77.0" 1582 | source = "registry+https://github.com/rust-lang/crates.io-index" 1583 | checksum = "501833c2b1be774dcafcf999cf9256c4c33478778da46d125c525505d3542972" 1584 | dependencies = [ 1585 | "ahash", 1586 | "base64 0.13.0", 1587 | "dashmap", 1588 | "indexmap", 1589 | "once_cell", 1590 | "regex", 1591 | "serde", 1592 | "sha-1", 1593 | "string_enum", 1594 | "swc_atoms", 1595 | "swc_common", 1596 | "swc_ecma_ast", 1597 | "swc_ecma_parser", 1598 | "swc_ecma_transforms_base", 1599 | "swc_ecma_transforms_macros", 1600 | "swc_ecma_utils", 1601 | "swc_ecma_visit", 1602 | ] 1603 | 1604 | [[package]] 1605 | name = "swc_ecma_transforms_typescript" 1606 | version = "0.79.0" 1607 | source = "registry+https://github.com/rust-lang/crates.io-index" 1608 | checksum = "bbdfd5d240c6b32e84f89c66e7b259c6a0f2cde4630ac9e0ce1243807056c349" 1609 | dependencies = [ 1610 | "serde", 1611 | "swc_atoms", 1612 | "swc_common", 1613 | "swc_ecma_ast", 1614 | "swc_ecma_parser", 1615 | "swc_ecma_transforms_base", 1616 | "swc_ecma_transforms_react", 1617 | "swc_ecma_utils", 1618 | "swc_ecma_visit", 1619 | ] 1620 | 1621 | [[package]] 1622 | name = "swc_ecma_utils" 1623 | version = "0.64.0" 1624 | source = "registry+https://github.com/rust-lang/crates.io-index" 1625 | checksum = "8105c87f59b54e49b95164efbdf346b710e0a77390e89869527ee20f68687b91" 1626 | dependencies = [ 1627 | "indexmap", 1628 | "once_cell", 1629 | "swc_atoms", 1630 | "swc_common", 1631 | "swc_ecma_ast", 1632 | "swc_ecma_visit", 1633 | "tracing", 1634 | ] 1635 | 1636 | [[package]] 1637 | name = "swc_ecma_visit" 1638 | version = "0.51.1" 1639 | source = "registry+https://github.com/rust-lang/crates.io-index" 1640 | checksum = "32aa4c53401d1390aa45043e0a69d52e1a04ef45845e19b55c484462e6dcd048" 1641 | dependencies = [ 1642 | "num-bigint", 1643 | "swc_atoms", 1644 | "swc_common", 1645 | "swc_ecma_ast", 1646 | "swc_visit", 1647 | "tracing", 1648 | ] 1649 | 1650 | [[package]] 1651 | name = "swc_ecmascript" 1652 | version = "0.111.10" 1653 | source = "registry+https://github.com/rust-lang/crates.io-index" 1654 | checksum = "d7dc93403df65d3d523bd6f2a4f7906e1c7cf4daa5d3ab808785abb6b60fbfe9" 1655 | dependencies = [ 1656 | "swc_ecma_ast", 1657 | "swc_ecma_parser", 1658 | ] 1659 | 1660 | [[package]] 1661 | name = "swc_eq_ignore_macros" 1662 | version = "0.1.0" 1663 | source = "registry+https://github.com/rust-lang/crates.io-index" 1664 | checksum = "8c8f200a2eaed938e7c1a685faaa66e6d42fa9e17da5f62572d3cbc335898f5e" 1665 | dependencies = [ 1666 | "pmutil", 1667 | "proc-macro2", 1668 | "quote", 1669 | "syn", 1670 | ] 1671 | 1672 | [[package]] 1673 | name = "swc_macros_common" 1674 | version = "0.3.3" 1675 | source = "registry+https://github.com/rust-lang/crates.io-index" 1676 | checksum = "08ed2e930f5a1a4071fe62c90fd3a296f6030e5d94bfe13993244423caf59a78" 1677 | dependencies = [ 1678 | "pmutil", 1679 | "proc-macro2", 1680 | "quote", 1681 | "syn", 1682 | ] 1683 | 1684 | [[package]] 1685 | name = "swc_node_comments" 1686 | version = "0.4.0" 1687 | source = "registry+https://github.com/rust-lang/crates.io-index" 1688 | checksum = "2cb940728fcaa85b619ae43c23110a2e88c1cd90e9a873bebb0f9f80e5ecd7e6" 1689 | dependencies = [ 1690 | "ahash", 1691 | "dashmap", 1692 | "swc_common", 1693 | ] 1694 | 1695 | [[package]] 1696 | name = "swc_timer" 1697 | version = "0.4.0" 1698 | source = "registry+https://github.com/rust-lang/crates.io-index" 1699 | checksum = "1371a950402552de1a2bf7beeb619b7fff9e4ab7e50f516db9a791869a4f731f" 1700 | dependencies = [ 1701 | "tracing", 1702 | ] 1703 | 1704 | [[package]] 1705 | name = "swc_visit" 1706 | version = "0.3.0" 1707 | source = "registry+https://github.com/rust-lang/crates.io-index" 1708 | checksum = "e5c639379dd2a8a0221fa1e12fafbdd594ba53a0cace6560054da52409dfcc1a" 1709 | dependencies = [ 1710 | "either", 1711 | "swc_visit_macros", 1712 | ] 1713 | 1714 | [[package]] 1715 | name = "swc_visit_macros" 1716 | version = "0.3.0" 1717 | source = "registry+https://github.com/rust-lang/crates.io-index" 1718 | checksum = "e505bbf8e11898fa05a65aa5e773c827ec743fc15aa3c064c9e06164ed0b6630" 1719 | dependencies = [ 1720 | "Inflector", 1721 | "pmutil", 1722 | "proc-macro2", 1723 | "quote", 1724 | "swc_macros_common", 1725 | "syn", 1726 | ] 1727 | 1728 | [[package]] 1729 | name = "syn" 1730 | version = "1.0.65" 1731 | source = "registry+https://github.com/rust-lang/crates.io-index" 1732 | checksum = "f3a1d708c221c5a612956ef9f75b37e454e88d1f7b899fbd3a18d4252012d663" 1733 | dependencies = [ 1734 | "proc-macro2", 1735 | "quote", 1736 | "unicode-xid", 1737 | ] 1738 | 1739 | [[package]] 1740 | name = "thiserror" 1741 | version = "1.0.30" 1742 | source = "registry+https://github.com/rust-lang/crates.io-index" 1743 | checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" 1744 | dependencies = [ 1745 | "thiserror-impl", 1746 | ] 1747 | 1748 | [[package]] 1749 | name = "thiserror-impl" 1750 | version = "1.0.30" 1751 | source = "registry+https://github.com/rust-lang/crates.io-index" 1752 | checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" 1753 | dependencies = [ 1754 | "proc-macro2", 1755 | "quote", 1756 | "syn", 1757 | ] 1758 | 1759 | [[package]] 1760 | name = "time" 1761 | version = "0.1.43" 1762 | source = "registry+https://github.com/rust-lang/crates.io-index" 1763 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 1764 | dependencies = [ 1765 | "libc", 1766 | "winapi", 1767 | ] 1768 | 1769 | [[package]] 1770 | name = "tinyvec" 1771 | version = "1.5.1" 1772 | source = "registry+https://github.com/rust-lang/crates.io-index" 1773 | checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" 1774 | dependencies = [ 1775 | "tinyvec_macros", 1776 | ] 1777 | 1778 | [[package]] 1779 | name = "tinyvec_macros" 1780 | version = "0.1.0" 1781 | source = "registry+https://github.com/rust-lang/crates.io-index" 1782 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1783 | 1784 | [[package]] 1785 | name = "tracing" 1786 | version = "0.1.29" 1787 | source = "registry+https://github.com/rust-lang/crates.io-index" 1788 | checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" 1789 | dependencies = [ 1790 | "cfg-if 1.0.0", 1791 | "pin-project-lite", 1792 | "tracing-attributes", 1793 | "tracing-core", 1794 | ] 1795 | 1796 | [[package]] 1797 | name = "tracing-attributes" 1798 | version = "0.1.18" 1799 | source = "registry+https://github.com/rust-lang/crates.io-index" 1800 | checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" 1801 | dependencies = [ 1802 | "proc-macro2", 1803 | "quote", 1804 | "syn", 1805 | ] 1806 | 1807 | [[package]] 1808 | name = "tracing-core" 1809 | version = "0.1.21" 1810 | source = "registry+https://github.com/rust-lang/crates.io-index" 1811 | checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" 1812 | dependencies = [ 1813 | "lazy_static", 1814 | ] 1815 | 1816 | [[package]] 1817 | name = "typed-arena" 1818 | version = "2.0.1" 1819 | source = "registry+https://github.com/rust-lang/crates.io-index" 1820 | checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" 1821 | 1822 | [[package]] 1823 | name = "typenum" 1824 | version = "1.15.0" 1825 | source = "registry+https://github.com/rust-lang/crates.io-index" 1826 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 1827 | 1828 | [[package]] 1829 | name = "unicode-bidi" 1830 | version = "0.3.7" 1831 | source = "registry+https://github.com/rust-lang/crates.io-index" 1832 | checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" 1833 | 1834 | [[package]] 1835 | name = "unicode-normalization" 1836 | version = "0.1.19" 1837 | source = "registry+https://github.com/rust-lang/crates.io-index" 1838 | checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" 1839 | dependencies = [ 1840 | "tinyvec", 1841 | ] 1842 | 1843 | [[package]] 1844 | name = "unicode-width" 1845 | version = "0.1.9" 1846 | source = "registry+https://github.com/rust-lang/crates.io-index" 1847 | checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" 1848 | 1849 | [[package]] 1850 | name = "unicode-xid" 1851 | version = "0.2.2" 1852 | source = "registry+https://github.com/rust-lang/crates.io-index" 1853 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 1854 | 1855 | [[package]] 1856 | name = "unreachable" 1857 | version = "0.1.1" 1858 | source = "registry+https://github.com/rust-lang/crates.io-index" 1859 | checksum = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" 1860 | dependencies = [ 1861 | "void", 1862 | ] 1863 | 1864 | [[package]] 1865 | name = "url" 1866 | version = "2.2.2" 1867 | source = "registry+https://github.com/rust-lang/crates.io-index" 1868 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" 1869 | dependencies = [ 1870 | "form_urlencoded", 1871 | "idna", 1872 | "matches", 1873 | "percent-encoding", 1874 | ] 1875 | 1876 | [[package]] 1877 | name = "version_check" 1878 | version = "0.9.4" 1879 | source = "registry+https://github.com/rust-lang/crates.io-index" 1880 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1881 | 1882 | [[package]] 1883 | name = "void" 1884 | version = "1.0.2" 1885 | source = "registry+https://github.com/rust-lang/crates.io-index" 1886 | checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 1887 | 1888 | [[package]] 1889 | name = "walkdir" 1890 | version = "2.3.2" 1891 | source = "registry+https://github.com/rust-lang/crates.io-index" 1892 | checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" 1893 | dependencies = [ 1894 | "same-file", 1895 | "winapi", 1896 | "winapi-util", 1897 | ] 1898 | 1899 | [[package]] 1900 | name = "wasi" 1901 | version = "0.9.0+wasi-snapshot-preview1" 1902 | source = "registry+https://github.com/rust-lang/crates.io-index" 1903 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1904 | 1905 | [[package]] 1906 | name = "wasi" 1907 | version = "0.10.2+wasi-snapshot-preview1" 1908 | source = "registry+https://github.com/rust-lang/crates.io-index" 1909 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 1910 | 1911 | [[package]] 1912 | name = "wasm-bindgen" 1913 | version = "0.2.72" 1914 | source = "registry+https://github.com/rust-lang/crates.io-index" 1915 | checksum = "8fe8f61dba8e5d645a4d8132dc7a0a66861ed5e1045d2c0ed940fab33bac0fbe" 1916 | dependencies = [ 1917 | "cfg-if 1.0.0", 1918 | "serde", 1919 | "serde_json", 1920 | "wasm-bindgen-macro", 1921 | ] 1922 | 1923 | [[package]] 1924 | name = "wasm-bindgen-backend" 1925 | version = "0.2.72" 1926 | source = "registry+https://github.com/rust-lang/crates.io-index" 1927 | checksum = "046ceba58ff062da072c7cb4ba5b22a37f00a302483f7e2a6cdc18fedbdc1fd3" 1928 | dependencies = [ 1929 | "bumpalo", 1930 | "lazy_static", 1931 | "log", 1932 | "proc-macro2", 1933 | "quote", 1934 | "syn", 1935 | "wasm-bindgen-shared", 1936 | ] 1937 | 1938 | [[package]] 1939 | name = "wasm-bindgen-macro" 1940 | version = "0.2.72" 1941 | source = "registry+https://github.com/rust-lang/crates.io-index" 1942 | checksum = "0ef9aa01d36cda046f797c57959ff5f3c615c9cc63997a8d545831ec7976819b" 1943 | dependencies = [ 1944 | "quote", 1945 | "wasm-bindgen-macro-support", 1946 | ] 1947 | 1948 | [[package]] 1949 | name = "wasm-bindgen-macro-support" 1950 | version = "0.2.72" 1951 | source = "registry+https://github.com/rust-lang/crates.io-index" 1952 | checksum = "96eb45c1b2ee33545a813a92dbb53856418bf7eb54ab34f7f7ff1448a5b3735d" 1953 | dependencies = [ 1954 | "proc-macro2", 1955 | "quote", 1956 | "syn", 1957 | "wasm-bindgen-backend", 1958 | "wasm-bindgen-shared", 1959 | ] 1960 | 1961 | [[package]] 1962 | name = "wasm-bindgen-shared" 1963 | version = "0.2.72" 1964 | source = "registry+https://github.com/rust-lang/crates.io-index" 1965 | checksum = "b7148f4696fb4960a346eaa60bbfb42a1ac4ebba21f750f75fc1375b098d5ffa" 1966 | 1967 | [[package]] 1968 | name = "winapi" 1969 | version = "0.3.9" 1970 | source = "registry+https://github.com/rust-lang/crates.io-index" 1971 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1972 | dependencies = [ 1973 | "winapi-i686-pc-windows-gnu", 1974 | "winapi-x86_64-pc-windows-gnu", 1975 | ] 1976 | 1977 | [[package]] 1978 | name = "winapi-i686-pc-windows-gnu" 1979 | version = "0.4.0" 1980 | source = "registry+https://github.com/rust-lang/crates.io-index" 1981 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1982 | 1983 | [[package]] 1984 | name = "winapi-util" 1985 | version = "0.1.5" 1986 | source = "registry+https://github.com/rust-lang/crates.io-index" 1987 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1988 | dependencies = [ 1989 | "winapi", 1990 | ] 1991 | 1992 | [[package]] 1993 | name = "winapi-x86_64-pc-windows-gnu" 1994 | version = "0.4.0" 1995 | source = "registry+https://github.com/rust-lang/crates.io-index" 1996 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1997 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "swc-wasi" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | swc = "0.120.0" 10 | swc_ecma_minifier = "0.71.4" 11 | swc_ecmascript = "0.111.10" 12 | 13 | [profile.release] 14 | lto = true 15 | opt-level = "s" 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # wasi-example-swc 2 | 3 | A sample wasi worker using the [SWC](https://swc.rs) JavaScript compiler. 4 | 5 | ## Installing Prerequisites 6 | 7 | While compiling Rust to wasi is usually fairly easy, in this case we have to put in some extra work to get the binary as small as we can. 8 | 9 | ### Installing Rust 10 | 11 | This being a Rust example, you'll obviously need the rust toolchain and the wasi target installed. 12 | 13 | ```bash 14 | # Installs the rust toolchain manager from the official site 15 | $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 16 | # Installs everything we'll need to compile to the wasi target. 17 | $ rustup target add wasm32-wasi 18 | ``` 19 | 20 | ### Installing Binaryen 21 | 22 | [Binaryen](https://github.com/WebAssembly/binaryen) is a full blown WebAssemly compiler and toolchain library that ships with some useful tools. In this case we only care about the `wasm-opt` tool, which we'll use to run the generated wasm module though the Binaryen compiler to aggressively optimize for size. This is super easy for UNIX-like operating system users, but windows will have to look at the [Binaryen](https://github.com/WebAssembly/binaryen) repo. 23 | 24 | ```bash 25 | # Debian/Ubuntu/Kali 26 | apt-get install binaryen 27 | # Arch Linux 28 | pacman -S binaryen 29 | # OS X 30 | brew install binaryen 31 | ``` 32 | 33 | ## Building 34 | 35 | Although installing all the prerequisites can be cumbersome, getting the final binary is actually really easy! 36 | 37 | ```bash 38 | # Build the initial wasm module from our Rust source 39 | $ cargo build --release --target wasm32-wasi 40 | # Strip out everything that isn't necessary and then optimize for size 41 | $ wasm-opt --strip-debug --strip-producers --strip-target-features -Oz ./target/wasm32-wasi/release/swc-wasi.wasm --output ./target/wasm32-wasi/release/swc-wasi.wasm 42 | ``` 43 | 44 | And that's it! You're ready to play with your worker! 45 | 46 | ## Running it 47 | 48 | Thankfully [wrangler2](https://github.com/cloudflare/wrangler2/) makes interacting with our wasm super easy, all we need to do to run swc is: 49 | 50 | `npx wrangler@wasm dev ./target/wasm32-wasi/release/swc-wasi.wasm` 51 | 52 | ### Note 53 | 54 | Currently WASI support inside of [wrangler2](https://github.com/cloudflare/wrangler2/) has not landed in the main branch, but is published to NPM under an experimental `wasm` tag. 55 | 56 | -------------------------------------------------------------------------------- /examples/async-generator.js: -------------------------------------------------------------------------------- 1 | async function* greeter(max) { 2 | for (let i = 0; i < max; i++) { 3 | yield `Hello, world! ${i}`; 4 | await new Promise((resolve) => setTimeout(resolve, 100)); 5 | } 6 | } 7 | 8 | async function main() { 9 | for await (const msg of greeter(10)) { 10 | console.log(msg); 11 | } 12 | } 13 | 14 | main(); 15 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::{io::Read, sync::Arc}; 2 | 3 | use swc::{ 4 | common::{FileName, SourceMap}, 5 | config::{util::BoolOrObject, JsMinifyFormatOptions, JsMinifyOptions, Options}, 6 | Compiler, 7 | }; 8 | use swc_ecma_minifier::option::terser::TerserEcmaVersion; 9 | 10 | /// SWC loves to generate code that relies on regenerator-runtime, but we don't want the user to 11 | /// have to worry about that. So we'll just bundle it and slap it at the top of the output. 12 | const REGENERATOR_RUNTIME_SOURCE: &str = include_str!("./runtime.js"); 13 | 14 | fn main() { 15 | let source_map = Arc::new(SourceMap::default()); 16 | let compiler = Compiler::new(source_map.clone()); 17 | 18 | let mut input = String::new(); 19 | std::io::stdin() 20 | .read_to_string(&mut input) 21 | .expect("couldn't read javascript from stdin"); 22 | 23 | let input = source_map.new_source_file(FileName::Anon, input); 24 | let minified = swc::try_with_handler(source_map.clone(), true, |handler| { 25 | let transpiled = compiler 26 | .process_js_file(input, handler, &Options::default()) 27 | .map(|transformed| transformed.code) 28 | .expect("could not transpile JavaScript"); 29 | let transpiled = source_map.new_source_file( 30 | FileName::Anon, 31 | transpiled.replace( 32 | "import regeneratorRuntime from \"regenerator-runtime\";", 33 | REGENERATOR_RUNTIME_SOURCE, 34 | ), 35 | ); 36 | 37 | // Because we hackily insert code of regeneration-runtime, we can't do the minification in 38 | // the compiler pass above. So we have to do it here. 39 | compiler 40 | .minify( 41 | transpiled, 42 | handler, 43 | &JsMinifyOptions { 44 | compress: BoolOrObject::Bool(true), 45 | mangle: BoolOrObject::Bool(true), 46 | format: JsMinifyFormatOptions::default(), 47 | ecma: TerserEcmaVersion::default(), 48 | keep_classnames: false, 49 | keep_fnames: false, 50 | module: false, 51 | safari10: false, 52 | toplevel: false, 53 | source_map: BoolOrObject::Bool(false), 54 | output_path: None, 55 | inline_sources_content: false, 56 | }, 57 | ) 58 | .map(|transformed| transformed.code) 59 | }) 60 | .expect("could not minify JavaScript"); 61 | 62 | print!("{minified}"); 63 | } 64 | -------------------------------------------------------------------------------- /src/runtime.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | var runtime = (function (exports) { 9 | "use strict"; 10 | 11 | var Op = Object.prototype; 12 | var hasOwn = Op.hasOwnProperty; 13 | var undefined; // More compressible than void 0. 14 | var $Symbol = typeof Symbol === "function" ? Symbol : {}; 15 | var iteratorSymbol = $Symbol.iterator || "@@iterator"; 16 | var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; 17 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; 18 | 19 | function define(obj, key, value) { 20 | Object.defineProperty(obj, key, { 21 | value: value, 22 | enumerable: true, 23 | configurable: true, 24 | writable: true 25 | }); 26 | return obj[key]; 27 | } 28 | try { 29 | // IE 8 has a broken Object.defineProperty that only works on DOM objects. 30 | define({}, ""); 31 | } catch (err) { 32 | define = function(obj, key, value) { 33 | return obj[key] = value; 34 | }; 35 | } 36 | 37 | function wrap(innerFn, outerFn, self, tryLocsList) { 38 | // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. 39 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; 40 | var generator = Object.create(protoGenerator.prototype); 41 | var context = new Context(tryLocsList || []); 42 | 43 | // The ._invoke method unifies the implementations of the .next, 44 | // .throw, and .return methods. 45 | generator._invoke = makeInvokeMethod(innerFn, self, context); 46 | 47 | return generator; 48 | } 49 | exports.wrap = wrap; 50 | 51 | // Try/catch helper to minimize deoptimizations. Returns a completion 52 | // record like context.tryEntries[i].completion. This interface could 53 | // have been (and was previously) designed to take a closure to be 54 | // invoked without arguments, but in all the cases we care about we 55 | // already have an existing method we want to call, so there's no need 56 | // to create a new function object. We can even get away with assuming 57 | // the method takes exactly one argument, since that happens to be true 58 | // in every case, so we don't have to touch the arguments object. The 59 | // only additional allocation required is the completion record, which 60 | // has a stable shape and so hopefully should be cheap to allocate. 61 | function tryCatch(fn, obj, arg) { 62 | try { 63 | return { type: "normal", arg: fn.call(obj, arg) }; 64 | } catch (err) { 65 | return { type: "throw", arg: err }; 66 | } 67 | } 68 | 69 | var GenStateSuspendedStart = "suspendedStart"; 70 | var GenStateSuspendedYield = "suspendedYield"; 71 | var GenStateExecuting = "executing"; 72 | var GenStateCompleted = "completed"; 73 | 74 | // Returning this object from the innerFn has the same effect as 75 | // breaking out of the dispatch switch statement. 76 | var ContinueSentinel = {}; 77 | 78 | // Dummy constructor functions that we use as the .constructor and 79 | // .constructor.prototype properties for functions that return Generator 80 | // objects. For full spec compliance, you may wish to configure your 81 | // minifier not to mangle the names of these two functions. 82 | function Generator() {} 83 | function GeneratorFunction() {} 84 | function GeneratorFunctionPrototype() {} 85 | 86 | // This is a polyfill for %IteratorPrototype% for environments that 87 | // don't natively support it. 88 | var IteratorPrototype = {}; 89 | define(IteratorPrototype, iteratorSymbol, function () { 90 | return this; 91 | }); 92 | 93 | var getProto = Object.getPrototypeOf; 94 | var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); 95 | if (NativeIteratorPrototype && 96 | NativeIteratorPrototype !== Op && 97 | hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { 98 | // This environment has a native %IteratorPrototype%; use it instead 99 | // of the polyfill. 100 | IteratorPrototype = NativeIteratorPrototype; 101 | } 102 | 103 | var Gp = GeneratorFunctionPrototype.prototype = 104 | Generator.prototype = Object.create(IteratorPrototype); 105 | GeneratorFunction.prototype = GeneratorFunctionPrototype; 106 | define(Gp, "constructor", GeneratorFunctionPrototype); 107 | define(GeneratorFunctionPrototype, "constructor", GeneratorFunction); 108 | GeneratorFunction.displayName = define( 109 | GeneratorFunctionPrototype, 110 | toStringTagSymbol, 111 | "GeneratorFunction" 112 | ); 113 | 114 | // Helper for defining the .next, .throw, and .return methods of the 115 | // Iterator interface in terms of a single ._invoke method. 116 | function defineIteratorMethods(prototype) { 117 | ["next", "throw", "return"].forEach(function(method) { 118 | define(prototype, method, function(arg) { 119 | return this._invoke(method, arg); 120 | }); 121 | }); 122 | } 123 | 124 | exports.isGeneratorFunction = function(genFun) { 125 | var ctor = typeof genFun === "function" && genFun.constructor; 126 | return ctor 127 | ? ctor === GeneratorFunction || 128 | // For the native GeneratorFunction constructor, the best we can 129 | // do is to check its .name property. 130 | (ctor.displayName || ctor.name) === "GeneratorFunction" 131 | : false; 132 | }; 133 | 134 | exports.mark = function(genFun) { 135 | if (Object.setPrototypeOf) { 136 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); 137 | } else { 138 | genFun.__proto__ = GeneratorFunctionPrototype; 139 | define(genFun, toStringTagSymbol, "GeneratorFunction"); 140 | } 141 | genFun.prototype = Object.create(Gp); 142 | return genFun; 143 | }; 144 | 145 | // Within the body of any async function, `await x` is transformed to 146 | // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test 147 | // `hasOwn.call(value, "__await")` to determine if the yielded value is 148 | // meant to be awaited. 149 | exports.awrap = function(arg) { 150 | return { __await: arg }; 151 | }; 152 | 153 | function AsyncIterator(generator, PromiseImpl) { 154 | function invoke(method, arg, resolve, reject) { 155 | var record = tryCatch(generator[method], generator, arg); 156 | if (record.type === "throw") { 157 | reject(record.arg); 158 | } else { 159 | var result = record.arg; 160 | var value = result.value; 161 | if (value && 162 | typeof value === "object" && 163 | hasOwn.call(value, "__await")) { 164 | return PromiseImpl.resolve(value.__await).then(function(value) { 165 | invoke("next", value, resolve, reject); 166 | }, function(err) { 167 | invoke("throw", err, resolve, reject); 168 | }); 169 | } 170 | 171 | return PromiseImpl.resolve(value).then(function(unwrapped) { 172 | // When a yielded Promise is resolved, its final value becomes 173 | // the .value of the Promise<{value,done}> result for the 174 | // current iteration. 175 | result.value = unwrapped; 176 | resolve(result); 177 | }, function(error) { 178 | // If a rejected Promise was yielded, throw the rejection back 179 | // into the async generator function so it can be handled there. 180 | return invoke("throw", error, resolve, reject); 181 | }); 182 | } 183 | } 184 | 185 | var previousPromise; 186 | 187 | function enqueue(method, arg) { 188 | function callInvokeWithMethodAndArg() { 189 | return new PromiseImpl(function(resolve, reject) { 190 | invoke(method, arg, resolve, reject); 191 | }); 192 | } 193 | 194 | return previousPromise = 195 | // If enqueue has been called before, then we want to wait until 196 | // all previous Promises have been resolved before calling invoke, 197 | // so that results are always delivered in the correct order. If 198 | // enqueue has not been called before, then it is important to 199 | // call invoke immediately, without waiting on a callback to fire, 200 | // so that the async generator function has the opportunity to do 201 | // any necessary setup in a predictable way. This predictability 202 | // is why the Promise constructor synchronously invokes its 203 | // executor callback, and why async functions synchronously 204 | // execute code before the first await. Since we implement simple 205 | // async functions in terms of async generators, it is especially 206 | // important to get this right, even though it requires care. 207 | previousPromise ? previousPromise.then( 208 | callInvokeWithMethodAndArg, 209 | // Avoid propagating failures to Promises returned by later 210 | // invocations of the iterator. 211 | callInvokeWithMethodAndArg 212 | ) : callInvokeWithMethodAndArg(); 213 | } 214 | 215 | // Define the unified helper method that is used to implement .next, 216 | // .throw, and .return (see defineIteratorMethods). 217 | this._invoke = enqueue; 218 | } 219 | 220 | defineIteratorMethods(AsyncIterator.prototype); 221 | define(AsyncIterator.prototype, asyncIteratorSymbol, function () { 222 | return this; 223 | }); 224 | exports.AsyncIterator = AsyncIterator; 225 | 226 | // Note that simple async functions are implemented on top of 227 | // AsyncIterator objects; they just return a Promise for the value of 228 | // the final result produced by the iterator. 229 | exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { 230 | if (PromiseImpl === void 0) PromiseImpl = Promise; 231 | 232 | var iter = new AsyncIterator( 233 | wrap(innerFn, outerFn, self, tryLocsList), 234 | PromiseImpl 235 | ); 236 | 237 | return exports.isGeneratorFunction(outerFn) 238 | ? iter // If outerFn is a generator, return the full iterator. 239 | : iter.next().then(function(result) { 240 | return result.done ? result.value : iter.next(); 241 | }); 242 | }; 243 | 244 | function makeInvokeMethod(innerFn, self, context) { 245 | var state = GenStateSuspendedStart; 246 | 247 | return function invoke(method, arg) { 248 | if (state === GenStateExecuting) { 249 | throw new Error("Generator is already running"); 250 | } 251 | 252 | if (state === GenStateCompleted) { 253 | if (method === "throw") { 254 | throw arg; 255 | } 256 | 257 | // Be forgiving, per 25.3.3.3.3 of the spec: 258 | // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume 259 | return doneResult(); 260 | } 261 | 262 | context.method = method; 263 | context.arg = arg; 264 | 265 | while (true) { 266 | var delegate = context.delegate; 267 | if (delegate) { 268 | var delegateResult = maybeInvokeDelegate(delegate, context); 269 | if (delegateResult) { 270 | if (delegateResult === ContinueSentinel) continue; 271 | return delegateResult; 272 | } 273 | } 274 | 275 | if (context.method === "next") { 276 | // Setting context._sent for legacy support of Babel's 277 | // function.sent implementation. 278 | context.sent = context._sent = context.arg; 279 | 280 | } else if (context.method === "throw") { 281 | if (state === GenStateSuspendedStart) { 282 | state = GenStateCompleted; 283 | throw context.arg; 284 | } 285 | 286 | context.dispatchException(context.arg); 287 | 288 | } else if (context.method === "return") { 289 | context.abrupt("return", context.arg); 290 | } 291 | 292 | state = GenStateExecuting; 293 | 294 | var record = tryCatch(innerFn, self, context); 295 | if (record.type === "normal") { 296 | // If an exception is thrown from innerFn, we leave state === 297 | // GenStateExecuting and loop back for another invocation. 298 | state = context.done 299 | ? GenStateCompleted 300 | : GenStateSuspendedYield; 301 | 302 | if (record.arg === ContinueSentinel) { 303 | continue; 304 | } 305 | 306 | return { 307 | value: record.arg, 308 | done: context.done 309 | }; 310 | 311 | } else if (record.type === "throw") { 312 | state = GenStateCompleted; 313 | // Dispatch the exception by looping back around to the 314 | // context.dispatchException(context.arg) call above. 315 | context.method = "throw"; 316 | context.arg = record.arg; 317 | } 318 | } 319 | }; 320 | } 321 | 322 | // Call delegate.iterator[context.method](context.arg) and handle the 323 | // result, either by returning a { value, done } result from the 324 | // delegate iterator, or by modifying context.method and context.arg, 325 | // setting context.delegate to null, and returning the ContinueSentinel. 326 | function maybeInvokeDelegate(delegate, context) { 327 | var method = delegate.iterator[context.method]; 328 | if (method === undefined) { 329 | // A .throw or .return when the delegate iterator has no .throw 330 | // method always terminates the yield* loop. 331 | context.delegate = null; 332 | 333 | if (context.method === "throw") { 334 | // Note: ["return"] must be used for ES3 parsing compatibility. 335 | if (delegate.iterator["return"]) { 336 | // If the delegate iterator has a return method, give it a 337 | // chance to clean up. 338 | context.method = "return"; 339 | context.arg = undefined; 340 | maybeInvokeDelegate(delegate, context); 341 | 342 | if (context.method === "throw") { 343 | // If maybeInvokeDelegate(context) changed context.method from 344 | // "return" to "throw", let that override the TypeError below. 345 | return ContinueSentinel; 346 | } 347 | } 348 | 349 | context.method = "throw"; 350 | context.arg = new TypeError( 351 | "The iterator does not provide a 'throw' method"); 352 | } 353 | 354 | return ContinueSentinel; 355 | } 356 | 357 | var record = tryCatch(method, delegate.iterator, context.arg); 358 | 359 | if (record.type === "throw") { 360 | context.method = "throw"; 361 | context.arg = record.arg; 362 | context.delegate = null; 363 | return ContinueSentinel; 364 | } 365 | 366 | var info = record.arg; 367 | 368 | if (! info) { 369 | context.method = "throw"; 370 | context.arg = new TypeError("iterator result is not an object"); 371 | context.delegate = null; 372 | return ContinueSentinel; 373 | } 374 | 375 | if (info.done) { 376 | // Assign the result of the finished delegate to the temporary 377 | // variable specified by delegate.resultName (see delegateYield). 378 | context[delegate.resultName] = info.value; 379 | 380 | // Resume execution at the desired location (see delegateYield). 381 | context.next = delegate.nextLoc; 382 | 383 | // If context.method was "throw" but the delegate handled the 384 | // exception, let the outer generator proceed normally. If 385 | // context.method was "next", forget context.arg since it has been 386 | // "consumed" by the delegate iterator. If context.method was 387 | // "return", allow the original .return call to continue in the 388 | // outer generator. 389 | if (context.method !== "return") { 390 | context.method = "next"; 391 | context.arg = undefined; 392 | } 393 | 394 | } else { 395 | // Re-yield the result returned by the delegate method. 396 | return info; 397 | } 398 | 399 | // The delegate iterator is finished, so forget it and continue with 400 | // the outer generator. 401 | context.delegate = null; 402 | return ContinueSentinel; 403 | } 404 | 405 | // Define Generator.prototype.{next,throw,return} in terms of the 406 | // unified ._invoke helper method. 407 | defineIteratorMethods(Gp); 408 | 409 | define(Gp, toStringTagSymbol, "Generator"); 410 | 411 | // A Generator should always return itself as the iterator object when the 412 | // @@iterator function is called on it. Some browsers' implementations of the 413 | // iterator prototype chain incorrectly implement this, causing the Generator 414 | // object to not be returned from this call. This ensures that doesn't happen. 415 | // See https://github.com/facebook/regenerator/issues/274 for more details. 416 | define(Gp, iteratorSymbol, function() { 417 | return this; 418 | }); 419 | 420 | define(Gp, "toString", function() { 421 | return "[object Generator]"; 422 | }); 423 | 424 | function pushTryEntry(locs) { 425 | var entry = { tryLoc: locs[0] }; 426 | 427 | if (1 in locs) { 428 | entry.catchLoc = locs[1]; 429 | } 430 | 431 | if (2 in locs) { 432 | entry.finallyLoc = locs[2]; 433 | entry.afterLoc = locs[3]; 434 | } 435 | 436 | this.tryEntries.push(entry); 437 | } 438 | 439 | function resetTryEntry(entry) { 440 | var record = entry.completion || {}; 441 | record.type = "normal"; 442 | delete record.arg; 443 | entry.completion = record; 444 | } 445 | 446 | function Context(tryLocsList) { 447 | // The root entry object (effectively a try statement without a catch 448 | // or a finally block) gives us a place to store values thrown from 449 | // locations where there is no enclosing try statement. 450 | this.tryEntries = [{ tryLoc: "root" }]; 451 | tryLocsList.forEach(pushTryEntry, this); 452 | this.reset(true); 453 | } 454 | 455 | exports.keys = function(object) { 456 | var keys = []; 457 | for (var key in object) { 458 | keys.push(key); 459 | } 460 | keys.reverse(); 461 | 462 | // Rather than returning an object with a next method, we keep 463 | // things simple and return the next function itself. 464 | return function next() { 465 | while (keys.length) { 466 | var key = keys.pop(); 467 | if (key in object) { 468 | next.value = key; 469 | next.done = false; 470 | return next; 471 | } 472 | } 473 | 474 | // To avoid creating an additional object, we just hang the .value 475 | // and .done properties off the next function object itself. This 476 | // also ensures that the minifier will not anonymize the function. 477 | next.done = true; 478 | return next; 479 | }; 480 | }; 481 | 482 | function values(iterable) { 483 | if (iterable) { 484 | var iteratorMethod = iterable[iteratorSymbol]; 485 | if (iteratorMethod) { 486 | return iteratorMethod.call(iterable); 487 | } 488 | 489 | if (typeof iterable.next === "function") { 490 | return iterable; 491 | } 492 | 493 | if (!isNaN(iterable.length)) { 494 | var i = -1, next = function next() { 495 | while (++i < iterable.length) { 496 | if (hasOwn.call(iterable, i)) { 497 | next.value = iterable[i]; 498 | next.done = false; 499 | return next; 500 | } 501 | } 502 | 503 | next.value = undefined; 504 | next.done = true; 505 | 506 | return next; 507 | }; 508 | 509 | return next.next = next; 510 | } 511 | } 512 | 513 | // Return an iterator with no values. 514 | return { next: doneResult }; 515 | } 516 | exports.values = values; 517 | 518 | function doneResult() { 519 | return { value: undefined, done: true }; 520 | } 521 | 522 | Context.prototype = { 523 | constructor: Context, 524 | 525 | reset: function(skipTempReset) { 526 | this.prev = 0; 527 | this.next = 0; 528 | // Resetting context._sent for legacy support of Babel's 529 | // function.sent implementation. 530 | this.sent = this._sent = undefined; 531 | this.done = false; 532 | this.delegate = null; 533 | 534 | this.method = "next"; 535 | this.arg = undefined; 536 | 537 | this.tryEntries.forEach(resetTryEntry); 538 | 539 | if (!skipTempReset) { 540 | for (var name in this) { 541 | // Not sure about the optimal order of these conditions: 542 | if (name.charAt(0) === "t" && 543 | hasOwn.call(this, name) && 544 | !isNaN(+name.slice(1))) { 545 | this[name] = undefined; 546 | } 547 | } 548 | } 549 | }, 550 | 551 | stop: function() { 552 | this.done = true; 553 | 554 | var rootEntry = this.tryEntries[0]; 555 | var rootRecord = rootEntry.completion; 556 | if (rootRecord.type === "throw") { 557 | throw rootRecord.arg; 558 | } 559 | 560 | return this.rval; 561 | }, 562 | 563 | dispatchException: function(exception) { 564 | if (this.done) { 565 | throw exception; 566 | } 567 | 568 | var context = this; 569 | function handle(loc, caught) { 570 | record.type = "throw"; 571 | record.arg = exception; 572 | context.next = loc; 573 | 574 | if (caught) { 575 | // If the dispatched exception was caught by a catch block, 576 | // then let that catch block handle the exception normally. 577 | context.method = "next"; 578 | context.arg = undefined; 579 | } 580 | 581 | return !! caught; 582 | } 583 | 584 | for (var i = this.tryEntries.length - 1; i >= 0; --i) { 585 | var entry = this.tryEntries[i]; 586 | var record = entry.completion; 587 | 588 | if (entry.tryLoc === "root") { 589 | // Exception thrown outside of any try block that could handle 590 | // it, so set the completion value of the entire function to 591 | // throw the exception. 592 | return handle("end"); 593 | } 594 | 595 | if (entry.tryLoc <= this.prev) { 596 | var hasCatch = hasOwn.call(entry, "catchLoc"); 597 | var hasFinally = hasOwn.call(entry, "finallyLoc"); 598 | 599 | if (hasCatch && hasFinally) { 600 | if (this.prev < entry.catchLoc) { 601 | return handle(entry.catchLoc, true); 602 | } else if (this.prev < entry.finallyLoc) { 603 | return handle(entry.finallyLoc); 604 | } 605 | 606 | } else if (hasCatch) { 607 | if (this.prev < entry.catchLoc) { 608 | return handle(entry.catchLoc, true); 609 | } 610 | 611 | } else if (hasFinally) { 612 | if (this.prev < entry.finallyLoc) { 613 | return handle(entry.finallyLoc); 614 | } 615 | 616 | } else { 617 | throw new Error("try statement without catch or finally"); 618 | } 619 | } 620 | } 621 | }, 622 | 623 | abrupt: function(type, arg) { 624 | for (var i = this.tryEntries.length - 1; i >= 0; --i) { 625 | var entry = this.tryEntries[i]; 626 | if (entry.tryLoc <= this.prev && 627 | hasOwn.call(entry, "finallyLoc") && 628 | this.prev < entry.finallyLoc) { 629 | var finallyEntry = entry; 630 | break; 631 | } 632 | } 633 | 634 | if (finallyEntry && 635 | (type === "break" || 636 | type === "continue") && 637 | finallyEntry.tryLoc <= arg && 638 | arg <= finallyEntry.finallyLoc) { 639 | // Ignore the finally entry if control is not jumping to a 640 | // location outside the try/catch block. 641 | finallyEntry = null; 642 | } 643 | 644 | var record = finallyEntry ? finallyEntry.completion : {}; 645 | record.type = type; 646 | record.arg = arg; 647 | 648 | if (finallyEntry) { 649 | this.method = "next"; 650 | this.next = finallyEntry.finallyLoc; 651 | return ContinueSentinel; 652 | } 653 | 654 | return this.complete(record); 655 | }, 656 | 657 | complete: function(record, afterLoc) { 658 | if (record.type === "throw") { 659 | throw record.arg; 660 | } 661 | 662 | if (record.type === "break" || 663 | record.type === "continue") { 664 | this.next = record.arg; 665 | } else if (record.type === "return") { 666 | this.rval = this.arg = record.arg; 667 | this.method = "return"; 668 | this.next = "end"; 669 | } else if (record.type === "normal" && afterLoc) { 670 | this.next = afterLoc; 671 | } 672 | 673 | return ContinueSentinel; 674 | }, 675 | 676 | finish: function(finallyLoc) { 677 | for (var i = this.tryEntries.length - 1; i >= 0; --i) { 678 | var entry = this.tryEntries[i]; 679 | if (entry.finallyLoc === finallyLoc) { 680 | this.complete(entry.completion, entry.afterLoc); 681 | resetTryEntry(entry); 682 | return ContinueSentinel; 683 | } 684 | } 685 | }, 686 | 687 | "catch": function(tryLoc) { 688 | for (var i = this.tryEntries.length - 1; i >= 0; --i) { 689 | var entry = this.tryEntries[i]; 690 | if (entry.tryLoc === tryLoc) { 691 | var record = entry.completion; 692 | if (record.type === "throw") { 693 | var thrown = record.arg; 694 | resetTryEntry(entry); 695 | } 696 | return thrown; 697 | } 698 | } 699 | 700 | // The context.catch method must only be called with a location 701 | // argument that corresponds to a known catch block. 702 | throw new Error("illegal catch attempt"); 703 | }, 704 | 705 | delegateYield: function(iterable, resultName, nextLoc) { 706 | this.delegate = { 707 | iterator: values(iterable), 708 | resultName: resultName, 709 | nextLoc: nextLoc 710 | }; 711 | 712 | if (this.method === "next") { 713 | // Deliberately forget the last sent value so that we don't 714 | // accidentally pass it on to the delegate. 715 | this.arg = undefined; 716 | } 717 | 718 | return ContinueSentinel; 719 | } 720 | }; 721 | 722 | // Regardless of whether this script is executing as a CommonJS module 723 | // or not, return the runtime object so that we can declare the variable 724 | // regeneratorRuntime in the outer scope, which allows this module to be 725 | // injected easily by `bin/regenerator --include-runtime script.js`. 726 | return exports; 727 | 728 | }( 729 | // If this script is executing as a CommonJS module, use module.exports 730 | // as the regeneratorRuntime namespace. Otherwise create a new empty 731 | // object. Either way, the resulting object will be used to initialize 732 | // the regeneratorRuntime variable at the top of this file. 733 | typeof module === "object" ? module.exports : {} 734 | )); 735 | 736 | try { 737 | regeneratorRuntime = runtime; 738 | } catch (accidentalStrictMode) { 739 | // This module should not be running in strict mode, so the above 740 | // assignment should always work unless something is misconfigured. Just 741 | // in case runtime.js accidentally runs in strict mode, in modern engines 742 | // we can explicitly access globalThis. In older engines we can escape 743 | // strict mode using a global Function call. This could conceivably fail 744 | // if a Content Security Policy forbids using Function, but in that case 745 | // the proper solution is to fix the accidental strict mode problem. If 746 | // you've misconfigured your bundler to force strict mode and applied a 747 | // CSP to forbid Function, and you're not willing to fix either of those 748 | // problems, please detail your unique predicament in a GitHub issue. 749 | if (typeof globalThis === "object") { 750 | globalThis.regeneratorRuntime = runtime; 751 | } else { 752 | Function("r", "regeneratorRuntime = r")(runtime); 753 | } 754 | } 755 | --------------------------------------------------------------------------------