{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.Sf1JQrnC/b1/node-buble_0.20.0+~0.20.1-5_amd64.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.Sf1JQrnC/b2/node-buble_0.20.0+~0.20.1-5_amd64.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,2 +1,2 @@\n \n- f9ca826d02ac9e54b93e1c94fcc28009 299600 javascript optional node-buble_0.20.0+~0.20.1-5_all.deb\n+ d9d553d80501c446db2d759939d1d3e9 319600 javascript optional node-buble_0.20.0+~0.20.1-5_all.deb\n"}, {"source1": "node-buble_0.20.0+~0.20.1-5_all.deb", "source2": "node-buble_0.20.0+~0.20.1-5_all.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2023-08-13 05:05:19.000000 debian-binary\n -rw-r--r-- 0 0 0 1704 2023-08-13 05:05:19.000000 control.tar.xz\n--rw-r--r-- 0 0 0 297704 2023-08-13 05:05:19.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 317704 2023-08-13 05:05:19.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./control", "source2": "./control", "unified_diff": "@@ -1,12 +1,12 @@\n Package: node-buble\n Version: 0.20.0+~0.20.1-5\n Architecture: all\n Maintainer: Debian Javascript Maintainers \n-Installed-Size: 5631\n+Installed-Size: 5636\n Depends: node-acorn, node-chalk, node-magic-string, node-minimist, node-regexpu-core, nodejs:any\n Provides: node-types-buble (= 0.20.1)\n Section: javascript\n Priority: optional\n Homepage: https://github.com/bublejs/buble\n Description: Fast ES2015 compiler for Node.js\n Bubl\u00e9 is a ES2015 compiler : it will turn ES6 javascript code into\n"}, {"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -25,15 +25,15 @@\n -rw-r--r-- 0 root (0) root (0) 3348 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/bin/runBuble.js\n -rw-r--r-- 0 root (0) root (0) 326 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/bin/showHelp.js\n drwxr-xr-x 0 root (0) root (0) 0 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/\n -rw-r--r-- 0 root (0) root (0) 769309 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble-browser.cjs.js\n -rw-r--r-- 0 root (0) root (0) 1662495 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble-browser.cjs.js.map\n -rw-r--r-- 0 root (0) root (0) 120668 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble-browser.es.js\n -rw-r--r-- 0 root (0) root (0) 302060 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble-browser.es.js.map\n--rw-r--r-- 0 root (0) root (0) 769301 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble.cjs.js\n--rw-r--r-- 0 root (0) root (0) 1662487 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble.cjs.js.map\n+-rw-r--r-- 0 root (0) root (0) 774344 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble.cjs.js\n+-rw-r--r-- 0 root (0) root (0) 1662500 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble.cjs.js.map\n -rw-r--r-- 0 root (0) root (0) 120660 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble.es.js\n -rw-r--r-- 0 root (0) root (0) 302052 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/dist/buble.es.js.map\n -rw-r--r-- 0 root (0) root (0) 2659 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/package.json\n -rw-r--r-- 0 root (0) root (0) 2467 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/pkgjs-lock.json\n -rw-r--r-- 0 root (0) root (0) 2253 2023-08-13 05:05:19.000000 ./usr/share/nodejs/buble/register.js\n lrwxrwxrwx 0 root (0) root (0) 0 2023-08-13 05:05:19.000000 ./usr/bin/buble -> ../share/nodejs/buble/bin/buble\n"}, {"source1": "./usr/share/nodejs/buble/dist/buble.cjs.js", "source2": "./usr/share/nodejs/buble/dist/buble.cjs.js", "unified_diff": null, "details": [{"source1": "js-beautify {}", "source2": "js-beautify {}", "unified_diff": "@@ -6651,6456 +6651,6461 @@\n diams: '\\u2666'\n };\n \n var acorn = {\n exports: {}\n };\n \n-(function(module, exports) {\n- (function(global, factory) {\n- factory(exports);\n- })(commonjsGlobal, (function(exports) {\n- // This file was generated. Do not modify manually!\n- var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n-\n- // This file was generated. Do not modify manually!\n- var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\n-\n- // This file was generated. Do not modify manually!\n- var nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n-\n- // This file was generated. Do not modify manually!\n- var nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n-\n- // These are a run-length and offset encoded representation of the\n-\n- // Reserved word lists for various dialects of the language\n-\n- var reservedWords = {\n- 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n- 5: \"class enum extends super const export import\",\n- 6: \"enum\",\n- strict: \"implements interface let package private protected public static yield\",\n- strictBind: \"eval arguments\"\n- };\n+var hasRequiredAcorn;\n \n- // And the keywords\n+function requireAcorn() {\n+ if (hasRequiredAcorn) return acorn.exports;\n+ hasRequiredAcorn = 1;\n+ (function(module, exports) {\n+ (function(global, factory) {\n+ factory(exports);\n+ })(commonjsGlobal, (function(exports) {\n+ // This file was generated. Do not modify manually!\n+ var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n+\n+ // This file was generated. Do not modify manually!\n+ var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\n+\n+ // This file was generated. Do not modify manually!\n+ var nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n+\n+ // This file was generated. Do not modify manually!\n+ var nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n+\n+ // These are a run-length and offset encoded representation of the\n+\n+ // Reserved word lists for various dialects of the language\n+\n+ var reservedWords = {\n+ 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n+ 5: \"class enum extends super const export import\",\n+ 6: \"enum\",\n+ strict: \"implements interface let package private protected public static yield\",\n+ strictBind: \"eval arguments\"\n+ };\n \n- var ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\";\n+ // And the keywords\n \n- var keywords$1 = {\n- 5: ecma5AndLessKeywords,\n- \"5module\": ecma5AndLessKeywords + \" export import\",\n- 6: ecma5AndLessKeywords + \" const class extends export import super\"\n- };\n+ var ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\";\n \n- var keywordRelationalOperator = /^in(stanceof)?$/;\n+ var keywords$1 = {\n+ 5: ecma5AndLessKeywords,\n+ \"5module\": ecma5AndLessKeywords + \" export import\",\n+ 6: ecma5AndLessKeywords + \" const class extends export import super\"\n+ };\n \n- // ## Character categories\n+ var keywordRelationalOperator = /^in(stanceof)?$/;\n \n- var nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\n- var nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n+ // ## Character categories\n \n- // This has a complexity linear to the value of the code. The\n- // assumption is that looking up astral identifier characters is\n- // rare.\n- function isInAstralSet(code, set) {\n- var pos = 0x10000;\n- for (var i = 0; i < set.length; i += 2) {\n- pos += set[i];\n- if (pos > code) {\n- return false\n+ var nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\n+ var nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n+\n+ // This has a complexity linear to the value of the code. The\n+ // assumption is that looking up astral identifier characters is\n+ // rare.\n+ function isInAstralSet(code, set) {\n+ var pos = 0x10000;\n+ for (var i = 0; i < set.length; i += 2) {\n+ pos += set[i];\n+ if (pos > code) {\n+ return false\n+ }\n+ pos += set[i + 1];\n+ if (pos >= code) {\n+ return true\n+ }\n }\n- pos += set[i + 1];\n- if (pos >= code) {\n+ }\n+\n+ // Test whether a given character code starts an identifier.\n+\n+ function isIdentifierStart(code, astral) {\n+ if (code < 65) {\n+ return code === 36\n+ }\n+ if (code < 91) {\n+ return true\n+ }\n+ if (code < 97) {\n+ return code === 95\n+ }\n+ if (code < 123) {\n return true\n }\n+ if (code <= 0xffff) {\n+ return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n+ }\n+ if (astral === false) {\n+ return false\n+ }\n+ return isInAstralSet(code, astralIdentifierStartCodes)\n }\n- }\n \n- // Test whether a given character code starts an identifier.\n+ // Test whether a given character is part of an identifier.\n \n- function isIdentifierStart(code, astral) {\n- if (code < 65) {\n- return code === 36\n- }\n- if (code < 91) {\n- return true\n- }\n- if (code < 97) {\n- return code === 95\n- }\n- if (code < 123) {\n- return true\n- }\n- if (code <= 0xffff) {\n- return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n- }\n- if (astral === false) {\n- return false\n+ function isIdentifierChar(code, astral) {\n+ if (code < 48) {\n+ return code === 36\n+ }\n+ if (code < 58) {\n+ return true\n+ }\n+ if (code < 65) {\n+ return false\n+ }\n+ if (code < 91) {\n+ return true\n+ }\n+ if (code < 97) {\n+ return code === 95\n+ }\n+ if (code < 123) {\n+ return true\n+ }\n+ if (code <= 0xffff) {\n+ return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n+ }\n+ if (astral === false) {\n+ return false\n+ }\n+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n }\n- return isInAstralSet(code, astralIdentifierStartCodes)\n- }\n \n- // Test whether a given character is part of an identifier.\n+ // ## Token types\n \n- function isIdentifierChar(code, astral) {\n- if (code < 48) {\n- return code === 36\n- }\n- if (code < 58) {\n- return true\n- }\n- if (code < 65) {\n- return false\n- }\n- if (code < 91) {\n- return true\n- }\n- if (code < 97) {\n- return code === 95\n- }\n- if (code < 123) {\n- return true\n- }\n- if (code <= 0xffff) {\n- return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n- }\n- if (astral === false) {\n- return false\n+ // The assignment of fine-grained, information-carrying type objects\n+ // allows the tokenizer to store the information it has about a\n+ // token in a way that is very cheap for the parser to look up.\n+\n+ // All token type variables start with an underscore, to make them\n+ // easy to recognize.\n+\n+ // The `beforeExpr` property is used to disambiguate between regular\n+ // expressions and divisions. It is set on all token types that can\n+ // be followed by an expression (thus, a slash after them would be a\n+ // regular expression).\n+ //\n+ // The `startsExpr` property is used to check if the token ends a\n+ // `yield` expression. It is set on all token types that either can\n+ // directly start an expression (like a quotation mark) or can\n+ // continue an expression (like the body of a string).\n+ //\n+ // `isLoop` marks a keyword as starting a loop, which is important\n+ // to know when parsing a label, in order to allow or disallow\n+ // continue jumps to that label.\n+\n+ var TokenType = function TokenType(label, conf) {\n+ if (conf === void 0) conf = {};\n+\n+ this.label = label;\n+ this.keyword = conf.keyword;\n+ this.beforeExpr = !!conf.beforeExpr;\n+ this.startsExpr = !!conf.startsExpr;\n+ this.isLoop = !!conf.isLoop;\n+ this.isAssign = !!conf.isAssign;\n+ this.prefix = !!conf.prefix;\n+ this.postfix = !!conf.postfix;\n+ this.binop = conf.binop || null;\n+ this.updateContext = null;\n+ };\n+\n+ function binop(name, prec) {\n+ return new TokenType(name, {\n+ beforeExpr: true,\n+ binop: prec\n+ })\n }\n- return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n- }\n+ var beforeExpr = {\n+ beforeExpr: true\n+ },\n+ startsExpr = {\n+ startsExpr: true\n+ };\n \n- // ## Token types\n+ // Map keyword names to token types.\n \n- // The assignment of fine-grained, information-carrying type objects\n- // allows the tokenizer to store the information it has about a\n- // token in a way that is very cheap for the parser to look up.\n-\n- // All token type variables start with an underscore, to make them\n- // easy to recognize.\n-\n- // The `beforeExpr` property is used to disambiguate between regular\n- // expressions and divisions. It is set on all token types that can\n- // be followed by an expression (thus, a slash after them would be a\n- // regular expression).\n- //\n- // The `startsExpr` property is used to check if the token ends a\n- // `yield` expression. It is set on all token types that either can\n- // directly start an expression (like a quotation mark) or can\n- // continue an expression (like the body of a string).\n- //\n- // `isLoop` marks a keyword as starting a loop, which is important\n- // to know when parsing a label, in order to allow or disallow\n- // continue jumps to that label.\n-\n- var TokenType = function TokenType(label, conf) {\n- if (conf === void 0) conf = {};\n-\n- this.label = label;\n- this.keyword = conf.keyword;\n- this.beforeExpr = !!conf.beforeExpr;\n- this.startsExpr = !!conf.startsExpr;\n- this.isLoop = !!conf.isLoop;\n- this.isAssign = !!conf.isAssign;\n- this.prefix = !!conf.prefix;\n- this.postfix = !!conf.postfix;\n- this.binop = conf.binop || null;\n- this.updateContext = null;\n- };\n+ var keywords = {};\n \n- function binop(name, prec) {\n- return new TokenType(name, {\n- beforeExpr: true,\n- binop: prec\n- })\n- }\n- var beforeExpr = {\n- beforeExpr: true\n- },\n- startsExpr = {\n- startsExpr: true\n- };\n+ // Succinct definitions of keyword token types\n+ function kw(name, options) {\n+ if (options === void 0) options = {};\n \n- // Map keyword names to token types.\n+ options.keyword = name;\n+ return keywords[name] = new TokenType(name, options)\n+ }\n \n- var keywords = {};\n+ var types$1 = {\n+ num: new TokenType(\"num\", startsExpr),\n+ regexp: new TokenType(\"regexp\", startsExpr),\n+ string: new TokenType(\"string\", startsExpr),\n+ name: new TokenType(\"name\", startsExpr),\n+ privateId: new TokenType(\"privateId\", startsExpr),\n+ eof: new TokenType(\"eof\"),\n \n- // Succinct definitions of keyword token types\n- function kw(name, options) {\n- if (options === void 0) options = {};\n+ // Punctuation token types.\n+ bracketL: new TokenType(\"[\", {\n+ beforeExpr: true,\n+ startsExpr: true\n+ }),\n+ bracketR: new TokenType(\"]\"),\n+ braceL: new TokenType(\"{\", {\n+ beforeExpr: true,\n+ startsExpr: true\n+ }),\n+ braceR: new TokenType(\"}\"),\n+ parenL: new TokenType(\"(\", {\n+ beforeExpr: true,\n+ startsExpr: true\n+ }),\n+ parenR: new TokenType(\")\"),\n+ comma: new TokenType(\",\", beforeExpr),\n+ semi: new TokenType(\";\", beforeExpr),\n+ colon: new TokenType(\":\", beforeExpr),\n+ dot: new TokenType(\".\"),\n+ question: new TokenType(\"?\", beforeExpr),\n+ questionDot: new TokenType(\"?.\"),\n+ arrow: new TokenType(\"=>\", beforeExpr),\n+ template: new TokenType(\"template\"),\n+ invalidTemplate: new TokenType(\"invalidTemplate\"),\n+ ellipsis: new TokenType(\"...\", beforeExpr),\n+ backQuote: new TokenType(\"`\", startsExpr),\n+ dollarBraceL: new TokenType(\"${\", {\n+ beforeExpr: true,\n+ startsExpr: true\n+ }),\n \n- options.keyword = name;\n- return keywords[name] = new TokenType(name, options)\n- }\n+ // Operators. These carry several kinds of properties to help the\n+ // parser use them properly (the presence of these properties is\n+ // what categorizes them as operators).\n+ //\n+ // `binop`, when present, specifies that this operator is a binary\n+ // operator, and will refer to its precedence.\n+ //\n+ // `prefix` and `postfix` mark the operator as a prefix or postfix\n+ // unary operator.\n+ //\n+ // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n+ // binary operators with a very low precedence, that should result\n+ // in AssignmentExpression nodes.\n+\n+ eq: new TokenType(\"=\", {\n+ beforeExpr: true,\n+ isAssign: true\n+ }),\n+ assign: new TokenType(\"_=\", {\n+ beforeExpr: true,\n+ isAssign: true\n+ }),\n+ incDec: new TokenType(\"++/--\", {\n+ prefix: true,\n+ postfix: true,\n+ startsExpr: true\n+ }),\n+ prefix: new TokenType(\"!/~\", {\n+ beforeExpr: true,\n+ prefix: true,\n+ startsExpr: true\n+ }),\n+ logicalOR: binop(\"||\", 1),\n+ logicalAND: binop(\"&&\", 2),\n+ bitwiseOR: binop(\"|\", 3),\n+ bitwiseXOR: binop(\"^\", 4),\n+ bitwiseAND: binop(\"&\", 5),\n+ equality: binop(\"==/!=/===/!==\", 6),\n+ relational: binop(\"/<=/>=\", 7),\n+ bitShift: binop(\"<>/>>>\", 8),\n+ plusMin: new TokenType(\"+/-\", {\n+ beforeExpr: true,\n+ binop: 9,\n+ prefix: true,\n+ startsExpr: true\n+ }),\n+ modulo: binop(\"%\", 10),\n+ star: binop(\"*\", 10),\n+ slash: binop(\"/\", 10),\n+ starstar: new TokenType(\"**\", {\n+ beforeExpr: true\n+ }),\n+ coalesce: binop(\"??\", 1),\n \n- var types$1 = {\n- num: new TokenType(\"num\", startsExpr),\n- regexp: new TokenType(\"regexp\", startsExpr),\n- string: new TokenType(\"string\", startsExpr),\n- name: new TokenType(\"name\", startsExpr),\n- privateId: new TokenType(\"privateId\", startsExpr),\n- eof: new TokenType(\"eof\"),\n-\n- // Punctuation token types.\n- bracketL: new TokenType(\"[\", {\n- beforeExpr: true,\n- startsExpr: true\n- }),\n- bracketR: new TokenType(\"]\"),\n- braceL: new TokenType(\"{\", {\n- beforeExpr: true,\n- startsExpr: true\n- }),\n- braceR: new TokenType(\"}\"),\n- parenL: new TokenType(\"(\", {\n- beforeExpr: true,\n- startsExpr: true\n- }),\n- parenR: new TokenType(\")\"),\n- comma: new TokenType(\",\", beforeExpr),\n- semi: new TokenType(\";\", beforeExpr),\n- colon: new TokenType(\":\", beforeExpr),\n- dot: new TokenType(\".\"),\n- question: new TokenType(\"?\", beforeExpr),\n- questionDot: new TokenType(\"?.\"),\n- arrow: new TokenType(\"=>\", beforeExpr),\n- template: new TokenType(\"template\"),\n- invalidTemplate: new TokenType(\"invalidTemplate\"),\n- ellipsis: new TokenType(\"...\", beforeExpr),\n- backQuote: new TokenType(\"`\", startsExpr),\n- dollarBraceL: new TokenType(\"${\", {\n- beforeExpr: true,\n- startsExpr: true\n- }),\n-\n- // Operators. These carry several kinds of properties to help the\n- // parser use them properly (the presence of these properties is\n- // what categorizes them as operators).\n- //\n- // `binop`, when present, specifies that this operator is a binary\n- // operator, and will refer to its precedence.\n- //\n- // `prefix` and `postfix` mark the operator as a prefix or postfix\n- // unary operator.\n- //\n- // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n- // binary operators with a very low precedence, that should result\n- // in AssignmentExpression nodes.\n-\n- eq: new TokenType(\"=\", {\n- beforeExpr: true,\n- isAssign: true\n- }),\n- assign: new TokenType(\"_=\", {\n- beforeExpr: true,\n- isAssign: true\n- }),\n- incDec: new TokenType(\"++/--\", {\n- prefix: true,\n- postfix: true,\n- startsExpr: true\n- }),\n- prefix: new TokenType(\"!/~\", {\n- beforeExpr: true,\n- prefix: true,\n- startsExpr: true\n- }),\n- logicalOR: binop(\"||\", 1),\n- logicalAND: binop(\"&&\", 2),\n- bitwiseOR: binop(\"|\", 3),\n- bitwiseXOR: binop(\"^\", 4),\n- bitwiseAND: binop(\"&\", 5),\n- equality: binop(\"==/!=/===/!==\", 6),\n- relational: binop(\"/<=/>=\", 7),\n- bitShift: binop(\"<>/>>>\", 8),\n- plusMin: new TokenType(\"+/-\", {\n- beforeExpr: true,\n- binop: 9,\n- prefix: true,\n- startsExpr: true\n- }),\n- modulo: binop(\"%\", 10),\n- star: binop(\"*\", 10),\n- slash: binop(\"/\", 10),\n- starstar: new TokenType(\"**\", {\n- beforeExpr: true\n- }),\n- coalesce: binop(\"??\", 1),\n-\n- // Keyword token types.\n- _break: kw(\"break\"),\n- _case: kw(\"case\", beforeExpr),\n- _catch: kw(\"catch\"),\n- _continue: kw(\"continue\"),\n- _debugger: kw(\"debugger\"),\n- _default: kw(\"default\", beforeExpr),\n- _do: kw(\"do\", {\n- isLoop: true,\n- beforeExpr: true\n- }),\n- _else: kw(\"else\", beforeExpr),\n- _finally: kw(\"finally\"),\n- _for: kw(\"for\", {\n- isLoop: true\n- }),\n- _function: kw(\"function\", startsExpr),\n- _if: kw(\"if\"),\n- _return: kw(\"return\", beforeExpr),\n- _switch: kw(\"switch\"),\n- _throw: kw(\"throw\", beforeExpr),\n- _try: kw(\"try\"),\n- _var: kw(\"var\"),\n- _const: kw(\"const\"),\n- _while: kw(\"while\", {\n- isLoop: true\n- }),\n- _with: kw(\"with\"),\n- _new: kw(\"new\", {\n- beforeExpr: true,\n- startsExpr: true\n- }),\n- _this: kw(\"this\", startsExpr),\n- _super: kw(\"super\", startsExpr),\n- _class: kw(\"class\", startsExpr),\n- _extends: kw(\"extends\", beforeExpr),\n- _export: kw(\"export\"),\n- _import: kw(\"import\", startsExpr),\n- _null: kw(\"null\", startsExpr),\n- _true: kw(\"true\", startsExpr),\n- _false: kw(\"false\", startsExpr),\n- _in: kw(\"in\", {\n- beforeExpr: true,\n- binop: 7\n- }),\n- _instanceof: kw(\"instanceof\", {\n- beforeExpr: true,\n- binop: 7\n- }),\n- _typeof: kw(\"typeof\", {\n- beforeExpr: true,\n- prefix: true,\n- startsExpr: true\n- }),\n- _void: kw(\"void\", {\n- beforeExpr: true,\n- prefix: true,\n- startsExpr: true\n- }),\n- _delete: kw(\"delete\", {\n- beforeExpr: true,\n- prefix: true,\n- startsExpr: true\n- })\n- };\n+ // Keyword token types.\n+ _break: kw(\"break\"),\n+ _case: kw(\"case\", beforeExpr),\n+ _catch: kw(\"catch\"),\n+ _continue: kw(\"continue\"),\n+ _debugger: kw(\"debugger\"),\n+ _default: kw(\"default\", beforeExpr),\n+ _do: kw(\"do\", {\n+ isLoop: true,\n+ beforeExpr: true\n+ }),\n+ _else: kw(\"else\", beforeExpr),\n+ _finally: kw(\"finally\"),\n+ _for: kw(\"for\", {\n+ isLoop: true\n+ }),\n+ _function: kw(\"function\", startsExpr),\n+ _if: kw(\"if\"),\n+ _return: kw(\"return\", beforeExpr),\n+ _switch: kw(\"switch\"),\n+ _throw: kw(\"throw\", beforeExpr),\n+ _try: kw(\"try\"),\n+ _var: kw(\"var\"),\n+ _const: kw(\"const\"),\n+ _while: kw(\"while\", {\n+ isLoop: true\n+ }),\n+ _with: kw(\"with\"),\n+ _new: kw(\"new\", {\n+ beforeExpr: true,\n+ startsExpr: true\n+ }),\n+ _this: kw(\"this\", startsExpr),\n+ _super: kw(\"super\", startsExpr),\n+ _class: kw(\"class\", startsExpr),\n+ _extends: kw(\"extends\", beforeExpr),\n+ _export: kw(\"export\"),\n+ _import: kw(\"import\", startsExpr),\n+ _null: kw(\"null\", startsExpr),\n+ _true: kw(\"true\", startsExpr),\n+ _false: kw(\"false\", startsExpr),\n+ _in: kw(\"in\", {\n+ beforeExpr: true,\n+ binop: 7\n+ }),\n+ _instanceof: kw(\"instanceof\", {\n+ beforeExpr: true,\n+ binop: 7\n+ }),\n+ _typeof: kw(\"typeof\", {\n+ beforeExpr: true,\n+ prefix: true,\n+ startsExpr: true\n+ }),\n+ _void: kw(\"void\", {\n+ beforeExpr: true,\n+ prefix: true,\n+ startsExpr: true\n+ }),\n+ _delete: kw(\"delete\", {\n+ beforeExpr: true,\n+ prefix: true,\n+ startsExpr: true\n+ })\n+ };\n \n- // Matches a whole line break (where CRLF is considered a single\n- // line break). Used to count lines.\n+ // Matches a whole line break (where CRLF is considered a single\n+ // line break). Used to count lines.\n \n- var lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/;\n- var lineBreakG = new RegExp(lineBreak.source, \"g\");\n+ var lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/;\n+ var lineBreakG = new RegExp(lineBreak.source, \"g\");\n \n- function isNewLine(code) {\n- return code === 10 || code === 13 || code === 0x2028 || code === 0x2029\n- }\n+ function isNewLine(code) {\n+ return code === 10 || code === 13 || code === 0x2028 || code === 0x2029\n+ }\n \n- function nextLineBreak(code, from, end) {\n- if (end === void 0) end = code.length;\n+ function nextLineBreak(code, from, end) {\n+ if (end === void 0) end = code.length;\n \n- for (var i = from; i < end; i++) {\n- var next = code.charCodeAt(i);\n- if (isNewLine(next)) {\n- return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1\n+ for (var i = from; i < end; i++) {\n+ var next = code.charCodeAt(i);\n+ if (isNewLine(next)) {\n+ return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1\n+ }\n }\n+ return -1\n }\n- return -1\n- }\n \n- var nonASCIIwhitespace = /[\\u1680\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/;\n+ var nonASCIIwhitespace = /[\\u1680\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/;\n \n- var skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n+ var skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n \n- var ref = Object.prototype;\n- var hasOwnProperty = ref.hasOwnProperty;\n- var toString = ref.toString;\n-\n- var hasOwn = Object.hasOwn || (function(obj, propName) {\n- return (\n- hasOwnProperty.call(obj, propName)\n- );\n- });\n-\n- var isArray = Array.isArray || (function(obj) {\n- return (\n- toString.call(obj) === \"[object Array]\"\n- );\n- });\n+ var ref = Object.prototype;\n+ var hasOwnProperty = ref.hasOwnProperty;\n+ var toString = ref.toString;\n \n- function wordsRegexp(words) {\n- return new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\")\n- }\n+ var hasOwn = Object.hasOwn || (function(obj, propName) {\n+ return (\n+ hasOwnProperty.call(obj, propName)\n+ );\n+ });\n+\n+ var isArray = Array.isArray || (function(obj) {\n+ return (\n+ toString.call(obj) === \"[object Array]\"\n+ );\n+ });\n \n- function codePointToString(code) {\n- // UTF-16 Decoding\n- if (code <= 0xFFFF) {\n- return String.fromCharCode(code)\n+ function wordsRegexp(words) {\n+ return new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\")\n }\n- code -= 0x10000;\n- return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)\n- }\n \n- var loneSurrogate = /(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/;\n+ function codePointToString(code) {\n+ // UTF-16 Decoding\n+ if (code <= 0xFFFF) {\n+ return String.fromCharCode(code)\n+ }\n+ code -= 0x10000;\n+ return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)\n+ }\n \n- // These are used when `options.locations` is on, for the\n- // `startLoc` and `endLoc` properties.\n+ var loneSurrogate = /(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/;\n \n- var Position = function Position(line, col) {\n- this.line = line;\n- this.column = col;\n- };\n+ // These are used when `options.locations` is on, for the\n+ // `startLoc` and `endLoc` properties.\n \n- Position.prototype.offset = function offset(n) {\n- return new Position(this.line, this.column + n)\n- };\n+ var Position = function Position(line, col) {\n+ this.line = line;\n+ this.column = col;\n+ };\n \n- var SourceLocation = function SourceLocation(p, start, end) {\n- this.start = start;\n- this.end = end;\n- if (p.sourceFile !== null) {\n- this.source = p.sourceFile;\n- }\n- };\n+ Position.prototype.offset = function offset(n) {\n+ return new Position(this.line, this.column + n)\n+ };\n \n- // The `getLineInfo` function is mostly useful when the\n- // `locations` option is off (for performance reasons) and you\n- // want to find the line/column position for a given character\n- // offset. `input` should be the code string that the offset refers\n- // into.\n-\n- function getLineInfo(input, offset) {\n- for (var line = 1, cur = 0;;) {\n- var nextBreak = nextLineBreak(input, cur, offset);\n- if (nextBreak < 0) {\n- return new Position(line, offset - cur)\n+ var SourceLocation = function SourceLocation(p, start, end) {\n+ this.start = start;\n+ this.end = end;\n+ if (p.sourceFile !== null) {\n+ this.source = p.sourceFile;\n }\n- ++line;\n- cur = nextBreak;\n- }\n- }\n+ };\n \n- // A second argument must be given to configure the parser process.\n- // These options are recognized (only `ecmaVersion` is required):\n+ // The `getLineInfo` function is mostly useful when the\n+ // `locations` option is off (for performance reasons) and you\n+ // want to find the line/column position for a given character\n+ // offset. `input` should be the code string that the offset refers\n+ // into.\n+\n+ function getLineInfo(input, offset) {\n+ for (var line = 1, cur = 0;;) {\n+ var nextBreak = nextLineBreak(input, cur, offset);\n+ if (nextBreak < 0) {\n+ return new Position(line, offset - cur)\n+ }\n+ ++line;\n+ cur = nextBreak;\n+ }\n+ }\n+\n+ // A second argument must be given to configure the parser process.\n+ // These options are recognized (only `ecmaVersion` is required):\n+\n+ var defaultOptions = {\n+ // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n+ // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10\n+ // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `\"latest\"`\n+ // (the latest version the library supports). This influences\n+ // support for strict mode, the set of reserved words, and support\n+ // for new syntax features.\n+ ecmaVersion: null,\n+ // `sourceType` indicates the mode the code should be parsed in.\n+ // Can be either `\"script\"` or `\"module\"`. This influences global\n+ // strict mode and parsing of `import` and `export` declarations.\n+ sourceType: \"script\",\n+ // `onInsertedSemicolon` can be a callback that will be called\n+ // when a semicolon is automatically inserted. It will be passed\n+ // the position of the comma as an offset, and if `locations` is\n+ // enabled, it is given the location as a `{line, column}` object\n+ // as second argument.\n+ onInsertedSemicolon: null,\n+ // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n+ // trailing commas.\n+ onTrailingComma: null,\n+ // By default, reserved words are only enforced if ecmaVersion >= 5.\n+ // Set `allowReserved` to a boolean value to explicitly turn this on\n+ // an off. When this option has the value \"never\", reserved words\n+ // and keywords can also not be used as property names.\n+ allowReserved: null,\n+ // When enabled, a return at the top level is not considered an\n+ // error.\n+ allowReturnOutsideFunction: false,\n+ // When enabled, import/export statements are not constrained to\n+ // appearing at the top of the program, and an import.meta expression\n+ // in a script isn't considered an error.\n+ allowImportExportEverywhere: false,\n+ // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.\n+ // When enabled, await identifiers are allowed to appear at the top-level scope,\n+ // but they are still not allowed in non-async functions.\n+ allowAwaitOutsideFunction: null,\n+ // When enabled, super identifiers are not constrained to\n+ // appearing in methods and do not raise an error when they appear elsewhere.\n+ allowSuperOutsideMethod: null,\n+ // When enabled, hashbang directive in the beginning of file is\n+ // allowed and treated as a line comment. Enabled by default when\n+ // `ecmaVersion` >= 2023.\n+ allowHashBang: false,\n+ // When `locations` is on, `loc` properties holding objects with\n+ // `start` and `end` properties in `{line, column}` form (with\n+ // line being 1-based and column 0-based) will be attached to the\n+ // nodes.\n+ locations: false,\n+ // A function can be passed as `onToken` option, which will\n+ // cause Acorn to call that function with object in the same\n+ // format as tokens returned from `tokenizer().getToken()`. Note\n+ // that you are not allowed to call the parser from the\n+ // callback\u2014that will corrupt its internal state.\n+ onToken: null,\n+ // A function can be passed as `onComment` option, which will\n+ // cause Acorn to call that function with `(block, text, start,\n+ // end)` parameters whenever a comment is skipped. `block` is a\n+ // boolean indicating whether this is a block (`/* */`) comment,\n+ // `text` is the content of the comment, and `start` and `end` are\n+ // character offsets that denote the start and end of the comment.\n+ // When the `locations` option is on, two more parameters are\n+ // passed, the full `{line, column}` locations of the start and\n+ // end of the comments. Note that you are not allowed to call the\n+ // parser from the callback\u2014that will corrupt its internal state.\n+ onComment: null,\n+ // Nodes have their start and end characters offsets recorded in\n+ // `start` and `end` properties (directly on the node, rather than\n+ // the `loc` object, which holds line/column data. To also add a\n+ // [semi-standardized][range] `range` property holding a `[start,\n+ // end]` array with the same numbers, set the `ranges` option to\n+ // `true`.\n+ //\n+ // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n+ ranges: false,\n+ // It is possible to parse multiple files into a single AST by\n+ // passing the tree produced by parsing the first file as\n+ // `program` option in subsequent parses. This will add the\n+ // toplevel forms of the parsed file to the `Program` (top) node\n+ // of an existing parse tree.\n+ program: null,\n+ // When `locations` is on, you can pass this to record the source\n+ // file in every node's `loc` object.\n+ sourceFile: null,\n+ // This value, if given, is stored in every node, whether\n+ // `locations` is on or off.\n+ directSourceFile: null,\n+ // When enabled, parenthesized expressions are represented by\n+ // (non-standard) ParenthesizedExpression nodes\n+ preserveParens: false\n+ };\n \n- var defaultOptions = {\n- // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n- // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10\n- // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `\"latest\"`\n- // (the latest version the library supports). This influences\n- // support for strict mode, the set of reserved words, and support\n- // for new syntax features.\n- ecmaVersion: null,\n- // `sourceType` indicates the mode the code should be parsed in.\n- // Can be either `\"script\"` or `\"module\"`. This influences global\n- // strict mode and parsing of `import` and `export` declarations.\n- sourceType: \"script\",\n- // `onInsertedSemicolon` can be a callback that will be called\n- // when a semicolon is automatically inserted. It will be passed\n- // the position of the comma as an offset, and if `locations` is\n- // enabled, it is given the location as a `{line, column}` object\n- // as second argument.\n- onInsertedSemicolon: null,\n- // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n- // trailing commas.\n- onTrailingComma: null,\n- // By default, reserved words are only enforced if ecmaVersion >= 5.\n- // Set `allowReserved` to a boolean value to explicitly turn this on\n- // an off. When this option has the value \"never\", reserved words\n- // and keywords can also not be used as property names.\n- allowReserved: null,\n- // When enabled, a return at the top level is not considered an\n- // error.\n- allowReturnOutsideFunction: false,\n- // When enabled, import/export statements are not constrained to\n- // appearing at the top of the program, and an import.meta expression\n- // in a script isn't considered an error.\n- allowImportExportEverywhere: false,\n- // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.\n- // When enabled, await identifiers are allowed to appear at the top-level scope,\n- // but they are still not allowed in non-async functions.\n- allowAwaitOutsideFunction: null,\n- // When enabled, super identifiers are not constrained to\n- // appearing in methods and do not raise an error when they appear elsewhere.\n- allowSuperOutsideMethod: null,\n- // When enabled, hashbang directive in the beginning of file is\n- // allowed and treated as a line comment. Enabled by default when\n- // `ecmaVersion` >= 2023.\n- allowHashBang: false,\n- // When `locations` is on, `loc` properties holding objects with\n- // `start` and `end` properties in `{line, column}` form (with\n- // line being 1-based and column 0-based) will be attached to the\n- // nodes.\n- locations: false,\n- // A function can be passed as `onToken` option, which will\n- // cause Acorn to call that function with object in the same\n- // format as tokens returned from `tokenizer().getToken()`. Note\n- // that you are not allowed to call the parser from the\n- // callback\u2014that will corrupt its internal state.\n- onToken: null,\n- // A function can be passed as `onComment` option, which will\n- // cause Acorn to call that function with `(block, text, start,\n- // end)` parameters whenever a comment is skipped. `block` is a\n- // boolean indicating whether this is a block (`/* */`) comment,\n- // `text` is the content of the comment, and `start` and `end` are\n- // character offsets that denote the start and end of the comment.\n- // When the `locations` option is on, two more parameters are\n- // passed, the full `{line, column}` locations of the start and\n- // end of the comments. Note that you are not allowed to call the\n- // parser from the callback\u2014that will corrupt its internal state.\n- onComment: null,\n- // Nodes have their start and end characters offsets recorded in\n- // `start` and `end` properties (directly on the node, rather than\n- // the `loc` object, which holds line/column data. To also add a\n- // [semi-standardized][range] `range` property holding a `[start,\n- // end]` array with the same numbers, set the `ranges` option to\n- // `true`.\n- //\n- // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n- ranges: false,\n- // It is possible to parse multiple files into a single AST by\n- // passing the tree produced by parsing the first file as\n- // `program` option in subsequent parses. This will add the\n- // toplevel forms of the parsed file to the `Program` (top) node\n- // of an existing parse tree.\n- program: null,\n- // When `locations` is on, you can pass this to record the source\n- // file in every node's `loc` object.\n- sourceFile: null,\n- // This value, if given, is stored in every node, whether\n- // `locations` is on or off.\n- directSourceFile: null,\n- // When enabled, parenthesized expressions are represented by\n- // (non-standard) ParenthesizedExpression nodes\n- preserveParens: false\n- };\n+ // Interpret and default an options object\n \n- // Interpret and default an options object\n+ var warnedAboutEcmaVersion = false;\n \n- var warnedAboutEcmaVersion = false;\n+ function getOptions(opts) {\n+ if (opts === void 0) opts = {};\n \n- function getOptions(opts) {\n- if (opts === void 0) opts = {};\n+ var options = {};\n \n- var options = {};\n+ for (var opt in defaultOptions) {\n+ options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt];\n+ }\n \n- for (var opt in defaultOptions) {\n- options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt];\n- }\n+ if (options.ecmaVersion === \"latest\") {\n+ options.ecmaVersion = 1e8;\n+ } else if (options.ecmaVersion == null) {\n+ if (!warnedAboutEcmaVersion && typeof console === \"object\" && console.warn) {\n+ warnedAboutEcmaVersion = true;\n+ console.warn(\"Since Acorn 8.0.0, options.ecmaVersion is required.\\nDefaulting to 2020, but this will stop working in the future.\");\n+ }\n+ options.ecmaVersion = 11;\n+ } else if (options.ecmaVersion >= 2015) {\n+ options.ecmaVersion -= 2009;\n+ }\n \n- if (options.ecmaVersion === \"latest\") {\n- options.ecmaVersion = 1e8;\n- } else if (options.ecmaVersion == null) {\n- if (!warnedAboutEcmaVersion && typeof console === \"object\" && console.warn) {\n- warnedAboutEcmaVersion = true;\n- console.warn(\"Since Acorn 8.0.0, options.ecmaVersion is required.\\nDefaulting to 2020, but this will stop working in the future.\");\n+ if (options.allowReserved == null) {\n+ options.allowReserved = options.ecmaVersion < 5;\n }\n- options.ecmaVersion = 11;\n- } else if (options.ecmaVersion >= 2015) {\n- options.ecmaVersion -= 2009;\n- }\n \n- if (options.allowReserved == null) {\n- options.allowReserved = options.ecmaVersion < 5;\n- }\n+ if (opts.allowHashBang == null) {\n+ options.allowHashBang = options.ecmaVersion >= 14;\n+ }\n \n- if (opts.allowHashBang == null) {\n- options.allowHashBang = options.ecmaVersion >= 14;\n- }\n+ if (isArray(options.onToken)) {\n+ var tokens = options.onToken;\n+ options.onToken = function(token) {\n+ return tokens.push(token);\n+ };\n+ }\n+ if (isArray(options.onComment)) {\n+ options.onComment = pushComment(options, options.onComment);\n+ }\n \n- if (isArray(options.onToken)) {\n- var tokens = options.onToken;\n- options.onToken = function(token) {\n- return tokens.push(token);\n- };\n+ return options\n }\n- if (isArray(options.onComment)) {\n- options.onComment = pushComment(options, options.onComment);\n+\n+ function pushComment(options, array) {\n+ return function(block, text, start, end, startLoc, endLoc) {\n+ var comment = {\n+ type: block ? \"Block\" : \"Line\",\n+ value: text,\n+ start: start,\n+ end: end\n+ };\n+ if (options.locations) {\n+ comment.loc = new SourceLocation(this, startLoc, endLoc);\n+ }\n+ if (options.ranges) {\n+ comment.range = [start, end];\n+ }\n+ array.push(comment);\n+ }\n }\n \n- return options\n- }\n+ // Each scope gets a bitset that may contain these flags\n+ var\n+ SCOPE_TOP = 1,\n+ SCOPE_FUNCTION = 2,\n+ SCOPE_ASYNC = 4,\n+ SCOPE_GENERATOR = 8,\n+ SCOPE_ARROW = 16,\n+ SCOPE_SIMPLE_CATCH = 32,\n+ SCOPE_SUPER = 64,\n+ SCOPE_DIRECT_SUPER = 128,\n+ SCOPE_CLASS_STATIC_BLOCK = 256,\n+ SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;\n+\n+ function functionFlags(async, generator) {\n+ return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n+ }\n+\n+ // Used in checkLVal* and declareName to determine the type of a binding\n+ var\n+ BIND_NONE = 0, // Not a binding\n+ BIND_VAR = 1, // Var-style binding\n+ BIND_LEXICAL = 2, // Let- or const-style binding\n+ BIND_FUNCTION = 3, // Function declaration\n+ BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n+ BIND_OUTSIDE = 5; // Special case for function names as bound inside the function\n+\n+ var Parser = function Parser(options, input, startPos) {\n+ this.options = options = getOptions(options);\n+ this.sourceFile = options.sourceFile;\n+ this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === \"module\" ? \"5module\" : 5]);\n+ var reserved = \"\";\n+ if (options.allowReserved !== true) {\n+ reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];\n+ if (options.sourceType === \"module\") {\n+ reserved += \" await\";\n+ }\n+ }\n+ this.reservedWords = wordsRegexp(reserved);\n+ var reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict;\n+ this.reservedWordsStrict = wordsRegexp(reservedStrict);\n+ this.reservedWordsStrictBind = wordsRegexp(reservedStrict + \" \" + reservedWords.strictBind);\n+ this.input = String(input);\n+\n+ // Used to signal to callers of `readWord1` whether the word\n+ // contained any escape sequences. This is needed because words with\n+ // escape sequences must not be interpreted as keywords.\n+ this.containsEsc = false;\n \n- function pushComment(options, array) {\n- return function(block, text, start, end, startLoc, endLoc) {\n- var comment = {\n- type: block ? \"Block\" : \"Line\",\n- value: text,\n- start: start,\n- end: end\n- };\n- if (options.locations) {\n- comment.loc = new SourceLocation(this, startLoc, endLoc);\n+ // Set up token state\n+\n+ // The current position of the tokenizer in the input.\n+ if (startPos) {\n+ this.pos = startPos;\n+ this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1;\n+ this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;\n+ } else {\n+ this.pos = this.lineStart = 0;\n+ this.curLine = 1;\n }\n- if (options.ranges) {\n- comment.range = [start, end];\n+\n+ // Properties of the current token:\n+ // Its type\n+ this.type = types$1.eof;\n+ // For tokens that include more information than their type, the value\n+ this.value = null;\n+ // Its start and end offset\n+ this.start = this.end = this.pos;\n+ // And, if locations are used, the {line, column} object\n+ // corresponding to those offsets\n+ this.startLoc = this.endLoc = this.curPosition();\n+\n+ // Position information for the previous token\n+ this.lastTokEndLoc = this.lastTokStartLoc = null;\n+ this.lastTokStart = this.lastTokEnd = this.pos;\n+\n+ // The context stack is used to superficially track syntactic\n+ // context to predict whether a regular expression is allowed in a\n+ // given position.\n+ this.context = this.initialContext();\n+ this.exprAllowed = true;\n+\n+ // Figure out if it's a module code.\n+ this.inModule = options.sourceType === \"module\";\n+ this.strict = this.inModule || this.strictDirective(this.pos);\n+\n+ // Used to signify the start of a potential arrow function\n+ this.potentialArrowAt = -1;\n+ this.potentialArrowInForAwait = false;\n+\n+ // Positions to delayed-check that yield/await does not exist in default parameters.\n+ this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;\n+ // Labels in scope.\n+ this.labels = [];\n+ // Thus-far undefined exports.\n+ this.undefinedExports = Object.create(null);\n+\n+ // If enabled, skip leading hashbang line.\n+ if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\") {\n+ this.skipLineComment(2);\n }\n- array.push(comment);\n- }\n- }\n \n- // Each scope gets a bitset that may contain these flags\n- var\n- SCOPE_TOP = 1,\n- SCOPE_FUNCTION = 2,\n- SCOPE_ASYNC = 4,\n- SCOPE_GENERATOR = 8,\n- SCOPE_ARROW = 16,\n- SCOPE_SIMPLE_CATCH = 32,\n- SCOPE_SUPER = 64,\n- SCOPE_DIRECT_SUPER = 128,\n- SCOPE_CLASS_STATIC_BLOCK = 256,\n- SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;\n+ // Scope tracking for duplicate variable names (see scope.js)\n+ this.scopeStack = [];\n+ this.enterScope(SCOPE_TOP);\n \n- function functionFlags(async, generator) {\n- return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n- }\n+ // For RegExp validation\n+ this.regexpState = null;\n \n- // Used in checkLVal* and declareName to determine the type of a binding\n- var\n- BIND_NONE = 0, // Not a binding\n- BIND_VAR = 1, // Var-style binding\n- BIND_LEXICAL = 2, // Let- or const-style binding\n- BIND_FUNCTION = 3, // Function declaration\n- BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n- BIND_OUTSIDE = 5; // Special case for function names as bound inside the function\n-\n- var Parser = function Parser(options, input, startPos) {\n- this.options = options = getOptions(options);\n- this.sourceFile = options.sourceFile;\n- this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === \"module\" ? \"5module\" : 5]);\n- var reserved = \"\";\n- if (options.allowReserved !== true) {\n- reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];\n- if (options.sourceType === \"module\") {\n- reserved += \" await\";\n- }\n- }\n- this.reservedWords = wordsRegexp(reserved);\n- var reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict;\n- this.reservedWordsStrict = wordsRegexp(reservedStrict);\n- this.reservedWordsStrictBind = wordsRegexp(reservedStrict + \" \" + reservedWords.strictBind);\n- this.input = String(input);\n-\n- // Used to signal to callers of `readWord1` whether the word\n- // contained any escape sequences. This is needed because words with\n- // escape sequences must not be interpreted as keywords.\n- this.containsEsc = false;\n-\n- // Set up token state\n-\n- // The current position of the tokenizer in the input.\n- if (startPos) {\n- this.pos = startPos;\n- this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1;\n- this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;\n- } else {\n- this.pos = this.lineStart = 0;\n- this.curLine = 1;\n- }\n-\n- // Properties of the current token:\n- // Its type\n- this.type = types$1.eof;\n- // For tokens that include more information than their type, the value\n- this.value = null;\n- // Its start and end offset\n- this.start = this.end = this.pos;\n- // And, if locations are used, the {line, column} object\n- // corresponding to those offsets\n- this.startLoc = this.endLoc = this.curPosition();\n-\n- // Position information for the previous token\n- this.lastTokEndLoc = this.lastTokStartLoc = null;\n- this.lastTokStart = this.lastTokEnd = this.pos;\n-\n- // The context stack is used to superficially track syntactic\n- // context to predict whether a regular expression is allowed in a\n- // given position.\n- this.context = this.initialContext();\n- this.exprAllowed = true;\n-\n- // Figure out if it's a module code.\n- this.inModule = options.sourceType === \"module\";\n- this.strict = this.inModule || this.strictDirective(this.pos);\n-\n- // Used to signify the start of a potential arrow function\n- this.potentialArrowAt = -1;\n- this.potentialArrowInForAwait = false;\n-\n- // Positions to delayed-check that yield/await does not exist in default parameters.\n- this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;\n- // Labels in scope.\n- this.labels = [];\n- // Thus-far undefined exports.\n- this.undefinedExports = Object.create(null);\n-\n- // If enabled, skip leading hashbang line.\n- if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\") {\n- this.skipLineComment(2);\n- }\n-\n- // Scope tracking for duplicate variable names (see scope.js)\n- this.scopeStack = [];\n- this.enterScope(SCOPE_TOP);\n-\n- // For RegExp validation\n- this.regexpState = null;\n-\n- // The stack of private names.\n- // Each element has two properties: 'declared' and 'used'.\n- // When it exited from the outermost class definition, all used private names must be declared.\n- this.privateNameStack = [];\n- };\n+ // The stack of private names.\n+ // Each element has two properties: 'declared' and 'used'.\n+ // When it exited from the outermost class definition, all used private names must be declared.\n+ this.privateNameStack = [];\n+ };\n \n- var prototypeAccessors = {\n- inFunction: {\n- configurable: true\n- },\n- inGenerator: {\n- configurable: true\n- },\n- inAsync: {\n- configurable: true\n- },\n- canAwait: {\n- configurable: true\n- },\n- allowSuper: {\n- configurable: true\n- },\n- allowDirectSuper: {\n- configurable: true\n- },\n- treatFunctionsAsVar: {\n- configurable: true\n- },\n- allowNewDotTarget: {\n- configurable: true\n- },\n- inClassStaticBlock: {\n- configurable: true\n- }\n- };\n+ var prototypeAccessors = {\n+ inFunction: {\n+ configurable: true\n+ },\n+ inGenerator: {\n+ configurable: true\n+ },\n+ inAsync: {\n+ configurable: true\n+ },\n+ canAwait: {\n+ configurable: true\n+ },\n+ allowSuper: {\n+ configurable: true\n+ },\n+ allowDirectSuper: {\n+ configurable: true\n+ },\n+ treatFunctionsAsVar: {\n+ configurable: true\n+ },\n+ allowNewDotTarget: {\n+ configurable: true\n+ },\n+ inClassStaticBlock: {\n+ configurable: true\n+ }\n+ };\n \n- Parser.prototype.parse = function parse() {\n- var node = this.options.program || this.startNode();\n- this.nextToken();\n- return this.parseTopLevel(node)\n- };\n+ Parser.prototype.parse = function parse() {\n+ var node = this.options.program || this.startNode();\n+ this.nextToken();\n+ return this.parseTopLevel(node)\n+ };\n \n- prototypeAccessors.inFunction.get = function() {\n- return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0\n- };\n+ prototypeAccessors.inFunction.get = function() {\n+ return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0\n+ };\n \n- prototypeAccessors.inGenerator.get = function() {\n- return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit\n- };\n+ prototypeAccessors.inGenerator.get = function() {\n+ return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit\n+ };\n \n- prototypeAccessors.inAsync.get = function() {\n- return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit\n- };\n+ prototypeAccessors.inAsync.get = function() {\n+ return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit\n+ };\n \n- prototypeAccessors.canAwait.get = function() {\n- for (var i = this.scopeStack.length - 1; i >= 0; i--) {\n- var scope = this.scopeStack[i];\n- if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) {\n- return false\n- }\n- if (scope.flags & SCOPE_FUNCTION) {\n- return (scope.flags & SCOPE_ASYNC) > 0\n+ prototypeAccessors.canAwait.get = function() {\n+ for (var i = this.scopeStack.length - 1; i >= 0; i--) {\n+ var scope = this.scopeStack[i];\n+ if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) {\n+ return false\n+ }\n+ if (scope.flags & SCOPE_FUNCTION) {\n+ return (scope.flags & SCOPE_ASYNC) > 0\n+ }\n }\n- }\n- return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction\n- };\n+ return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction\n+ };\n \n- prototypeAccessors.allowSuper.get = function() {\n- var ref = this.currentThisScope();\n- var flags = ref.flags;\n- var inClassFieldInit = ref.inClassFieldInit;\n- return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod\n- };\n+ prototypeAccessors.allowSuper.get = function() {\n+ var ref = this.currentThisScope();\n+ var flags = ref.flags;\n+ var inClassFieldInit = ref.inClassFieldInit;\n+ return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod\n+ };\n \n- prototypeAccessors.allowDirectSuper.get = function() {\n- return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0\n- };\n+ prototypeAccessors.allowDirectSuper.get = function() {\n+ return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0\n+ };\n \n- prototypeAccessors.treatFunctionsAsVar.get = function() {\n- return this.treatFunctionsAsVarInScope(this.currentScope())\n- };\n+ prototypeAccessors.treatFunctionsAsVar.get = function() {\n+ return this.treatFunctionsAsVarInScope(this.currentScope())\n+ };\n \n- prototypeAccessors.allowNewDotTarget.get = function() {\n- var ref = this.currentThisScope();\n- var flags = ref.flags;\n- var inClassFieldInit = ref.inClassFieldInit;\n- return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit\n- };\n+ prototypeAccessors.allowNewDotTarget.get = function() {\n+ var ref = this.currentThisScope();\n+ var flags = ref.flags;\n+ var inClassFieldInit = ref.inClassFieldInit;\n+ return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit\n+ };\n \n- prototypeAccessors.inClassStaticBlock.get = function() {\n- return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0\n- };\n+ prototypeAccessors.inClassStaticBlock.get = function() {\n+ return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0\n+ };\n \n- Parser.extend = function extend() {\n- var plugins = [],\n- len = arguments.length;\n- while (len--) plugins[len] = arguments[len];\n-\n- var cls = this;\n- for (var i = 0; i < plugins.length; i++) {\n- cls = plugins[i](cls);\n- }\n- return cls\n- };\n+ Parser.extend = function extend() {\n+ var plugins = [],\n+ len = arguments.length;\n+ while (len--) plugins[len] = arguments[len];\n+\n+ var cls = this;\n+ for (var i = 0; i < plugins.length; i++) {\n+ cls = plugins[i](cls);\n+ }\n+ return cls\n+ };\n \n- Parser.parse = function parse(input, options) {\n- return new this(options, input).parse()\n- };\n+ Parser.parse = function parse(input, options) {\n+ return new this(options, input).parse()\n+ };\n \n- Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) {\n- var parser = new this(options, input, pos);\n- parser.nextToken();\n- return parser.parseExpression()\n- };\n+ Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) {\n+ var parser = new this(options, input, pos);\n+ parser.nextToken();\n+ return parser.parseExpression()\n+ };\n \n- Parser.tokenizer = function tokenizer(input, options) {\n- return new this(options, input)\n- };\n+ Parser.tokenizer = function tokenizer(input, options) {\n+ return new this(options, input)\n+ };\n \n- Object.defineProperties(Parser.prototype, prototypeAccessors);\n+ Object.defineProperties(Parser.prototype, prototypeAccessors);\n \n- var pp$9 = Parser.prototype;\n+ var pp$9 = Parser.prototype;\n \n- // ## Parser utilities\n+ // ## Parser utilities\n \n- var literal = /^(?:'((?:\\\\.|[^'\\\\])*?)'|\"((?:\\\\.|[^\"\\\\])*?)\")/;\n- pp$9.strictDirective = function(start) {\n- if (this.options.ecmaVersion < 5) {\n- return false\n- }\n- for (;;) {\n- // Try to find string literal.\n- skipWhiteSpace.lastIndex = start;\n- start += skipWhiteSpace.exec(this.input)[0].length;\n- var match = literal.exec(this.input.slice(start));\n- if (!match) {\n+ var literal = /^(?:'((?:\\\\.|[^'\\\\])*?)'|\"((?:\\\\.|[^\"\\\\])*?)\")/;\n+ pp$9.strictDirective = function(start) {\n+ if (this.options.ecmaVersion < 5) {\n return false\n }\n- if ((match[1] || match[2]) === \"use strict\") {\n- skipWhiteSpace.lastIndex = start + match[0].length;\n- var spaceAfter = skipWhiteSpace.exec(this.input),\n- end = spaceAfter.index + spaceAfter[0].length;\n- var next = this.input.charAt(end);\n- return next === \";\" || next === \"}\" ||\n- (lineBreak.test(spaceAfter[0]) &&\n- !(/[(`.[+\\-/*%<>=,?^&]/.test(next) || next === \"!\" && this.input.charAt(end + 1) === \"=\"))\n- }\n- start += match[0].length;\n-\n- // Skip semicolon, if any.\n- skipWhiteSpace.lastIndex = start;\n- start += skipWhiteSpace.exec(this.input)[0].length;\n- if (this.input[start] === \";\") {\n- start++;\n+ for (;;) {\n+ // Try to find string literal.\n+ skipWhiteSpace.lastIndex = start;\n+ start += skipWhiteSpace.exec(this.input)[0].length;\n+ var match = literal.exec(this.input.slice(start));\n+ if (!match) {\n+ return false\n+ }\n+ if ((match[1] || match[2]) === \"use strict\") {\n+ skipWhiteSpace.lastIndex = start + match[0].length;\n+ var spaceAfter = skipWhiteSpace.exec(this.input),\n+ end = spaceAfter.index + spaceAfter[0].length;\n+ var next = this.input.charAt(end);\n+ return next === \";\" || next === \"}\" ||\n+ (lineBreak.test(spaceAfter[0]) &&\n+ !(/[(`.[+\\-/*%<>=,?^&]/.test(next) || next === \"!\" && this.input.charAt(end + 1) === \"=\"))\n+ }\n+ start += match[0].length;\n+\n+ // Skip semicolon, if any.\n+ skipWhiteSpace.lastIndex = start;\n+ start += skipWhiteSpace.exec(this.input)[0].length;\n+ if (this.input[start] === \";\") {\n+ start++;\n+ }\n }\n- }\n- };\n+ };\n \n- // Predicate that tests whether the next token is of the given\n- // type, and if yes, consumes it as a side effect.\n+ // Predicate that tests whether the next token is of the given\n+ // type, and if yes, consumes it as a side effect.\n \n- pp$9.eat = function(type) {\n- if (this.type === type) {\n- this.next();\n- return true\n- } else {\n- return false\n- }\n- };\n+ pp$9.eat = function(type) {\n+ if (this.type === type) {\n+ this.next();\n+ return true\n+ } else {\n+ return false\n+ }\n+ };\n \n- // Tests whether parsed token is a contextual keyword.\n+ // Tests whether parsed token is a contextual keyword.\n \n- pp$9.isContextual = function(name) {\n- return this.type === types$1.name && this.value === name && !this.containsEsc\n- };\n+ pp$9.isContextual = function(name) {\n+ return this.type === types$1.name && this.value === name && !this.containsEsc\n+ };\n \n- // Consumes contextual keyword if possible.\n+ // Consumes contextual keyword if possible.\n \n- pp$9.eatContextual = function(name) {\n- if (!this.isContextual(name)) {\n- return false\n- }\n- this.next();\n- return true\n- };\n+ pp$9.eatContextual = function(name) {\n+ if (!this.isContextual(name)) {\n+ return false\n+ }\n+ this.next();\n+ return true\n+ };\n \n- // Asserts that following token is given contextual keyword.\n+ // Asserts that following token is given contextual keyword.\n \n- pp$9.expectContextual = function(name) {\n- if (!this.eatContextual(name)) {\n- this.unexpected();\n- }\n- };\n+ pp$9.expectContextual = function(name) {\n+ if (!this.eatContextual(name)) {\n+ this.unexpected();\n+ }\n+ };\n \n- // Test whether a semicolon can be inserted at the current position.\n+ // Test whether a semicolon can be inserted at the current position.\n \n- pp$9.canInsertSemicolon = function() {\n- return this.type === types$1.eof ||\n- this.type === types$1.braceR ||\n- lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n- };\n+ pp$9.canInsertSemicolon = function() {\n+ return this.type === types$1.eof ||\n+ this.type === types$1.braceR ||\n+ lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n+ };\n \n- pp$9.insertSemicolon = function() {\n- if (this.canInsertSemicolon()) {\n- if (this.options.onInsertedSemicolon) {\n- this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc);\n+ pp$9.insertSemicolon = function() {\n+ if (this.canInsertSemicolon()) {\n+ if (this.options.onInsertedSemicolon) {\n+ this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc);\n+ }\n+ return true\n }\n- return true\n- }\n- };\n+ };\n \n- // Consume a semicolon, or, failing that, see if we are allowed to\n- // pretend that there is a semicolon at this position.\n+ // Consume a semicolon, or, failing that, see if we are allowed to\n+ // pretend that there is a semicolon at this position.\n \n- pp$9.semicolon = function() {\n- if (!this.eat(types$1.semi) && !this.insertSemicolon()) {\n- this.unexpected();\n- }\n- };\n-\n- pp$9.afterTrailingComma = function(tokType, notNext) {\n- if (this.type === tokType) {\n- if (this.options.onTrailingComma) {\n- this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc);\n+ pp$9.semicolon = function() {\n+ if (!this.eat(types$1.semi) && !this.insertSemicolon()) {\n+ this.unexpected();\n }\n- if (!notNext) {\n- this.next();\n+ };\n+\n+ pp$9.afterTrailingComma = function(tokType, notNext) {\n+ if (this.type === tokType) {\n+ if (this.options.onTrailingComma) {\n+ this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc);\n+ }\n+ if (!notNext) {\n+ this.next();\n+ }\n+ return true\n }\n- return true\n- }\n- };\n+ };\n \n- // Expect a token of a given type. If found, consume it, otherwise,\n- // raise an unexpected token error.\n+ // Expect a token of a given type. If found, consume it, otherwise,\n+ // raise an unexpected token error.\n \n- pp$9.expect = function(type) {\n- this.eat(type) || this.unexpected();\n- };\n+ pp$9.expect = function(type) {\n+ this.eat(type) || this.unexpected();\n+ };\n \n- // Raise an unexpected token error.\n+ // Raise an unexpected token error.\n \n- pp$9.unexpected = function(pos) {\n- this.raise(pos != null ? pos : this.start, \"Unexpected token\");\n- };\n+ pp$9.unexpected = function(pos) {\n+ this.raise(pos != null ? pos : this.start, \"Unexpected token\");\n+ };\n \n- var DestructuringErrors = function DestructuringErrors() {\n- this.shorthandAssign =\n- this.trailingComma =\n- this.parenthesizedAssign =\n- this.parenthesizedBind =\n- this.doubleProto = -1;\n- };\n+ var DestructuringErrors = function DestructuringErrors() {\n+ this.shorthandAssign =\n+ this.trailingComma =\n+ this.parenthesizedAssign =\n+ this.parenthesizedBind =\n+ this.doubleProto = -1;\n+ };\n \n- pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n- if (!refDestructuringErrors) {\n- return\n- }\n- if (refDestructuringErrors.trailingComma > -1) {\n- this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\");\n- }\n- var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;\n- if (parens > -1) {\n- this.raiseRecoverable(parens, isAssign ? \"Assigning to rvalue\" : \"Parenthesized pattern\");\n- }\n- };\n+ pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n+ if (!refDestructuringErrors) {\n+ return\n+ }\n+ if (refDestructuringErrors.trailingComma > -1) {\n+ this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\");\n+ }\n+ var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;\n+ if (parens > -1) {\n+ this.raiseRecoverable(parens, isAssign ? \"Assigning to rvalue\" : \"Parenthesized pattern\");\n+ }\n+ };\n \n- pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n- if (!refDestructuringErrors) {\n- return false\n- }\n- var shorthandAssign = refDestructuringErrors.shorthandAssign;\n- var doubleProto = refDestructuringErrors.doubleProto;\n- if (!andThrow) {\n- return shorthandAssign >= 0 || doubleProto >= 0\n- }\n- if (shorthandAssign >= 0) {\n- this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\");\n- }\n- if (doubleProto >= 0) {\n- this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\");\n- }\n- };\n+ pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n+ if (!refDestructuringErrors) {\n+ return false\n+ }\n+ var shorthandAssign = refDestructuringErrors.shorthandAssign;\n+ var doubleProto = refDestructuringErrors.doubleProto;\n+ if (!andThrow) {\n+ return shorthandAssign >= 0 || doubleProto >= 0\n+ }\n+ if (shorthandAssign >= 0) {\n+ this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\");\n+ }\n+ if (doubleProto >= 0) {\n+ this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\");\n+ }\n+ };\n \n- pp$9.checkYieldAwaitInDefaultParams = function() {\n- if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) {\n- this.raise(this.yieldPos, \"Yield expression cannot be a default value\");\n- }\n- if (this.awaitPos) {\n- this.raise(this.awaitPos, \"Await expression cannot be a default value\");\n- }\n- };\n+ pp$9.checkYieldAwaitInDefaultParams = function() {\n+ if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) {\n+ this.raise(this.yieldPos, \"Yield expression cannot be a default value\");\n+ }\n+ if (this.awaitPos) {\n+ this.raise(this.awaitPos, \"Await expression cannot be a default value\");\n+ }\n+ };\n \n- pp$9.isSimpleAssignTarget = function(expr) {\n- if (expr.type === \"ParenthesizedExpression\") {\n- return this.isSimpleAssignTarget(expr.expression)\n- }\n- return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n- };\n+ pp$9.isSimpleAssignTarget = function(expr) {\n+ if (expr.type === \"ParenthesizedExpression\") {\n+ return this.isSimpleAssignTarget(expr.expression)\n+ }\n+ return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n+ };\n \n- var pp$8 = Parser.prototype;\n+ var pp$8 = Parser.prototype;\n \n- // ### Statement parsing\n+ // ### Statement parsing\n \n- // Parse a program. Initializes the parser, reads any number of\n- // statements, and wraps them in a Program node. Optionally takes a\n- // `program` argument. If present, the statements will be appended\n- // to its body instead of creating a new node.\n-\n- pp$8.parseTopLevel = function(node) {\n- var exports = Object.create(null);\n- if (!node.body) {\n- node.body = [];\n- }\n- while (this.type !== types$1.eof) {\n- var stmt = this.parseStatement(null, true, exports);\n- node.body.push(stmt);\n- }\n- if (this.inModule) {\n- for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) {\n- var name = list[i];\n+ // Parse a program. Initializes the parser, reads any number of\n+ // statements, and wraps them in a Program node. Optionally takes a\n+ // `program` argument. If present, the statements will be appended\n+ // to its body instead of creating a new node.\n \n- this.raiseRecoverable(this.undefinedExports[name].start, (\"Export '\" + name + \"' is not defined\"));\n+ pp$8.parseTopLevel = function(node) {\n+ var exports = Object.create(null);\n+ if (!node.body) {\n+ node.body = [];\n }\n- }\n- this.adaptDirectivePrologue(node.body);\n- this.next();\n- node.sourceType = this.options.sourceType;\n- return this.finishNode(node, \"Program\")\n- };\n+ while (this.type !== types$1.eof) {\n+ var stmt = this.parseStatement(null, true, exports);\n+ node.body.push(stmt);\n+ }\n+ if (this.inModule) {\n+ for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) {\n+ var name = list[i];\n \n- var loopLabel = {\n- kind: \"loop\"\n- },\n- switchLabel = {\n- kind: \"switch\"\n+ this.raiseRecoverable(this.undefinedExports[name].start, (\"Export '\" + name + \"' is not defined\"));\n+ }\n+ }\n+ this.adaptDirectivePrologue(node.body);\n+ this.next();\n+ node.sourceType = this.options.sourceType;\n+ return this.finishNode(node, \"Program\")\n };\n \n- pp$8.isLet = function(context) {\n- if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) {\n- return false\n- }\n- skipWhiteSpace.lastIndex = this.pos;\n- var skip = skipWhiteSpace.exec(this.input);\n- var next = this.pos + skip[0].length,\n- nextCh = this.input.charCodeAt(next);\n- // For ambiguous cases, determine if a LexicalDeclaration (or only a\n- // Statement) is allowed here. If context is not empty then only a Statement\n- // is allowed. However, `let [` is an explicit negative lookahead for\n- // ExpressionStatement, so special-case it first.\n- if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) {\n- return true\n- } // '[', '/', astral\n- if (context) {\n- return false\n- }\n+ var loopLabel = {\n+ kind: \"loop\"\n+ },\n+ switchLabel = {\n+ kind: \"switch\"\n+ };\n \n- if (nextCh === 123) {\n- return true\n- } // '{'\n- if (isIdentifierStart(nextCh, true)) {\n- var pos = next + 1;\n- while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) {\n- ++pos;\n+ pp$8.isLet = function(context) {\n+ if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) {\n+ return false\n }\n- if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) {\n+ skipWhiteSpace.lastIndex = this.pos;\n+ var skip = skipWhiteSpace.exec(this.input);\n+ var next = this.pos + skip[0].length,\n+ nextCh = this.input.charCodeAt(next);\n+ // For ambiguous cases, determine if a LexicalDeclaration (or only a\n+ // Statement) is allowed here. If context is not empty then only a Statement\n+ // is allowed. However, `let [` is an explicit negative lookahead for\n+ // ExpressionStatement, so special-case it first.\n+ if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) {\n return true\n+ } // '[', '/', astral\n+ if (context) {\n+ return false\n }\n- var ident = this.input.slice(next, pos);\n- if (!keywordRelationalOperator.test(ident)) {\n+\n+ if (nextCh === 123) {\n return true\n+ } // '{'\n+ if (isIdentifierStart(nextCh, true)) {\n+ var pos = next + 1;\n+ while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) {\n+ ++pos;\n+ }\n+ if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) {\n+ return true\n+ }\n+ var ident = this.input.slice(next, pos);\n+ if (!keywordRelationalOperator.test(ident)) {\n+ return true\n+ }\n }\n- }\n- return false\n- };\n-\n- // check 'async [no LineTerminator here] function'\n- // - 'async /*foo*/ function' is OK.\n- // - 'async /*\\n*/ function' is invalid.\n- pp$8.isAsyncFunction = function() {\n- if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\")) {\n return false\n- }\n+ };\n \n- skipWhiteSpace.lastIndex = this.pos;\n- var skip = skipWhiteSpace.exec(this.input);\n- var next = this.pos + skip[0].length,\n- after;\n- return !lineBreak.test(this.input.slice(this.pos, next)) &&\n- this.input.slice(next, next + 8) === \"function\" &&\n- (next + 8 === this.input.length ||\n- !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00))\n- };\n+ // check 'async [no LineTerminator here] function'\n+ // - 'async /*foo*/ function' is OK.\n+ // - 'async /*\\n*/ function' is invalid.\n+ pp$8.isAsyncFunction = function() {\n+ if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\")) {\n+ return false\n+ }\n \n- // Parse a single statement.\n- //\n- // If expecting a statement and finding a slash operator, parse a\n- // regular expression literal. This is to handle cases like\n- // `if (foo) /blah/.exec(foo)`, where looking at the previous token\n- // does not help.\n-\n- pp$8.parseStatement = function(context, topLevel, exports) {\n- var starttype = this.type,\n- node = this.startNode(),\n- kind;\n-\n- if (this.isLet(context)) {\n- starttype = types$1._var;\n- kind = \"let\";\n- }\n-\n- // Most types of statements are recognized by the keyword they\n- // start with. Many are trivial to parse, some require a bit of\n- // complexity.\n-\n- switch (starttype) {\n- case types$1._break:\n- case types$1._continue:\n- return this.parseBreakContinueStatement(node, starttype.keyword)\n- case types$1._debugger:\n- return this.parseDebuggerStatement(node)\n- case types$1._do:\n- return this.parseDoStatement(node)\n- case types$1._for:\n- return this.parseForStatement(node)\n- case types$1._function:\n- // Function as sole body of either an if statement or a labeled statement\n- // works, but not when it is part of a labeled statement that is the sole\n- // body of an if statement.\n- if ((context && (this.strict || context !== \"if\" && context !== \"label\")) && this.options.ecmaVersion >= 6) {\n- this.unexpected();\n- }\n- return this.parseFunctionStatement(node, false, !context)\n- case types$1._class:\n- if (context) {\n- this.unexpected();\n- }\n- return this.parseClass(node, true)\n- case types$1._if:\n- return this.parseIfStatement(node)\n- case types$1._return:\n- return this.parseReturnStatement(node)\n- case types$1._switch:\n- return this.parseSwitchStatement(node)\n- case types$1._throw:\n- return this.parseThrowStatement(node)\n- case types$1._try:\n- return this.parseTryStatement(node)\n- case types$1._const:\n- case types$1._var:\n- kind = kind || this.value;\n- if (context && kind !== \"var\") {\n- this.unexpected();\n- }\n- return this.parseVarStatement(node, kind)\n- case types$1._while:\n- return this.parseWhileStatement(node)\n- case types$1._with:\n- return this.parseWithStatement(node)\n- case types$1.braceL:\n- return this.parseBlock(true, node)\n- case types$1.semi:\n- return this.parseEmptyStatement(node)\n- case types$1._export:\n- case types$1._import:\n- if (this.options.ecmaVersion > 10 && starttype === types$1._import) {\n- skipWhiteSpace.lastIndex = this.pos;\n- var skip = skipWhiteSpace.exec(this.input);\n- var next = this.pos + skip[0].length,\n- nextCh = this.input.charCodeAt(next);\n- if (nextCh === 40 || nextCh === 46) // '(' or '.'\n- {\n- return this.parseExpressionStatement(node, this.parseExpression())\n- }\n- }\n+ skipWhiteSpace.lastIndex = this.pos;\n+ var skip = skipWhiteSpace.exec(this.input);\n+ var next = this.pos + skip[0].length,\n+ after;\n+ return !lineBreak.test(this.input.slice(this.pos, next)) &&\n+ this.input.slice(next, next + 8) === \"function\" &&\n+ (next + 8 === this.input.length ||\n+ !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00))\n+ };\n \n- if (!this.options.allowImportExportEverywhere) {\n- if (!topLevel) {\n- this.raise(this.start, \"'import' and 'export' may only appear at the top level\");\n- }\n- if (!this.inModule) {\n- this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\");\n+ // Parse a single statement.\n+ //\n+ // If expecting a statement and finding a slash operator, parse a\n+ // regular expression literal. This is to handle cases like\n+ // `if (foo) /blah/.exec(foo)`, where looking at the previous token\n+ // does not help.\n+\n+ pp$8.parseStatement = function(context, topLevel, exports) {\n+ var starttype = this.type,\n+ node = this.startNode(),\n+ kind;\n+\n+ if (this.isLet(context)) {\n+ starttype = types$1._var;\n+ kind = \"let\";\n+ }\n+\n+ // Most types of statements are recognized by the keyword they\n+ // start with. Many are trivial to parse, some require a bit of\n+ // complexity.\n+\n+ switch (starttype) {\n+ case types$1._break:\n+ case types$1._continue:\n+ return this.parseBreakContinueStatement(node, starttype.keyword)\n+ case types$1._debugger:\n+ return this.parseDebuggerStatement(node)\n+ case types$1._do:\n+ return this.parseDoStatement(node)\n+ case types$1._for:\n+ return this.parseForStatement(node)\n+ case types$1._function:\n+ // Function as sole body of either an if statement or a labeled statement\n+ // works, but not when it is part of a labeled statement that is the sole\n+ // body of an if statement.\n+ if ((context && (this.strict || context !== \"if\" && context !== \"label\")) && this.options.ecmaVersion >= 6) {\n+ this.unexpected();\n }\n- }\n- return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)\n-\n- // If the statement does not start with a statement keyword or a\n- // brace, it's an ExpressionStatement or LabeledStatement. We\n- // simply start parsing an expression, and afterwards, if the\n- // next token is a colon and the expression was a simple\n- // Identifier node, we switch to interpreting it as a label.\n- default:\n- if (this.isAsyncFunction()) {\n+ return this.parseFunctionStatement(node, false, !context)\n+ case types$1._class:\n if (context) {\n this.unexpected();\n }\n- this.next();\n- return this.parseFunctionStatement(node, true, !context)\n- }\n+ return this.parseClass(node, true)\n+ case types$1._if:\n+ return this.parseIfStatement(node)\n+ case types$1._return:\n+ return this.parseReturnStatement(node)\n+ case types$1._switch:\n+ return this.parseSwitchStatement(node)\n+ case types$1._throw:\n+ return this.parseThrowStatement(node)\n+ case types$1._try:\n+ return this.parseTryStatement(node)\n+ case types$1._const:\n+ case types$1._var:\n+ kind = kind || this.value;\n+ if (context && kind !== \"var\") {\n+ this.unexpected();\n+ }\n+ return this.parseVarStatement(node, kind)\n+ case types$1._while:\n+ return this.parseWhileStatement(node)\n+ case types$1._with:\n+ return this.parseWithStatement(node)\n+ case types$1.braceL:\n+ return this.parseBlock(true, node)\n+ case types$1.semi:\n+ return this.parseEmptyStatement(node)\n+ case types$1._export:\n+ case types$1._import:\n+ if (this.options.ecmaVersion > 10 && starttype === types$1._import) {\n+ skipWhiteSpace.lastIndex = this.pos;\n+ var skip = skipWhiteSpace.exec(this.input);\n+ var next = this.pos + skip[0].length,\n+ nextCh = this.input.charCodeAt(next);\n+ if (nextCh === 40 || nextCh === 46) // '(' or '.'\n+ {\n+ return this.parseExpressionStatement(node, this.parseExpression())\n+ }\n+ }\n \n- var maybeName = this.value,\n- expr = this.parseExpression();\n- if (starttype === types$1.name && expr.type === \"Identifier\" && this.eat(types$1.colon)) {\n- return this.parseLabeledStatement(node, maybeName, expr, context)\n- } else {\n- return this.parseExpressionStatement(node, expr)\n- }\n- }\n- };\n+ if (!this.options.allowImportExportEverywhere) {\n+ if (!topLevel) {\n+ this.raise(this.start, \"'import' and 'export' may only appear at the top level\");\n+ }\n+ if (!this.inModule) {\n+ this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\");\n+ }\n+ }\n+ return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)\n \n- pp$8.parseBreakContinueStatement = function(node, keyword) {\n- var isBreak = keyword === \"break\";\n- this.next();\n- if (this.eat(types$1.semi) || this.insertSemicolon()) {\n- node.label = null;\n- } else if (this.type !== types$1.name) {\n- this.unexpected();\n- } else {\n- node.label = this.parseIdent();\n- this.semicolon();\n- }\n+ // If the statement does not start with a statement keyword or a\n+ // brace, it's an ExpressionStatement or LabeledStatement. We\n+ // simply start parsing an expression, and afterwards, if the\n+ // next token is a colon and the expression was a simple\n+ // Identifier node, we switch to interpreting it as a label.\n+ default:\n+ if (this.isAsyncFunction()) {\n+ if (context) {\n+ this.unexpected();\n+ }\n+ this.next();\n+ return this.parseFunctionStatement(node, true, !context)\n+ }\n \n- // Verify that there is an actual destination to break or\n- // continue to.\n- var i = 0;\n- for (; i < this.labels.length; ++i) {\n- var lab = this.labels[i];\n- if (node.label == null || lab.name === node.label.name) {\n- if (lab.kind != null && (isBreak || lab.kind === \"loop\")) {\n- break\n- }\n- if (node.label && isBreak) {\n- break\n- }\n+ var maybeName = this.value,\n+ expr = this.parseExpression();\n+ if (starttype === types$1.name && expr.type === \"Identifier\" && this.eat(types$1.colon)) {\n+ return this.parseLabeledStatement(node, maybeName, expr, context)\n+ } else {\n+ return this.parseExpressionStatement(node, expr)\n+ }\n }\n- }\n- if (i === this.labels.length) {\n- this.raise(node.start, \"Unsyntactic \" + keyword);\n- }\n- return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n- };\n+ };\n \n- pp$8.parseDebuggerStatement = function(node) {\n- this.next();\n- this.semicolon();\n- return this.finishNode(node, \"DebuggerStatement\")\n- };\n+ pp$8.parseBreakContinueStatement = function(node, keyword) {\n+ var isBreak = keyword === \"break\";\n+ this.next();\n+ if (this.eat(types$1.semi) || this.insertSemicolon()) {\n+ node.label = null;\n+ } else if (this.type !== types$1.name) {\n+ this.unexpected();\n+ } else {\n+ node.label = this.parseIdent();\n+ this.semicolon();\n+ }\n \n- pp$8.parseDoStatement = function(node) {\n- this.next();\n- this.labels.push(loopLabel);\n- node.body = this.parseStatement(\"do\");\n- this.labels.pop();\n- this.expect(types$1._while);\n- node.test = this.parseParenExpression();\n- if (this.options.ecmaVersion >= 6) {\n- this.eat(types$1.semi);\n- } else {\n+ // Verify that there is an actual destination to break or\n+ // continue to.\n+ var i = 0;\n+ for (; i < this.labels.length; ++i) {\n+ var lab = this.labels[i];\n+ if (node.label == null || lab.name === node.label.name) {\n+ if (lab.kind != null && (isBreak || lab.kind === \"loop\")) {\n+ break\n+ }\n+ if (node.label && isBreak) {\n+ break\n+ }\n+ }\n+ }\n+ if (i === this.labels.length) {\n+ this.raise(node.start, \"Unsyntactic \" + keyword);\n+ }\n+ return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n+ };\n+\n+ pp$8.parseDebuggerStatement = function(node) {\n+ this.next();\n this.semicolon();\n- }\n- return this.finishNode(node, \"DoWhileStatement\")\n- };\n+ return this.finishNode(node, \"DebuggerStatement\")\n+ };\n \n- // Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n- // loop is non-trivial. Basically, we have to parse the init `var`\n- // statement or expression, disallowing the `in` operator (see\n- // the second parameter to `parseExpression`), and then check\n- // whether the next token is `in` or `of`. When there is no init\n- // part (semicolon immediately after the opening parenthesis), it\n- // is a regular `for` loop.\n-\n- pp$8.parseForStatement = function(node) {\n- this.next();\n- var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual(\"await\")) ? this.lastTokStart : -1;\n- this.labels.push(loopLabel);\n- this.enterScope(0);\n- this.expect(types$1.parenL);\n- if (this.type === types$1.semi) {\n- if (awaitAt > -1) {\n- this.unexpected(awaitAt);\n+ pp$8.parseDoStatement = function(node) {\n+ this.next();\n+ this.labels.push(loopLabel);\n+ node.body = this.parseStatement(\"do\");\n+ this.labels.pop();\n+ this.expect(types$1._while);\n+ node.test = this.parseParenExpression();\n+ if (this.options.ecmaVersion >= 6) {\n+ this.eat(types$1.semi);\n+ } else {\n+ this.semicolon();\n }\n- return this.parseFor(node, null)\n- }\n- var isLet = this.isLet();\n- if (this.type === types$1._var || this.type === types$1._const || isLet) {\n- var init$1 = this.startNode(),\n- kind = isLet ? \"let\" : this.value;\n+ return this.finishNode(node, \"DoWhileStatement\")\n+ };\n+\n+ // Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n+ // loop is non-trivial. Basically, we have to parse the init `var`\n+ // statement or expression, disallowing the `in` operator (see\n+ // the second parameter to `parseExpression`), and then check\n+ // whether the next token is `in` or `of`. When there is no init\n+ // part (semicolon immediately after the opening parenthesis), it\n+ // is a regular `for` loop.\n+\n+ pp$8.parseForStatement = function(node) {\n this.next();\n- this.parseVar(init$1, true, kind);\n- this.finishNode(init$1, \"VariableDeclaration\");\n- if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init$1.declarations.length === 1) {\n+ var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual(\"await\")) ? this.lastTokStart : -1;\n+ this.labels.push(loopLabel);\n+ this.enterScope(0);\n+ this.expect(types$1.parenL);\n+ if (this.type === types$1.semi) {\n+ if (awaitAt > -1) {\n+ this.unexpected(awaitAt);\n+ }\n+ return this.parseFor(node, null)\n+ }\n+ var isLet = this.isLet();\n+ if (this.type === types$1._var || this.type === types$1._const || isLet) {\n+ var init$1 = this.startNode(),\n+ kind = isLet ? \"let\" : this.value;\n+ this.next();\n+ this.parseVar(init$1, true, kind);\n+ this.finishNode(init$1, \"VariableDeclaration\");\n+ if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init$1.declarations.length === 1) {\n+ if (this.options.ecmaVersion >= 9) {\n+ if (this.type === types$1._in) {\n+ if (awaitAt > -1) {\n+ this.unexpected(awaitAt);\n+ }\n+ } else {\n+ node.await = awaitAt > -1;\n+ }\n+ }\n+ return this.parseForIn(node, init$1)\n+ }\n+ if (awaitAt > -1) {\n+ this.unexpected(awaitAt);\n+ }\n+ return this.parseFor(node, init$1)\n+ }\n+ var startsWithLet = this.isContextual(\"let\"),\n+ isForOf = false;\n+ var refDestructuringErrors = new DestructuringErrors;\n+ var init = this.parseExpression(awaitAt > -1 ? \"await\" : true, refDestructuringErrors);\n+ if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === types$1._in) {\n if (awaitAt > -1) {\n this.unexpected(awaitAt);\n }\n } else {\n node.await = awaitAt > -1;\n }\n }\n- return this.parseForIn(node, init$1)\n+ if (startsWithLet && isForOf) {\n+ this.raise(init.start, \"The left-hand side of a for-of loop may not start with 'let'.\");\n+ }\n+ this.toAssignable(init, false, refDestructuringErrors);\n+ this.checkLValPattern(init);\n+ return this.parseForIn(node, init)\n+ } else {\n+ this.checkExpressionErrors(refDestructuringErrors, true);\n }\n if (awaitAt > -1) {\n this.unexpected(awaitAt);\n }\n- return this.parseFor(node, init$1)\n- }\n- var startsWithLet = this.isContextual(\"let\"),\n- isForOf = false;\n- var refDestructuringErrors = new DestructuringErrors;\n- var init = this.parseExpression(awaitAt > -1 ? \"await\" : true, refDestructuringErrors);\n- if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n- if (this.options.ecmaVersion >= 9) {\n- if (this.type === types$1._in) {\n- if (awaitAt > -1) {\n- this.unexpected(awaitAt);\n+ return this.parseFor(node, init)\n+ };\n+\n+ pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n+ this.next();\n+ return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n+ };\n+\n+ pp$8.parseIfStatement = function(node) {\n+ this.next();\n+ node.test = this.parseParenExpression();\n+ // allow function declarations in branches, but only in non-strict mode\n+ node.consequent = this.parseStatement(\"if\");\n+ node.alternate = this.eat(types$1._else) ? this.parseStatement(\"if\") : null;\n+ return this.finishNode(node, \"IfStatement\")\n+ };\n+\n+ pp$8.parseReturnStatement = function(node) {\n+ if (!this.inFunction && !this.options.allowReturnOutsideFunction) {\n+ this.raise(this.start, \"'return' outside of function\");\n+ }\n+ this.next();\n+\n+ // In `return` (and `break`/`continue`), the keywords with\n+ // optional arguments, we eagerly look for a semicolon or the\n+ // possibility to insert one.\n+\n+ if (this.eat(types$1.semi) || this.insertSemicolon()) {\n+ node.argument = null;\n+ } else {\n+ node.argument = this.parseExpression();\n+ this.semicolon();\n+ }\n+ return this.finishNode(node, \"ReturnStatement\")\n+ };\n+\n+ pp$8.parseSwitchStatement = function(node) {\n+ this.next();\n+ node.discriminant = this.parseParenExpression();\n+ node.cases = [];\n+ this.expect(types$1.braceL);\n+ this.labels.push(switchLabel);\n+ this.enterScope(0);\n+\n+ // Statements under must be grouped (by label) in SwitchCase\n+ // nodes. `cur` is used to keep the node that we are currently\n+ // adding statements to.\n+\n+ var cur;\n+ for (var sawDefault = false; this.type !== types$1.braceR;) {\n+ if (this.type === types$1._case || this.type === types$1._default) {\n+ var isCase = this.type === types$1._case;\n+ if (cur) {\n+ this.finishNode(cur, \"SwitchCase\");\n }\n+ node.cases.push(cur = this.startNode());\n+ cur.consequent = [];\n+ this.next();\n+ if (isCase) {\n+ cur.test = this.parseExpression();\n+ } else {\n+ if (sawDefault) {\n+ this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\");\n+ }\n+ sawDefault = true;\n+ cur.test = null;\n+ }\n+ this.expect(types$1.colon);\n } else {\n- node.await = awaitAt > -1;\n+ if (!cur) {\n+ this.unexpected();\n+ }\n+ cur.consequent.push(this.parseStatement(null));\n }\n }\n- if (startsWithLet && isForOf) {\n- this.raise(init.start, \"The left-hand side of a for-of loop may not start with 'let'.\");\n+ this.exitScope();\n+ if (cur) {\n+ this.finishNode(cur, \"SwitchCase\");\n }\n- this.toAssignable(init, false, refDestructuringErrors);\n- this.checkLValPattern(init);\n- return this.parseForIn(node, init)\n- } else {\n- this.checkExpressionErrors(refDestructuringErrors, true);\n- }\n- if (awaitAt > -1) {\n- this.unexpected(awaitAt);\n- }\n- return this.parseFor(node, init)\n- };\n-\n- pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n- this.next();\n- return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n- };\n-\n- pp$8.parseIfStatement = function(node) {\n- this.next();\n- node.test = this.parseParenExpression();\n- // allow function declarations in branches, but only in non-strict mode\n- node.consequent = this.parseStatement(\"if\");\n- node.alternate = this.eat(types$1._else) ? this.parseStatement(\"if\") : null;\n- return this.finishNode(node, \"IfStatement\")\n- };\n+ this.next(); // Closing brace\n+ this.labels.pop();\n+ return this.finishNode(node, \"SwitchStatement\")\n+ };\n \n- pp$8.parseReturnStatement = function(node) {\n- if (!this.inFunction && !this.options.allowReturnOutsideFunction) {\n- this.raise(this.start, \"'return' outside of function\");\n- }\n- this.next();\n-\n- // In `return` (and `break`/`continue`), the keywords with\n- // optional arguments, we eagerly look for a semicolon or the\n- // possibility to insert one.\n-\n- if (this.eat(types$1.semi) || this.insertSemicolon()) {\n- node.argument = null;\n- } else {\n+ pp$8.parseThrowStatement = function(node) {\n+ this.next();\n+ if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) {\n+ this.raise(this.lastTokEnd, \"Illegal newline after throw\");\n+ }\n node.argument = this.parseExpression();\n this.semicolon();\n- }\n- return this.finishNode(node, \"ReturnStatement\")\n- };\n+ return this.finishNode(node, \"ThrowStatement\")\n+ };\n \n- pp$8.parseSwitchStatement = function(node) {\n- this.next();\n- node.discriminant = this.parseParenExpression();\n- node.cases = [];\n- this.expect(types$1.braceL);\n- this.labels.push(switchLabel);\n- this.enterScope(0);\n-\n- // Statements under must be grouped (by label) in SwitchCase\n- // nodes. `cur` is used to keep the node that we are currently\n- // adding statements to.\n-\n- var cur;\n- for (var sawDefault = false; this.type !== types$1.braceR;) {\n- if (this.type === types$1._case || this.type === types$1._default) {\n- var isCase = this.type === types$1._case;\n- if (cur) {\n- this.finishNode(cur, \"SwitchCase\");\n- }\n- node.cases.push(cur = this.startNode());\n- cur.consequent = [];\n+ // Reused empty array added for node fields that are always empty.\n+\n+ var empty$1 = [];\n+\n+ pp$8.parseTryStatement = function(node) {\n+ this.next();\n+ node.block = this.parseBlock();\n+ node.handler = null;\n+ if (this.type === types$1._catch) {\n+ var clause = this.startNode();\n this.next();\n- if (isCase) {\n- cur.test = this.parseExpression();\n+ if (this.eat(types$1.parenL)) {\n+ clause.param = this.parseBindingAtom();\n+ var simple = clause.param.type === \"Identifier\";\n+ this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);\n+ this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);\n+ this.expect(types$1.parenR);\n } else {\n- if (sawDefault) {\n- this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\");\n+ if (this.options.ecmaVersion < 10) {\n+ this.unexpected();\n }\n- sawDefault = true;\n- cur.test = null;\n+ clause.param = null;\n+ this.enterScope(0);\n }\n- this.expect(types$1.colon);\n- } else {\n- if (!cur) {\n- this.unexpected();\n- }\n- cur.consequent.push(this.parseStatement(null));\n+ clause.body = this.parseBlock(false);\n+ this.exitScope();\n+ node.handler = this.finishNode(clause, \"CatchClause\");\n+ }\n+ node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;\n+ if (!node.handler && !node.finalizer) {\n+ this.raise(node.start, \"Missing catch or finally clause\");\n }\n- }\n- this.exitScope();\n- if (cur) {\n- this.finishNode(cur, \"SwitchCase\");\n- }\n- this.next(); // Closing brace\n- this.labels.pop();\n- return this.finishNode(node, \"SwitchStatement\")\n- };\n+ return this.finishNode(node, \"TryStatement\")\n+ };\n \n- pp$8.parseThrowStatement = function(node) {\n- this.next();\n- if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) {\n- this.raise(this.lastTokEnd, \"Illegal newline after throw\");\n- }\n- node.argument = this.parseExpression();\n- this.semicolon();\n- return this.finishNode(node, \"ThrowStatement\")\n- };\n+ pp$8.parseVarStatement = function(node, kind) {\n+ this.next();\n+ this.parseVar(node, false, kind);\n+ this.semicolon();\n+ return this.finishNode(node, \"VariableDeclaration\")\n+ };\n \n- // Reused empty array added for node fields that are always empty.\n+ pp$8.parseWhileStatement = function(node) {\n+ this.next();\n+ node.test = this.parseParenExpression();\n+ this.labels.push(loopLabel);\n+ node.body = this.parseStatement(\"while\");\n+ this.labels.pop();\n+ return this.finishNode(node, \"WhileStatement\")\n+ };\n \n- var empty$1 = [];\n+ pp$8.parseWithStatement = function(node) {\n+ if (this.strict) {\n+ this.raise(this.start, \"'with' in strict mode\");\n+ }\n+ this.next();\n+ node.object = this.parseParenExpression();\n+ node.body = this.parseStatement(\"with\");\n+ return this.finishNode(node, \"WithStatement\")\n+ };\n \n- pp$8.parseTryStatement = function(node) {\n- this.next();\n- node.block = this.parseBlock();\n- node.handler = null;\n- if (this.type === types$1._catch) {\n- var clause = this.startNode();\n+ pp$8.parseEmptyStatement = function(node) {\n this.next();\n- if (this.eat(types$1.parenL)) {\n- clause.param = this.parseBindingAtom();\n- var simple = clause.param.type === \"Identifier\";\n- this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);\n- this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);\n- this.expect(types$1.parenR);\n- } else {\n- if (this.options.ecmaVersion < 10) {\n- this.unexpected();\n+ return this.finishNode(node, \"EmptyStatement\")\n+ };\n+\n+ pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {\n+ for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) {\n+ var label = list[i$1];\n+\n+ if (label.name === maybeName) {\n+ this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\");\n }\n- clause.param = null;\n- this.enterScope(0);\n }\n- clause.body = this.parseBlock(false);\n- this.exitScope();\n- node.handler = this.finishNode(clause, \"CatchClause\");\n- }\n- node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;\n- if (!node.handler && !node.finalizer) {\n- this.raise(node.start, \"Missing catch or finally clause\");\n- }\n- return this.finishNode(node, \"TryStatement\")\n- };\n-\n- pp$8.parseVarStatement = function(node, kind) {\n- this.next();\n- this.parseVar(node, false, kind);\n- this.semicolon();\n- return this.finishNode(node, \"VariableDeclaration\")\n- };\n-\n- pp$8.parseWhileStatement = function(node) {\n- this.next();\n- node.test = this.parseParenExpression();\n- this.labels.push(loopLabel);\n- node.body = this.parseStatement(\"while\");\n- this.labels.pop();\n- return this.finishNode(node, \"WhileStatement\")\n- };\n+ var kind = this.type.isLoop ? \"loop\" : this.type === types$1._switch ? \"switch\" : null;\n+ for (var i = this.labels.length - 1; i >= 0; i--) {\n+ var label$1 = this.labels[i];\n+ if (label$1.statementStart === node.start) {\n+ // Update information about previous labels on this node\n+ label$1.statementStart = this.start;\n+ label$1.kind = kind;\n+ } else {\n+ break\n+ }\n+ }\n+ this.labels.push({\n+ name: maybeName,\n+ kind: kind,\n+ statementStart: this.start\n+ });\n+ node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\");\n+ this.labels.pop();\n+ node.label = expr;\n+ return this.finishNode(node, \"LabeledStatement\")\n+ };\n \n- pp$8.parseWithStatement = function(node) {\n- if (this.strict) {\n- this.raise(this.start, \"'with' in strict mode\");\n- }\n- this.next();\n- node.object = this.parseParenExpression();\n- node.body = this.parseStatement(\"with\");\n- return this.finishNode(node, \"WithStatement\")\n- };\n+ pp$8.parseExpressionStatement = function(node, expr) {\n+ node.expression = expr;\n+ this.semicolon();\n+ return this.finishNode(node, \"ExpressionStatement\")\n+ };\n \n- pp$8.parseEmptyStatement = function(node) {\n- this.next();\n- return this.finishNode(node, \"EmptyStatement\")\n- };\n+ // Parse a semicolon-enclosed block of statements, handling `\"use\n+ // strict\"` declarations when `allowStrict` is true (used for\n+ // function bodies).\n+\n+ pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {\n+ if (createNewLexicalScope === void 0) createNewLexicalScope = true;\n+ if (node === void 0) node = this.startNode();\n \n- pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {\n- for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) {\n- var label = list[i$1];\n-\n- if (label.name === maybeName) {\n- this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\");\n+ node.body = [];\n+ this.expect(types$1.braceL);\n+ if (createNewLexicalScope) {\n+ this.enterScope(0);\n }\n- }\n- var kind = this.type.isLoop ? \"loop\" : this.type === types$1._switch ? \"switch\" : null;\n- for (var i = this.labels.length - 1; i >= 0; i--) {\n- var label$1 = this.labels[i];\n- if (label$1.statementStart === node.start) {\n- // Update information about previous labels on this node\n- label$1.statementStart = this.start;\n- label$1.kind = kind;\n- } else {\n- break\n+ while (this.type !== types$1.braceR) {\n+ var stmt = this.parseStatement(null);\n+ node.body.push(stmt);\n }\n- }\n- this.labels.push({\n- name: maybeName,\n- kind: kind,\n- statementStart: this.start\n- });\n- node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\");\n- this.labels.pop();\n- node.label = expr;\n- return this.finishNode(node, \"LabeledStatement\")\n- };\n-\n- pp$8.parseExpressionStatement = function(node, expr) {\n- node.expression = expr;\n- this.semicolon();\n- return this.finishNode(node, \"ExpressionStatement\")\n- };\n+ if (exitStrict) {\n+ this.strict = false;\n+ }\n+ this.next();\n+ if (createNewLexicalScope) {\n+ this.exitScope();\n+ }\n+ return this.finishNode(node, \"BlockStatement\")\n+ };\n \n- // Parse a semicolon-enclosed block of statements, handling `\"use\n- // strict\"` declarations when `allowStrict` is true (used for\n- // function bodies).\n-\n- pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {\n- if (createNewLexicalScope === void 0) createNewLexicalScope = true;\n- if (node === void 0) node = this.startNode();\n-\n- node.body = [];\n- this.expect(types$1.braceL);\n- if (createNewLexicalScope) {\n- this.enterScope(0);\n- }\n- while (this.type !== types$1.braceR) {\n- var stmt = this.parseStatement(null);\n- node.body.push(stmt);\n- }\n- if (exitStrict) {\n- this.strict = false;\n- }\n- this.next();\n- if (createNewLexicalScope) {\n+ // Parse a regular `for` loop. The disambiguation code in\n+ // `parseStatement` will already have parsed the init statement or\n+ // expression.\n+\n+ pp$8.parseFor = function(node, init) {\n+ node.init = init;\n+ this.expect(types$1.semi);\n+ node.test = this.type === types$1.semi ? null : this.parseExpression();\n+ this.expect(types$1.semi);\n+ node.update = this.type === types$1.parenR ? null : this.parseExpression();\n+ this.expect(types$1.parenR);\n+ node.body = this.parseStatement(\"for\");\n this.exitScope();\n- }\n- return this.finishNode(node, \"BlockStatement\")\n- };\n+ this.labels.pop();\n+ return this.finishNode(node, \"ForStatement\")\n+ };\n \n- // Parse a regular `for` loop. The disambiguation code in\n- // `parseStatement` will already have parsed the init statement or\n- // expression.\n-\n- pp$8.parseFor = function(node, init) {\n- node.init = init;\n- this.expect(types$1.semi);\n- node.test = this.type === types$1.semi ? null : this.parseExpression();\n- this.expect(types$1.semi);\n- node.update = this.type === types$1.parenR ? null : this.parseExpression();\n- this.expect(types$1.parenR);\n- node.body = this.parseStatement(\"for\");\n- this.exitScope();\n- this.labels.pop();\n- return this.finishNode(node, \"ForStatement\")\n- };\n+ // Parse a `for`/`in` and `for`/`of` loop, which are almost\n+ // same from parser's perspective.\n \n- // Parse a `for`/`in` and `for`/`of` loop, which are almost\n- // same from parser's perspective.\n+ pp$8.parseForIn = function(node, init) {\n+ var isForIn = this.type === types$1._in;\n+ this.next();\n \n- pp$8.parseForIn = function(node, init) {\n- var isForIn = this.type === types$1._in;\n- this.next();\n-\n- if (\n- init.type === \"VariableDeclaration\" &&\n- init.declarations[0].init != null &&\n- (\n- !isForIn ||\n- this.options.ecmaVersion < 8 ||\n- this.strict ||\n- init.kind !== \"var\" ||\n- init.declarations[0].id.type !== \"Identifier\"\n- )\n- ) {\n- this.raise(\n- init.start,\n- ((isForIn ? \"for-in\" : \"for-of\") + \" loop variable declaration may not have an initializer\")\n- );\n- }\n- node.left = init;\n- node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();\n- this.expect(types$1.parenR);\n- node.body = this.parseStatement(\"for\");\n- this.exitScope();\n- this.labels.pop();\n- return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\")\n- };\n+ if (\n+ init.type === \"VariableDeclaration\" &&\n+ init.declarations[0].init != null &&\n+ (\n+ !isForIn ||\n+ this.options.ecmaVersion < 8 ||\n+ this.strict ||\n+ init.kind !== \"var\" ||\n+ init.declarations[0].id.type !== \"Identifier\"\n+ )\n+ ) {\n+ this.raise(\n+ init.start,\n+ ((isForIn ? \"for-in\" : \"for-of\") + \" loop variable declaration may not have an initializer\")\n+ );\n+ }\n+ node.left = init;\n+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();\n+ this.expect(types$1.parenR);\n+ node.body = this.parseStatement(\"for\");\n+ this.exitScope();\n+ this.labels.pop();\n+ return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\")\n+ };\n \n- // Parse a list of variable declarations.\n+ // Parse a list of variable declarations.\n \n- pp$8.parseVar = function(node, isFor, kind) {\n- node.declarations = [];\n- node.kind = kind;\n- for (;;) {\n- var decl = this.startNode();\n- this.parseVarId(decl, kind);\n- if (this.eat(types$1.eq)) {\n- decl.init = this.parseMaybeAssign(isFor);\n- } else if (kind === \"const\" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n- this.unexpected();\n- } else if (decl.id.type !== \"Identifier\" && !(isFor && (this.type === types$1._in || this.isContextual(\"of\")))) {\n- this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\");\n- } else {\n- decl.init = null;\n- }\n- node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n- if (!this.eat(types$1.comma)) {\n- break\n+ pp$8.parseVar = function(node, isFor, kind) {\n+ node.declarations = [];\n+ node.kind = kind;\n+ for (;;) {\n+ var decl = this.startNode();\n+ this.parseVarId(decl, kind);\n+ if (this.eat(types$1.eq)) {\n+ decl.init = this.parseMaybeAssign(isFor);\n+ } else if (kind === \"const\" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n+ this.unexpected();\n+ } else if (decl.id.type !== \"Identifier\" && !(isFor && (this.type === types$1._in || this.isContextual(\"of\")))) {\n+ this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\");\n+ } else {\n+ decl.init = null;\n+ }\n+ node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n+ if (!this.eat(types$1.comma)) {\n+ break\n+ }\n }\n- }\n- return node\n- };\n+ return node\n+ };\n \n- pp$8.parseVarId = function(decl, kind) {\n- decl.id = this.parseBindingAtom();\n- this.checkLValPattern(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false);\n- };\n+ pp$8.parseVarId = function(decl, kind) {\n+ decl.id = this.parseBindingAtom();\n+ this.checkLValPattern(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false);\n+ };\n \n- var FUNC_STATEMENT = 1,\n- FUNC_HANGING_STATEMENT = 2,\n- FUNC_NULLABLE_ID = 4;\n-\n- // Parse a function declaration or literal (depending on the\n- // `statement & FUNC_STATEMENT`).\n-\n- // Remove `allowExpressionBody` for 7.0.0, as it is only called with false\n- pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {\n- this.initFunction(node);\n- if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {\n- if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) {\n- this.unexpected();\n+ var FUNC_STATEMENT = 1,\n+ FUNC_HANGING_STATEMENT = 2,\n+ FUNC_NULLABLE_ID = 4;\n+\n+ // Parse a function declaration or literal (depending on the\n+ // `statement & FUNC_STATEMENT`).\n+\n+ // Remove `allowExpressionBody` for 7.0.0, as it is only called with false\n+ pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {\n+ this.initFunction(node);\n+ if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {\n+ if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) {\n+ this.unexpected();\n+ }\n+ node.generator = this.eat(types$1.star);\n+ }\n+ if (this.options.ecmaVersion >= 8) {\n+ node.async = !!isAsync;\n }\n- node.generator = this.eat(types$1.star);\n- }\n- if (this.options.ecmaVersion >= 8) {\n- node.async = !!isAsync;\n- }\n \n- if (statement & FUNC_STATEMENT) {\n- node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();\n- if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n- // If it is a regular function declaration in sloppy mode, then it is\n- // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n- // mode depends on properties of the current scope (see\n- // treatFunctionsAsVar).\n- {\n- this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION);\n+ if (statement & FUNC_STATEMENT) {\n+ node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();\n+ if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n+ // If it is a regular function declaration in sloppy mode, then it is\n+ // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n+ // mode depends on properties of the current scope (see\n+ // treatFunctionsAsVar).\n+ {\n+ this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION);\n+ }\n }\n- }\n \n- var oldYieldPos = this.yieldPos,\n- oldAwaitPos = this.awaitPos,\n- oldAwaitIdentPos = this.awaitIdentPos;\n- this.yieldPos = 0;\n- this.awaitPos = 0;\n- this.awaitIdentPos = 0;\n- this.enterScope(functionFlags(node.async, node.generator));\n+ var oldYieldPos = this.yieldPos,\n+ oldAwaitPos = this.awaitPos,\n+ oldAwaitIdentPos = this.awaitIdentPos;\n+ this.yieldPos = 0;\n+ this.awaitPos = 0;\n+ this.awaitIdentPos = 0;\n+ this.enterScope(functionFlags(node.async, node.generator));\n \n- if (!(statement & FUNC_STATEMENT)) {\n- node.id = this.type === types$1.name ? this.parseIdent() : null;\n- }\n+ if (!(statement & FUNC_STATEMENT)) {\n+ node.id = this.type === types$1.name ? this.parseIdent() : null;\n+ }\n \n- this.parseFunctionParams(node);\n- this.parseFunctionBody(node, allowExpressionBody, false, forInit);\n+ this.parseFunctionParams(node);\n+ this.parseFunctionBody(node, allowExpressionBody, false, forInit);\n \n- this.yieldPos = oldYieldPos;\n- this.awaitPos = oldAwaitPos;\n- this.awaitIdentPos = oldAwaitIdentPos;\n- return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n- };\n+ this.yieldPos = oldYieldPos;\n+ this.awaitPos = oldAwaitPos;\n+ this.awaitIdentPos = oldAwaitIdentPos;\n+ return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n+ };\n \n- pp$8.parseFunctionParams = function(node) {\n- this.expect(types$1.parenL);\n- node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n- this.checkYieldAwaitInDefaultParams();\n- };\n+ pp$8.parseFunctionParams = function(node) {\n+ this.expect(types$1.parenL);\n+ node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n+ this.checkYieldAwaitInDefaultParams();\n+ };\n \n- // Parse a class declaration or literal (depending on the\n- // `isStatement` parameter).\n+ // Parse a class declaration or literal (depending on the\n+ // `isStatement` parameter).\n \n- pp$8.parseClass = function(node, isStatement) {\n- this.next();\n+ pp$8.parseClass = function(node, isStatement) {\n+ this.next();\n \n- // ecma-262 14.6 Class Definitions\n- // A class definition is always strict mode code.\n- var oldStrict = this.strict;\n- this.strict = true;\n-\n- this.parseClassId(node, isStatement);\n- this.parseClassSuper(node);\n- var privateNameMap = this.enterClassBody();\n- var classBody = this.startNode();\n- var hadConstructor = false;\n- classBody.body = [];\n- this.expect(types$1.braceL);\n- while (this.type !== types$1.braceR) {\n- var element = this.parseClassElement(node.superClass !== null);\n- if (element) {\n- classBody.body.push(element);\n- if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n- if (hadConstructor) {\n- this.raise(element.start, \"Duplicate constructor in the same class\");\n- }\n- hadConstructor = true;\n- } else if (element.key && element.key.type === \"PrivateIdentifier\" && isPrivateNameConflicted(privateNameMap, element)) {\n- this.raiseRecoverable(element.key.start, (\"Identifier '#\" + (element.key.name) + \"' has already been declared\"));\n+ // ecma-262 14.6 Class Definitions\n+ // A class definition is always strict mode code.\n+ var oldStrict = this.strict;\n+ this.strict = true;\n+\n+ this.parseClassId(node, isStatement);\n+ this.parseClassSuper(node);\n+ var privateNameMap = this.enterClassBody();\n+ var classBody = this.startNode();\n+ var hadConstructor = false;\n+ classBody.body = [];\n+ this.expect(types$1.braceL);\n+ while (this.type !== types$1.braceR) {\n+ var element = this.parseClassElement(node.superClass !== null);\n+ if (element) {\n+ classBody.body.push(element);\n+ if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n+ if (hadConstructor) {\n+ this.raise(element.start, \"Duplicate constructor in the same class\");\n+ }\n+ hadConstructor = true;\n+ } else if (element.key && element.key.type === \"PrivateIdentifier\" && isPrivateNameConflicted(privateNameMap, element)) {\n+ this.raiseRecoverable(element.key.start, (\"Identifier '#\" + (element.key.name) + \"' has already been declared\"));\n+ }\n }\n }\n- }\n- this.strict = oldStrict;\n- this.next();\n- node.body = this.finishNode(classBody, \"ClassBody\");\n- this.exitClassBody();\n- return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n- };\n+ this.strict = oldStrict;\n+ this.next();\n+ node.body = this.finishNode(classBody, \"ClassBody\");\n+ this.exitClassBody();\n+ return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n+ };\n \n- pp$8.parseClassElement = function(constructorAllowsSuper) {\n- if (this.eat(types$1.semi)) {\n- return null\n- }\n-\n- var ecmaVersion = this.options.ecmaVersion;\n- var node = this.startNode();\n- var keyName = \"\";\n- var isGenerator = false;\n- var isAsync = false;\n- var kind = \"method\";\n- var isStatic = false;\n-\n- if (this.eatContextual(\"static\")) {\n- // Parse static init block\n- if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {\n- this.parseClassStaticBlock(node);\n- return node\n- }\n- if (this.isClassElementNameStart() || this.type === types$1.star) {\n- isStatic = true;\n- } else {\n- keyName = \"static\";\n+ pp$8.parseClassElement = function(constructorAllowsSuper) {\n+ if (this.eat(types$1.semi)) {\n+ return null\n }\n- }\n- node.static = isStatic;\n- if (!keyName && ecmaVersion >= 8 && this.eatContextual(\"async\")) {\n- if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {\n- isAsync = true;\n- } else {\n- keyName = \"async\";\n+\n+ var ecmaVersion = this.options.ecmaVersion;\n+ var node = this.startNode();\n+ var keyName = \"\";\n+ var isGenerator = false;\n+ var isAsync = false;\n+ var kind = \"method\";\n+ var isStatic = false;\n+\n+ if (this.eatContextual(\"static\")) {\n+ // Parse static init block\n+ if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {\n+ this.parseClassStaticBlock(node);\n+ return node\n+ }\n+ if (this.isClassElementNameStart() || this.type === types$1.star) {\n+ isStatic = true;\n+ } else {\n+ keyName = \"static\";\n+ }\n }\n- }\n- if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {\n- isGenerator = true;\n- }\n- if (!keyName && !isAsync && !isGenerator) {\n- var lastValue = this.value;\n- if (this.eatContextual(\"get\") || this.eatContextual(\"set\")) {\n- if (this.isClassElementNameStart()) {\n- kind = lastValue;\n+ node.static = isStatic;\n+ if (!keyName && ecmaVersion >= 8 && this.eatContextual(\"async\")) {\n+ if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {\n+ isAsync = true;\n } else {\n- keyName = lastValue;\n+ keyName = \"async\";\n+ }\n+ }\n+ if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {\n+ isGenerator = true;\n+ }\n+ if (!keyName && !isAsync && !isGenerator) {\n+ var lastValue = this.value;\n+ if (this.eatContextual(\"get\") || this.eatContextual(\"set\")) {\n+ if (this.isClassElementNameStart()) {\n+ kind = lastValue;\n+ } else {\n+ keyName = lastValue;\n+ }\n }\n }\n- }\n-\n- // Parse element name\n- if (keyName) {\n- // 'async', 'get', 'set', or 'static' were not a keyword contextually.\n- // The last token is any of those. Make it the element name.\n- node.computed = false;\n- node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);\n- node.key.name = keyName;\n- this.finishNode(node.key, \"Identifier\");\n- } else {\n- this.parseClassElementName(node);\n- }\n \n- // Parse element value\n- if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== \"method\" || isGenerator || isAsync) {\n- var isConstructor = !node.static && checkKeyName(node, \"constructor\");\n- var allowsDirectSuper = isConstructor && constructorAllowsSuper;\n- // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.\n- if (isConstructor && kind !== \"method\") {\n- this.raise(node.key.start, \"Constructor can't have get/set modifier\");\n+ // Parse element name\n+ if (keyName) {\n+ // 'async', 'get', 'set', or 'static' were not a keyword contextually.\n+ // The last token is any of those. Make it the element name.\n+ node.computed = false;\n+ node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);\n+ node.key.name = keyName;\n+ this.finishNode(node.key, \"Identifier\");\n+ } else {\n+ this.parseClassElementName(node);\n }\n- node.kind = isConstructor ? \"constructor\" : kind;\n- this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);\n- } else {\n- this.parseClassField(node);\n- }\n \n- return node\n- };\n+ // Parse element value\n+ if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== \"method\" || isGenerator || isAsync) {\n+ var isConstructor = !node.static && checkKeyName(node, \"constructor\");\n+ var allowsDirectSuper = isConstructor && constructorAllowsSuper;\n+ // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.\n+ if (isConstructor && kind !== \"method\") {\n+ this.raise(node.key.start, \"Constructor can't have get/set modifier\");\n+ }\n+ node.kind = isConstructor ? \"constructor\" : kind;\n+ this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);\n+ } else {\n+ this.parseClassField(node);\n+ }\n \n- pp$8.isClassElementNameStart = function() {\n- return (\n- this.type === types$1.name ||\n- this.type === types$1.privateId ||\n- this.type === types$1.num ||\n- this.type === types$1.string ||\n- this.type === types$1.bracketL ||\n- this.type.keyword\n- )\n- };\n+ return node\n+ };\n \n- pp$8.parseClassElementName = function(element) {\n- if (this.type === types$1.privateId) {\n- if (this.value === \"constructor\") {\n- this.raise(this.start, \"Classes can't have an element named '#constructor'\");\n- }\n- element.computed = false;\n- element.key = this.parsePrivateIdent();\n- } else {\n- this.parsePropertyName(element);\n- }\n- };\n+ pp$8.isClassElementNameStart = function() {\n+ return (\n+ this.type === types$1.name ||\n+ this.type === types$1.privateId ||\n+ this.type === types$1.num ||\n+ this.type === types$1.string ||\n+ this.type === types$1.bracketL ||\n+ this.type.keyword\n+ )\n+ };\n \n- pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n- // Check key and flags\n- var key = method.key;\n- if (method.kind === \"constructor\") {\n- if (isGenerator) {\n- this.raise(key.start, \"Constructor can't be a generator\");\n- }\n- if (isAsync) {\n- this.raise(key.start, \"Constructor can't be an async method\");\n+ pp$8.parseClassElementName = function(element) {\n+ if (this.type === types$1.privateId) {\n+ if (this.value === \"constructor\") {\n+ this.raise(this.start, \"Classes can't have an element named '#constructor'\");\n+ }\n+ element.computed = false;\n+ element.key = this.parsePrivateIdent();\n+ } else {\n+ this.parsePropertyName(element);\n }\n- } else if (method.static && checkKeyName(method, \"prototype\")) {\n- this.raise(key.start, \"Classes may not have a static property named prototype\");\n- }\n+ };\n \n- // Parse value\n- var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);\n+ pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n+ // Check key and flags\n+ var key = method.key;\n+ if (method.kind === \"constructor\") {\n+ if (isGenerator) {\n+ this.raise(key.start, \"Constructor can't be a generator\");\n+ }\n+ if (isAsync) {\n+ this.raise(key.start, \"Constructor can't be an async method\");\n+ }\n+ } else if (method.static && checkKeyName(method, \"prototype\")) {\n+ this.raise(key.start, \"Classes may not have a static property named prototype\");\n+ }\n \n- // Check value\n- if (method.kind === \"get\" && value.params.length !== 0) {\n- this.raiseRecoverable(value.start, \"getter should have no params\");\n- }\n- if (method.kind === \"set\" && value.params.length !== 1) {\n- this.raiseRecoverable(value.start, \"setter should have exactly one param\");\n- }\n- if (method.kind === \"set\" && value.params[0].type === \"RestElement\") {\n- this.raiseRecoverable(value.params[0].start, \"Setter cannot use rest params\");\n- }\n+ // Parse value\n+ var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);\n \n- return this.finishNode(method, \"MethodDefinition\")\n- };\n+ // Check value\n+ if (method.kind === \"get\" && value.params.length !== 0) {\n+ this.raiseRecoverable(value.start, \"getter should have no params\");\n+ }\n+ if (method.kind === \"set\" && value.params.length !== 1) {\n+ this.raiseRecoverable(value.start, \"setter should have exactly one param\");\n+ }\n+ if (method.kind === \"set\" && value.params[0].type === \"RestElement\") {\n+ this.raiseRecoverable(value.params[0].start, \"Setter cannot use rest params\");\n+ }\n \n- pp$8.parseClassField = function(field) {\n- if (checkKeyName(field, \"constructor\")) {\n- this.raise(field.key.start, \"Classes can't have a field named 'constructor'\");\n- } else if (field.static && checkKeyName(field, \"prototype\")) {\n- this.raise(field.key.start, \"Classes can't have a static field named 'prototype'\");\n- }\n-\n- if (this.eat(types$1.eq)) {\n- // To raise SyntaxError if 'arguments' exists in the initializer.\n- var scope = this.currentThisScope();\n- var inClassFieldInit = scope.inClassFieldInit;\n- scope.inClassFieldInit = true;\n- field.value = this.parseMaybeAssign();\n- scope.inClassFieldInit = inClassFieldInit;\n- } else {\n- field.value = null;\n- }\n- this.semicolon();\n+ return this.finishNode(method, \"MethodDefinition\")\n+ };\n \n- return this.finishNode(field, \"PropertyDefinition\")\n- };\n+ pp$8.parseClassField = function(field) {\n+ if (checkKeyName(field, \"constructor\")) {\n+ this.raise(field.key.start, \"Classes can't have a field named 'constructor'\");\n+ } else if (field.static && checkKeyName(field, \"prototype\")) {\n+ this.raise(field.key.start, \"Classes can't have a static field named 'prototype'\");\n+ }\n \n- pp$8.parseClassStaticBlock = function(node) {\n- node.body = [];\n+ if (this.eat(types$1.eq)) {\n+ // To raise SyntaxError if 'arguments' exists in the initializer.\n+ var scope = this.currentThisScope();\n+ var inClassFieldInit = scope.inClassFieldInit;\n+ scope.inClassFieldInit = true;\n+ field.value = this.parseMaybeAssign();\n+ scope.inClassFieldInit = inClassFieldInit;\n+ } else {\n+ field.value = null;\n+ }\n+ this.semicolon();\n \n- var oldLabels = this.labels;\n- this.labels = [];\n- this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);\n- while (this.type !== types$1.braceR) {\n- var stmt = this.parseStatement(null);\n- node.body.push(stmt);\n- }\n- this.next();\n- this.exitScope();\n- this.labels = oldLabels;\n+ return this.finishNode(field, \"PropertyDefinition\")\n+ };\n \n- return this.finishNode(node, \"StaticBlock\")\n- };\n+ pp$8.parseClassStaticBlock = function(node) {\n+ node.body = [];\n \n- pp$8.parseClassId = function(node, isStatement) {\n- if (this.type === types$1.name) {\n- node.id = this.parseIdent();\n- if (isStatement) {\n- this.checkLValSimple(node.id, BIND_LEXICAL, false);\n- }\n- } else {\n- if (isStatement === true) {\n- this.unexpected();\n+ var oldLabels = this.labels;\n+ this.labels = [];\n+ this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);\n+ while (this.type !== types$1.braceR) {\n+ var stmt = this.parseStatement(null);\n+ node.body.push(stmt);\n }\n- node.id = null;\n- }\n- };\n-\n- pp$8.parseClassSuper = function(node) {\n- node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null;\n- };\n+ this.next();\n+ this.exitScope();\n+ this.labels = oldLabels;\n \n- pp$8.enterClassBody = function() {\n- var element = {\n- declared: Object.create(null),\n- used: []\n+ return this.finishNode(node, \"StaticBlock\")\n };\n- this.privateNameStack.push(element);\n- return element.declared\n- };\n \n- pp$8.exitClassBody = function() {\n- var ref = this.privateNameStack.pop();\n- var declared = ref.declared;\n- var used = ref.used;\n- var len = this.privateNameStack.length;\n- var parent = len === 0 ? null : this.privateNameStack[len - 1];\n- for (var i = 0; i < used.length; ++i) {\n- var id = used[i];\n- if (!hasOwn(declared, id.name)) {\n- if (parent) {\n- parent.used.push(id);\n- } else {\n- this.raiseRecoverable(id.start, (\"Private field '#\" + (id.name) + \"' must be declared in an enclosing class\"));\n+ pp$8.parseClassId = function(node, isStatement) {\n+ if (this.type === types$1.name) {\n+ node.id = this.parseIdent();\n+ if (isStatement) {\n+ this.checkLValSimple(node.id, BIND_LEXICAL, false);\n+ }\n+ } else {\n+ if (isStatement === true) {\n+ this.unexpected();\n }\n+ node.id = null;\n }\n- }\n- };\n-\n- function isPrivateNameConflicted(privateNameMap, element) {\n- var name = element.key.name;\n- var curr = privateNameMap[name];\n-\n- var next = \"true\";\n- if (element.type === \"MethodDefinition\" && (element.kind === \"get\" || element.kind === \"set\")) {\n- next = (element.static ? \"s\" : \"i\") + element.kind;\n- }\n-\n- // `class { get #a(){}; static set #a(_){} }` is also conflict.\n- if (\n- curr === \"iget\" && next === \"iset\" ||\n- curr === \"iset\" && next === \"iget\" ||\n- curr === \"sget\" && next === \"sset\" ||\n- curr === \"sset\" && next === \"sget\"\n- ) {\n- privateNameMap[name] = \"true\";\n- return false\n- } else if (!curr) {\n- privateNameMap[name] = next;\n- return false\n- } else {\n- return true\n- }\n- }\n+ };\n \n- function checkKeyName(node, name) {\n- var computed = node.computed;\n- var key = node.key;\n- return !computed && (\n- key.type === \"Identifier\" && key.name === name ||\n- key.type === \"Literal\" && key.value === name\n- )\n- }\n+ pp$8.parseClassSuper = function(node) {\n+ node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null;\n+ };\n \n- // Parses module export declaration.\n+ pp$8.enterClassBody = function() {\n+ var element = {\n+ declared: Object.create(null),\n+ used: []\n+ };\n+ this.privateNameStack.push(element);\n+ return element.declared\n+ };\n \n- pp$8.parseExport = function(node, exports) {\n- this.next();\n- // export * from '...'\n- if (this.eat(types$1.star)) {\n- if (this.options.ecmaVersion >= 11) {\n- if (this.eatContextual(\"as\")) {\n- node.exported = this.parseModuleExportName();\n- this.checkExport(exports, node.exported, this.lastTokStart);\n- } else {\n- node.exported = null;\n+ pp$8.exitClassBody = function() {\n+ var ref = this.privateNameStack.pop();\n+ var declared = ref.declared;\n+ var used = ref.used;\n+ var len = this.privateNameStack.length;\n+ var parent = len === 0 ? null : this.privateNameStack[len - 1];\n+ for (var i = 0; i < used.length; ++i) {\n+ var id = used[i];\n+ if (!hasOwn(declared, id.name)) {\n+ if (parent) {\n+ parent.used.push(id);\n+ } else {\n+ this.raiseRecoverable(id.start, (\"Private field '#\" + (id.name) + \"' must be declared in an enclosing class\"));\n+ }\n }\n }\n- this.expectContextual(\"from\");\n- if (this.type !== types$1.string) {\n- this.unexpected();\n+ };\n+\n+ function isPrivateNameConflicted(privateNameMap, element) {\n+ var name = element.key.name;\n+ var curr = privateNameMap[name];\n+\n+ var next = \"true\";\n+ if (element.type === \"MethodDefinition\" && (element.kind === \"get\" || element.kind === \"set\")) {\n+ next = (element.static ? \"s\" : \"i\") + element.kind;\n }\n- node.source = this.parseExprAtom();\n- this.semicolon();\n- return this.finishNode(node, \"ExportAllDeclaration\")\n- }\n- if (this.eat(types$1._default)) { // export default ...\n- this.checkExport(exports, \"default\", this.lastTokStart);\n- var isAsync;\n- if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {\n- var fNode = this.startNode();\n- this.next();\n- if (isAsync) {\n- this.next();\n- }\n- node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);\n- } else if (this.type === types$1._class) {\n- var cNode = this.startNode();\n- node.declaration = this.parseClass(cNode, \"nullableID\");\n+\n+ // `class { get #a(){}; static set #a(_){} }` is also conflict.\n+ if (\n+ curr === \"iget\" && next === \"iset\" ||\n+ curr === \"iset\" && next === \"iget\" ||\n+ curr === \"sget\" && next === \"sset\" ||\n+ curr === \"sset\" && next === \"sget\"\n+ ) {\n+ privateNameMap[name] = \"true\";\n+ return false\n+ } else if (!curr) {\n+ privateNameMap[name] = next;\n+ return false\n } else {\n- node.declaration = this.parseMaybeAssign();\n- this.semicolon();\n+ return true\n }\n- return this.finishNode(node, \"ExportDefaultDeclaration\")\n }\n- // export var|const|let|function|class ...\n- if (this.shouldParseExportStatement()) {\n- node.declaration = this.parseStatement(null);\n- if (node.declaration.type === \"VariableDeclaration\") {\n- this.checkVariableExport(exports, node.declaration.declarations);\n- } else {\n- this.checkExport(exports, node.declaration.id, node.declaration.id.start);\n- }\n- node.specifiers = [];\n- node.source = null;\n- } else { // export { x, y as z } [from '...']\n- node.declaration = null;\n- node.specifiers = this.parseExportSpecifiers(exports);\n- if (this.eatContextual(\"from\")) {\n+\n+ function checkKeyName(node, name) {\n+ var computed = node.computed;\n+ var key = node.key;\n+ return !computed && (\n+ key.type === \"Identifier\" && key.name === name ||\n+ key.type === \"Literal\" && key.value === name\n+ )\n+ }\n+\n+ // Parses module export declaration.\n+\n+ pp$8.parseExport = function(node, exports) {\n+ this.next();\n+ // export * from '...'\n+ if (this.eat(types$1.star)) {\n+ if (this.options.ecmaVersion >= 11) {\n+ if (this.eatContextual(\"as\")) {\n+ node.exported = this.parseModuleExportName();\n+ this.checkExport(exports, node.exported, this.lastTokStart);\n+ } else {\n+ node.exported = null;\n+ }\n+ }\n+ this.expectContextual(\"from\");\n if (this.type !== types$1.string) {\n this.unexpected();\n }\n node.source = this.parseExprAtom();\n- } else {\n- for (var i = 0, list = node.specifiers; i < list.length; i += 1) {\n- // check for keywords used as local names\n- var spec = list[i];\n-\n- this.checkUnreserved(spec.local);\n- // check if export is defined\n- this.checkLocalExport(spec.local);\n-\n- if (spec.local.type === \"Literal\") {\n- this.raise(spec.local.start, \"A string literal cannot be used as an exported binding without `from`.\");\n+ this.semicolon();\n+ return this.finishNode(node, \"ExportAllDeclaration\")\n+ }\n+ if (this.eat(types$1._default)) { // export default ...\n+ this.checkExport(exports, \"default\", this.lastTokStart);\n+ var isAsync;\n+ if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {\n+ var fNode = this.startNode();\n+ this.next();\n+ if (isAsync) {\n+ this.next();\n }\n+ node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);\n+ } else if (this.type === types$1._class) {\n+ var cNode = this.startNode();\n+ node.declaration = this.parseClass(cNode, \"nullableID\");\n+ } else {\n+ node.declaration = this.parseMaybeAssign();\n+ this.semicolon();\n }\n-\n+ return this.finishNode(node, \"ExportDefaultDeclaration\")\n+ }\n+ // export var|const|let|function|class ...\n+ if (this.shouldParseExportStatement()) {\n+ node.declaration = this.parseStatement(null);\n+ if (node.declaration.type === \"VariableDeclaration\") {\n+ this.checkVariableExport(exports, node.declaration.declarations);\n+ } else {\n+ this.checkExport(exports, node.declaration.id, node.declaration.id.start);\n+ }\n+ node.specifiers = [];\n node.source = null;\n+ } else { // export { x, y as z } [from '...']\n+ node.declaration = null;\n+ node.specifiers = this.parseExportSpecifiers(exports);\n+ if (this.eatContextual(\"from\")) {\n+ if (this.type !== types$1.string) {\n+ this.unexpected();\n+ }\n+ node.source = this.parseExprAtom();\n+ } else {\n+ for (var i = 0, list = node.specifiers; i < list.length; i += 1) {\n+ // check for keywords used as local names\n+ var spec = list[i];\n+\n+ this.checkUnreserved(spec.local);\n+ // check if export is defined\n+ this.checkLocalExport(spec.local);\n+\n+ if (spec.local.type === \"Literal\") {\n+ this.raise(spec.local.start, \"A string literal cannot be used as an exported binding without `from`.\");\n+ }\n+ }\n+\n+ node.source = null;\n+ }\n+ this.semicolon();\n }\n- this.semicolon();\n- }\n- return this.finishNode(node, \"ExportNamedDeclaration\")\n- };\n+ return this.finishNode(node, \"ExportNamedDeclaration\")\n+ };\n \n- pp$8.checkExport = function(exports, name, pos) {\n- if (!exports) {\n- return\n- }\n- if (typeof name !== \"string\") {\n- name = name.type === \"Identifier\" ? name.name : name.value;\n- }\n- if (hasOwn(exports, name)) {\n- this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\");\n- }\n- exports[name] = true;\n- };\n+ pp$8.checkExport = function(exports, name, pos) {\n+ if (!exports) {\n+ return\n+ }\n+ if (typeof name !== \"string\") {\n+ name = name.type === \"Identifier\" ? name.name : name.value;\n+ }\n+ if (hasOwn(exports, name)) {\n+ this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\");\n+ }\n+ exports[name] = true;\n+ };\n \n- pp$8.checkPatternExport = function(exports, pat) {\n- var type = pat.type;\n- if (type === \"Identifier\") {\n- this.checkExport(exports, pat, pat.start);\n- } else if (type === \"ObjectPattern\") {\n- for (var i = 0, list = pat.properties; i < list.length; i += 1) {\n- var prop = list[i];\n-\n- this.checkPatternExport(exports, prop);\n- }\n- } else if (type === \"ArrayPattern\") {\n- for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {\n- var elt = list$1[i$1];\n+ pp$8.checkPatternExport = function(exports, pat) {\n+ var type = pat.type;\n+ if (type === \"Identifier\") {\n+ this.checkExport(exports, pat, pat.start);\n+ } else if (type === \"ObjectPattern\") {\n+ for (var i = 0, list = pat.properties; i < list.length; i += 1) {\n+ var prop = list[i];\n \n- if (elt) {\n- this.checkPatternExport(exports, elt);\n+ this.checkPatternExport(exports, prop);\n }\n+ } else if (type === \"ArrayPattern\") {\n+ for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {\n+ var elt = list$1[i$1];\n+\n+ if (elt) {\n+ this.checkPatternExport(exports, elt);\n+ }\n+ }\n+ } else if (type === \"Property\") {\n+ this.checkPatternExport(exports, pat.value);\n+ } else if (type === \"AssignmentPattern\") {\n+ this.checkPatternExport(exports, pat.left);\n+ } else if (type === \"RestElement\") {\n+ this.checkPatternExport(exports, pat.argument);\n+ } else if (type === \"ParenthesizedExpression\") {\n+ this.checkPatternExport(exports, pat.expression);\n }\n- } else if (type === \"Property\") {\n- this.checkPatternExport(exports, pat.value);\n- } else if (type === \"AssignmentPattern\") {\n- this.checkPatternExport(exports, pat.left);\n- } else if (type === \"RestElement\") {\n- this.checkPatternExport(exports, pat.argument);\n- } else if (type === \"ParenthesizedExpression\") {\n- this.checkPatternExport(exports, pat.expression);\n- }\n- };\n+ };\n \n- pp$8.checkVariableExport = function(exports, decls) {\n- if (!exports) {\n- return\n- }\n- for (var i = 0, list = decls; i < list.length; i += 1) {\n- var decl = list[i];\n+ pp$8.checkVariableExport = function(exports, decls) {\n+ if (!exports) {\n+ return\n+ }\n+ for (var i = 0, list = decls; i < list.length; i += 1) {\n+ var decl = list[i];\n \n- this.checkPatternExport(exports, decl.id);\n- }\n- };\n+ this.checkPatternExport(exports, decl.id);\n+ }\n+ };\n \n- pp$8.shouldParseExportStatement = function() {\n- return this.type.keyword === \"var\" ||\n- this.type.keyword === \"const\" ||\n- this.type.keyword === \"class\" ||\n- this.type.keyword === \"function\" ||\n- this.isLet() ||\n- this.isAsyncFunction()\n- };\n+ pp$8.shouldParseExportStatement = function() {\n+ return this.type.keyword === \"var\" ||\n+ this.type.keyword === \"const\" ||\n+ this.type.keyword === \"class\" ||\n+ this.type.keyword === \"function\" ||\n+ this.isLet() ||\n+ this.isAsyncFunction()\n+ };\n \n- // Parses a comma-separated list of module exports.\n+ // Parses a comma-separated list of module exports.\n \n- pp$8.parseExportSpecifiers = function(exports) {\n- var nodes = [],\n- first = true;\n- // export { x, y as z } [from '...']\n- this.expect(types$1.braceL);\n- while (!this.eat(types$1.braceR)) {\n- if (!first) {\n- this.expect(types$1.comma);\n- if (this.afterTrailingComma(types$1.braceR)) {\n- break\n+ pp$8.parseExportSpecifiers = function(exports) {\n+ var nodes = [],\n+ first = true;\n+ // export { x, y as z } [from '...']\n+ this.expect(types$1.braceL);\n+ while (!this.eat(types$1.braceR)) {\n+ if (!first) {\n+ this.expect(types$1.comma);\n+ if (this.afterTrailingComma(types$1.braceR)) {\n+ break\n+ }\n+ } else {\n+ first = false;\n }\n- } else {\n- first = false;\n- }\n \n- var node = this.startNode();\n- node.local = this.parseModuleExportName();\n- node.exported = this.eatContextual(\"as\") ? this.parseModuleExportName() : node.local;\n- this.checkExport(\n- exports,\n- node.exported,\n- node.exported.start\n- );\n- nodes.push(this.finishNode(node, \"ExportSpecifier\"));\n- }\n- return nodes\n- };\n+ var node = this.startNode();\n+ node.local = this.parseModuleExportName();\n+ node.exported = this.eatContextual(\"as\") ? this.parseModuleExportName() : node.local;\n+ this.checkExport(\n+ exports,\n+ node.exported,\n+ node.exported.start\n+ );\n+ nodes.push(this.finishNode(node, \"ExportSpecifier\"));\n+ }\n+ return nodes\n+ };\n \n- // Parses import declaration.\n+ // Parses import declaration.\n \n- pp$8.parseImport = function(node) {\n- this.next();\n- // import '...'\n- if (this.type === types$1.string) {\n- node.specifiers = empty$1;\n- node.source = this.parseExprAtom();\n- } else {\n- node.specifiers = this.parseImportSpecifiers();\n- this.expectContextual(\"from\");\n- node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();\n- }\n- this.semicolon();\n- return this.finishNode(node, \"ImportDeclaration\")\n- };\n+ pp$8.parseImport = function(node) {\n+ this.next();\n+ // import '...'\n+ if (this.type === types$1.string) {\n+ node.specifiers = empty$1;\n+ node.source = this.parseExprAtom();\n+ } else {\n+ node.specifiers = this.parseImportSpecifiers();\n+ this.expectContextual(\"from\");\n+ node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();\n+ }\n+ this.semicolon();\n+ return this.finishNode(node, \"ImportDeclaration\")\n+ };\n \n- // Parses a comma-separated list of module imports.\n+ // Parses a comma-separated list of module imports.\n \n- pp$8.parseImportSpecifiers = function() {\n- var nodes = [],\n- first = true;\n- if (this.type === types$1.name) {\n- // import defaultObj, { x, y as z } from '...'\n- var node = this.startNode();\n- node.local = this.parseIdent();\n- this.checkLValSimple(node.local, BIND_LEXICAL);\n- nodes.push(this.finishNode(node, \"ImportDefaultSpecifier\"));\n- if (!this.eat(types$1.comma)) {\n+ pp$8.parseImportSpecifiers = function() {\n+ var nodes = [],\n+ first = true;\n+ if (this.type === types$1.name) {\n+ // import defaultObj, { x, y as z } from '...'\n+ var node = this.startNode();\n+ node.local = this.parseIdent();\n+ this.checkLValSimple(node.local, BIND_LEXICAL);\n+ nodes.push(this.finishNode(node, \"ImportDefaultSpecifier\"));\n+ if (!this.eat(types$1.comma)) {\n+ return nodes\n+ }\n+ }\n+ if (this.type === types$1.star) {\n+ var node$1 = this.startNode();\n+ this.next();\n+ this.expectContextual(\"as\");\n+ node$1.local = this.parseIdent();\n+ this.checkLValSimple(node$1.local, BIND_LEXICAL);\n+ nodes.push(this.finishNode(node$1, \"ImportNamespaceSpecifier\"));\n return nodes\n }\n- }\n- if (this.type === types$1.star) {\n- var node$1 = this.startNode();\n- this.next();\n- this.expectContextual(\"as\");\n- node$1.local = this.parseIdent();\n- this.checkLValSimple(node$1.local, BIND_LEXICAL);\n- nodes.push(this.finishNode(node$1, \"ImportNamespaceSpecifier\"));\n- return nodes\n- }\n- this.expect(types$1.braceL);\n- while (!this.eat(types$1.braceR)) {\n- if (!first) {\n- this.expect(types$1.comma);\n- if (this.afterTrailingComma(types$1.braceR)) {\n- break\n+ this.expect(types$1.braceL);\n+ while (!this.eat(types$1.braceR)) {\n+ if (!first) {\n+ this.expect(types$1.comma);\n+ if (this.afterTrailingComma(types$1.braceR)) {\n+ break\n+ }\n+ } else {\n+ first = false;\n }\n- } else {\n- first = false;\n- }\n \n- var node$2 = this.startNode();\n- node$2.imported = this.parseModuleExportName();\n- if (this.eatContextual(\"as\")) {\n- node$2.local = this.parseIdent();\n- } else {\n- this.checkUnreserved(node$2.imported);\n- node$2.local = node$2.imported;\n+ var node$2 = this.startNode();\n+ node$2.imported = this.parseModuleExportName();\n+ if (this.eatContextual(\"as\")) {\n+ node$2.local = this.parseIdent();\n+ } else {\n+ this.checkUnreserved(node$2.imported);\n+ node$2.local = node$2.imported;\n+ }\n+ this.checkLValSimple(node$2.local, BIND_LEXICAL);\n+ nodes.push(this.finishNode(node$2, \"ImportSpecifier\"));\n }\n- this.checkLValSimple(node$2.local, BIND_LEXICAL);\n- nodes.push(this.finishNode(node$2, \"ImportSpecifier\"));\n- }\n- return nodes\n- };\n+ return nodes\n+ };\n \n- pp$8.parseModuleExportName = function() {\n- if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {\n- var stringLiteral = this.parseLiteral(this.value);\n- if (loneSurrogate.test(stringLiteral.value)) {\n- this.raise(stringLiteral.start, \"An export name cannot include a lone surrogate.\");\n+ pp$8.parseModuleExportName = function() {\n+ if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {\n+ var stringLiteral = this.parseLiteral(this.value);\n+ if (loneSurrogate.test(stringLiteral.value)) {\n+ this.raise(stringLiteral.start, \"An export name cannot include a lone surrogate.\");\n+ }\n+ return stringLiteral\n }\n- return stringLiteral\n- }\n- return this.parseIdent(true)\n- };\n-\n- // Set `ExpressionStatement#directive` property for directive prologues.\n- pp$8.adaptDirectivePrologue = function(statements) {\n- for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n- statements[i].directive = statements[i].expression.raw.slice(1, -1);\n- }\n- };\n- pp$8.isDirectiveCandidate = function(statement) {\n- return (\n- this.options.ecmaVersion >= 5 &&\n- statement.type === \"ExpressionStatement\" &&\n- statement.expression.type === \"Literal\" &&\n- typeof statement.expression.value === \"string\" &&\n- // Reject parenthesized strings.\n- (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n- )\n- };\n+ return this.parseIdent(true)\n+ };\n \n- var pp$7 = Parser.prototype;\n+ // Set `ExpressionStatement#directive` property for directive prologues.\n+ pp$8.adaptDirectivePrologue = function(statements) {\n+ for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n+ statements[i].directive = statements[i].expression.raw.slice(1, -1);\n+ }\n+ };\n+ pp$8.isDirectiveCandidate = function(statement) {\n+ return (\n+ this.options.ecmaVersion >= 5 &&\n+ statement.type === \"ExpressionStatement\" &&\n+ statement.expression.type === \"Literal\" &&\n+ typeof statement.expression.value === \"string\" &&\n+ // Reject parenthesized strings.\n+ (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n+ )\n+ };\n \n- // Convert existing expression atom to assignable pattern\n- // if possible.\n+ var pp$7 = Parser.prototype;\n \n- pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {\n- if (this.options.ecmaVersion >= 6 && node) {\n- switch (node.type) {\n- case \"Identifier\":\n- if (this.inAsync && node.name === \"await\") {\n- this.raise(node.start, \"Cannot use 'await' as identifier inside an async function\");\n- }\n- break\n+ // Convert existing expression atom to assignable pattern\n+ // if possible.\n \n- case \"ObjectPattern\":\n- case \"ArrayPattern\":\n- case \"AssignmentPattern\":\n- case \"RestElement\":\n- break\n+ pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {\n+ if (this.options.ecmaVersion >= 6 && node) {\n+ switch (node.type) {\n+ case \"Identifier\":\n+ if (this.inAsync && node.name === \"await\") {\n+ this.raise(node.start, \"Cannot use 'await' as identifier inside an async function\");\n+ }\n+ break\n \n- case \"ObjectExpression\":\n- node.type = \"ObjectPattern\";\n- if (refDestructuringErrors) {\n- this.checkPatternErrors(refDestructuringErrors, true);\n- }\n- for (var i = 0, list = node.properties; i < list.length; i += 1) {\n- var prop = list[i];\n+ case \"ObjectPattern\":\n+ case \"ArrayPattern\":\n+ case \"AssignmentPattern\":\n+ case \"RestElement\":\n+ break\n \n- this.toAssignable(prop, isBinding);\n- // Early error:\n- // AssignmentRestProperty[Yield, Await] :\n- // `...` DestructuringAssignmentTarget[Yield, Await]\n- //\n- // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n- if (\n- prop.type === \"RestElement\" &&\n- (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n- ) {\n- this.raise(prop.argument.start, \"Unexpected token\");\n+ case \"ObjectExpression\":\n+ node.type = \"ObjectPattern\";\n+ if (refDestructuringErrors) {\n+ this.checkPatternErrors(refDestructuringErrors, true);\n }\n- }\n- break\n+ for (var i = 0, list = node.properties; i < list.length; i += 1) {\n+ var prop = list[i];\n \n- case \"Property\":\n- // AssignmentProperty has type === \"Property\"\n- if (node.kind !== \"init\") {\n- this.raise(node.key.start, \"Object pattern can't contain getter or setter\");\n- }\n- this.toAssignable(node.value, isBinding);\n- break\n+ this.toAssignable(prop, isBinding);\n+ // Early error:\n+ // AssignmentRestProperty[Yield, Await] :\n+ // `...` DestructuringAssignmentTarget[Yield, Await]\n+ //\n+ // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n+ if (\n+ prop.type === \"RestElement\" &&\n+ (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n+ ) {\n+ this.raise(prop.argument.start, \"Unexpected token\");\n+ }\n+ }\n+ break\n \n- case \"ArrayExpression\":\n- node.type = \"ArrayPattern\";\n- if (refDestructuringErrors) {\n- this.checkPatternErrors(refDestructuringErrors, true);\n- }\n- this.toAssignableList(node.elements, isBinding);\n- break\n+ case \"Property\":\n+ // AssignmentProperty has type === \"Property\"\n+ if (node.kind !== \"init\") {\n+ this.raise(node.key.start, \"Object pattern can't contain getter or setter\");\n+ }\n+ this.toAssignable(node.value, isBinding);\n+ break\n \n- case \"SpreadElement\":\n- node.type = \"RestElement\";\n- this.toAssignable(node.argument, isBinding);\n- if (node.argument.type === \"AssignmentPattern\") {\n- this.raise(node.argument.start, \"Rest elements cannot have a default value\");\n- }\n- break\n+ case \"ArrayExpression\":\n+ node.type = \"ArrayPattern\";\n+ if (refDestructuringErrors) {\n+ this.checkPatternErrors(refDestructuringErrors, true);\n+ }\n+ this.toAssignableList(node.elements, isBinding);\n+ break\n \n- case \"AssignmentExpression\":\n- if (node.operator !== \"=\") {\n- this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\");\n- }\n- node.type = \"AssignmentPattern\";\n- delete node.operator;\n- this.toAssignable(node.left, isBinding);\n- break\n+ case \"SpreadElement\":\n+ node.type = \"RestElement\";\n+ this.toAssignable(node.argument, isBinding);\n+ if (node.argument.type === \"AssignmentPattern\") {\n+ this.raise(node.argument.start, \"Rest elements cannot have a default value\");\n+ }\n+ break\n \n- case \"ParenthesizedExpression\":\n- this.toAssignable(node.expression, isBinding, refDestructuringErrors);\n- break\n+ case \"AssignmentExpression\":\n+ if (node.operator !== \"=\") {\n+ this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\");\n+ }\n+ node.type = \"AssignmentPattern\";\n+ delete node.operator;\n+ this.toAssignable(node.left, isBinding);\n+ break\n \n- case \"ChainExpression\":\n- this.raiseRecoverable(node.start, \"Optional chaining cannot appear in left-hand side\");\n- break\n+ case \"ParenthesizedExpression\":\n+ this.toAssignable(node.expression, isBinding, refDestructuringErrors);\n+ break\n \n- case \"MemberExpression\":\n- if (!isBinding) {\n+ case \"ChainExpression\":\n+ this.raiseRecoverable(node.start, \"Optional chaining cannot appear in left-hand side\");\n break\n- }\n \n- default:\n- this.raise(node.start, \"Assigning to rvalue\");\n+ case \"MemberExpression\":\n+ if (!isBinding) {\n+ break\n+ }\n+\n+ default:\n+ this.raise(node.start, \"Assigning to rvalue\");\n+ }\n+ } else if (refDestructuringErrors) {\n+ this.checkPatternErrors(refDestructuringErrors, true);\n }\n- } else if (refDestructuringErrors) {\n- this.checkPatternErrors(refDestructuringErrors, true);\n- }\n- return node\n- };\n+ return node\n+ };\n \n- // Convert list of expression atoms to binding list.\n+ // Convert list of expression atoms to binding list.\n \n- pp$7.toAssignableList = function(exprList, isBinding) {\n- var end = exprList.length;\n- for (var i = 0; i < end; i++) {\n- var elt = exprList[i];\n- if (elt) {\n- this.toAssignable(elt, isBinding);\n+ pp$7.toAssignableList = function(exprList, isBinding) {\n+ var end = exprList.length;\n+ for (var i = 0; i < end; i++) {\n+ var elt = exprList[i];\n+ if (elt) {\n+ this.toAssignable(elt, isBinding);\n+ }\n }\n- }\n- if (end) {\n- var last = exprList[end - 1];\n- if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\") {\n- this.unexpected(last.argument.start);\n+ if (end) {\n+ var last = exprList[end - 1];\n+ if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\") {\n+ this.unexpected(last.argument.start);\n+ }\n }\n- }\n- return exprList\n- };\n+ return exprList\n+ };\n \n- // Parses spread element.\n+ // Parses spread element.\n \n- pp$7.parseSpread = function(refDestructuringErrors) {\n- var node = this.startNode();\n- this.next();\n- node.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n- return this.finishNode(node, \"SpreadElement\")\n- };\n+ pp$7.parseSpread = function(refDestructuringErrors) {\n+ var node = this.startNode();\n+ this.next();\n+ node.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n+ return this.finishNode(node, \"SpreadElement\")\n+ };\n \n- pp$7.parseRestBinding = function() {\n- var node = this.startNode();\n- this.next();\n+ pp$7.parseRestBinding = function() {\n+ var node = this.startNode();\n+ this.next();\n \n- // RestElement inside of a function parameter must be an identifier\n- if (this.options.ecmaVersion === 6 && this.type !== types$1.name) {\n- this.unexpected();\n- }\n+ // RestElement inside of a function parameter must be an identifier\n+ if (this.options.ecmaVersion === 6 && this.type !== types$1.name) {\n+ this.unexpected();\n+ }\n \n- node.argument = this.parseBindingAtom();\n+ node.argument = this.parseBindingAtom();\n \n- return this.finishNode(node, \"RestElement\")\n- };\n+ return this.finishNode(node, \"RestElement\")\n+ };\n \n- // Parses lvalue (assignable) atom.\n+ // Parses lvalue (assignable) atom.\n \n- pp$7.parseBindingAtom = function() {\n- if (this.options.ecmaVersion >= 6) {\n- switch (this.type) {\n- case types$1.bracketL:\n- var node = this.startNode();\n- this.next();\n- node.elements = this.parseBindingList(types$1.bracketR, true, true);\n- return this.finishNode(node, \"ArrayPattern\")\n+ pp$7.parseBindingAtom = function() {\n+ if (this.options.ecmaVersion >= 6) {\n+ switch (this.type) {\n+ case types$1.bracketL:\n+ var node = this.startNode();\n+ this.next();\n+ node.elements = this.parseBindingList(types$1.bracketR, true, true);\n+ return this.finishNode(node, \"ArrayPattern\")\n \n- case types$1.braceL:\n- return this.parseObj(true)\n+ case types$1.braceL:\n+ return this.parseObj(true)\n+ }\n }\n- }\n- return this.parseIdent()\n- };\n+ return this.parseIdent()\n+ };\n \n- pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) {\n- var elts = [],\n- first = true;\n- while (!this.eat(close)) {\n- if (first) {\n- first = false;\n- } else {\n- this.expect(types$1.comma);\n- }\n- if (allowEmpty && this.type === types$1.comma) {\n- elts.push(null);\n- } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n- break\n- } else if (this.type === types$1.ellipsis) {\n- var rest = this.parseRestBinding();\n- this.parseBindingListItem(rest);\n- elts.push(rest);\n- if (this.type === types$1.comma) {\n- this.raise(this.start, \"Comma is not permitted after the rest element\");\n+ pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) {\n+ var elts = [],\n+ first = true;\n+ while (!this.eat(close)) {\n+ if (first) {\n+ first = false;\n+ } else {\n+ this.expect(types$1.comma);\n+ }\n+ if (allowEmpty && this.type === types$1.comma) {\n+ elts.push(null);\n+ } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n+ break\n+ } else if (this.type === types$1.ellipsis) {\n+ var rest = this.parseRestBinding();\n+ this.parseBindingListItem(rest);\n+ elts.push(rest);\n+ if (this.type === types$1.comma) {\n+ this.raise(this.start, \"Comma is not permitted after the rest element\");\n+ }\n+ this.expect(close);\n+ break\n+ } else {\n+ var elem = this.parseMaybeDefault(this.start, this.startLoc);\n+ this.parseBindingListItem(elem);\n+ elts.push(elem);\n }\n- this.expect(close);\n- break\n- } else {\n- var elem = this.parseMaybeDefault(this.start, this.startLoc);\n- this.parseBindingListItem(elem);\n- elts.push(elem);\n }\n- }\n- return elts\n- };\n+ return elts\n+ };\n \n- pp$7.parseBindingListItem = function(param) {\n- return param\n- };\n+ pp$7.parseBindingListItem = function(param) {\n+ return param\n+ };\n \n- // Parses assignment pattern around given atom if possible.\n+ // Parses assignment pattern around given atom if possible.\n \n- pp$7.parseMaybeDefault = function(startPos, startLoc, left) {\n- left = left || this.parseBindingAtom();\n- if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) {\n- return left\n- }\n- var node = this.startNodeAt(startPos, startLoc);\n- node.left = left;\n- node.right = this.parseMaybeAssign();\n- return this.finishNode(node, \"AssignmentPattern\")\n- };\n+ pp$7.parseMaybeDefault = function(startPos, startLoc, left) {\n+ left = left || this.parseBindingAtom();\n+ if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) {\n+ return left\n+ }\n+ var node = this.startNodeAt(startPos, startLoc);\n+ node.left = left;\n+ node.right = this.parseMaybeAssign();\n+ return this.finishNode(node, \"AssignmentPattern\")\n+ };\n \n- // The following three functions all verify that a node is an lvalue \u2014\n- // something that can be bound, or assigned to. In order to do so, they perform\n- // a variety of checks:\n- //\n- // - Check that none of the bound/assigned-to identifiers are reserved words.\n- // - Record name declarations for bindings in the appropriate scope.\n- // - Check duplicate argument names, if checkClashes is set.\n- //\n- // If a complex binding pattern is encountered (e.g., object and array\n- // destructuring), the entire pattern is recursively checked.\n- //\n- // There are three versions of checkLVal*() appropriate for different\n- // circumstances:\n- //\n- // - checkLValSimple() shall be used if the syntactic construct supports\n- // nothing other than identifiers and member expressions. Parenthesized\n- // expressions are also correctly handled. This is generally appropriate for\n- // constructs for which the spec says\n- //\n- // > It is a Syntax Error if AssignmentTargetType of [the production] is not\n- // > simple.\n- //\n- // It is also appropriate for checking if an identifier is valid and not\n- // defined elsewhere, like import declarations or function/class identifiers.\n- //\n- // Examples where this is used include:\n- // a += \u2026;\n- // import a from '\u2026';\n- // where a is the node to be checked.\n- //\n- // - checkLValPattern() shall be used if the syntactic construct supports\n- // anything checkLValSimple() supports, as well as object and array\n- // destructuring patterns. This is generally appropriate for constructs for\n- // which the spec says\n- //\n- // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor\n- // > an ArrayLiteral and AssignmentTargetType of [the production] is not\n- // > simple.\n- //\n- // Examples where this is used include:\n- // (a = \u2026);\n- // const a = \u2026;\n- // try { \u2026 } catch (a) { \u2026 }\n- // where a is the node to be checked.\n- //\n- // - checkLValInnerPattern() shall be used if the syntactic construct supports\n- // anything checkLValPattern() supports, as well as default assignment\n- // patterns, rest elements, and other constructs that may appear within an\n- // object or array destructuring pattern.\n- //\n- // As a special case, function parameters also use checkLValInnerPattern(),\n- // as they also support defaults and rest constructs.\n- //\n- // These functions deliberately support both assignment and binding constructs,\n- // as the logic for both is exceedingly similar. If the node is the target of\n- // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it\n- // should be set to the appropriate BIND_* constant, like BIND_VAR or\n- // BIND_LEXICAL.\n- //\n- // If the function is called with a non-BIND_NONE bindingType, then\n- // additionally a checkClashes object may be specified to allow checking for\n- // duplicate argument names. checkClashes is ignored if the provided construct\n- // is an assignment (i.e., bindingType is BIND_NONE).\n-\n- pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {\n- if (bindingType === void 0) bindingType = BIND_NONE;\n-\n- var isBind = bindingType !== BIND_NONE;\n-\n- switch (expr.type) {\n- case \"Identifier\":\n- if (this.strict && this.reservedWordsStrictBind.test(expr.name)) {\n- this.raiseRecoverable(expr.start, (isBind ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\");\n- }\n- if (isBind) {\n- if (bindingType === BIND_LEXICAL && expr.name === \"let\") {\n- this.raiseRecoverable(expr.start, \"let is disallowed as a lexically bound name\");\n- }\n- if (checkClashes) {\n- if (hasOwn(checkClashes, expr.name)) {\n- this.raiseRecoverable(expr.start, \"Argument name clash\");\n- }\n- checkClashes[expr.name] = true;\n- }\n- if (bindingType !== BIND_OUTSIDE) {\n- this.declareName(expr.name, bindingType, expr.start);\n- }\n- }\n- break\n-\n- case \"ChainExpression\":\n- this.raiseRecoverable(expr.start, \"Optional chaining cannot appear in left-hand side\");\n- break\n-\n- case \"MemberExpression\":\n- if (isBind) {\n- this.raiseRecoverable(expr.start, \"Binding member expression\");\n- }\n- break\n-\n- case \"ParenthesizedExpression\":\n- if (isBind) {\n- this.raiseRecoverable(expr.start, \"Binding parenthesized expression\");\n- }\n- return this.checkLValSimple(expr.expression, bindingType, checkClashes)\n+ // The following three functions all verify that a node is an lvalue \u2014\n+ // something that can be bound, or assigned to. In order to do so, they perform\n+ // a variety of checks:\n+ //\n+ // - Check that none of the bound/assigned-to identifiers are reserved words.\n+ // - Record name declarations for bindings in the appropriate scope.\n+ // - Check duplicate argument names, if checkClashes is set.\n+ //\n+ // If a complex binding pattern is encountered (e.g., object and array\n+ // destructuring), the entire pattern is recursively checked.\n+ //\n+ // There are three versions of checkLVal*() appropriate for different\n+ // circumstances:\n+ //\n+ // - checkLValSimple() shall be used if the syntactic construct supports\n+ // nothing other than identifiers and member expressions. Parenthesized\n+ // expressions are also correctly handled. This is generally appropriate for\n+ // constructs for which the spec says\n+ //\n+ // > It is a Syntax Error if AssignmentTargetType of [the production] is not\n+ // > simple.\n+ //\n+ // It is also appropriate for checking if an identifier is valid and not\n+ // defined elsewhere, like import declarations or function/class identifiers.\n+ //\n+ // Examples where this is used include:\n+ // a += \u2026;\n+ // import a from '\u2026';\n+ // where a is the node to be checked.\n+ //\n+ // - checkLValPattern() shall be used if the syntactic construct supports\n+ // anything checkLValSimple() supports, as well as object and array\n+ // destructuring patterns. This is generally appropriate for constructs for\n+ // which the spec says\n+ //\n+ // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor\n+ // > an ArrayLiteral and AssignmentTargetType of [the production] is not\n+ // > simple.\n+ //\n+ // Examples where this is used include:\n+ // (a = \u2026);\n+ // const a = \u2026;\n+ // try { \u2026 } catch (a) { \u2026 }\n+ // where a is the node to be checked.\n+ //\n+ // - checkLValInnerPattern() shall be used if the syntactic construct supports\n+ // anything checkLValPattern() supports, as well as default assignment\n+ // patterns, rest elements, and other constructs that may appear within an\n+ // object or array destructuring pattern.\n+ //\n+ // As a special case, function parameters also use checkLValInnerPattern(),\n+ // as they also support defaults and rest constructs.\n+ //\n+ // These functions deliberately support both assignment and binding constructs,\n+ // as the logic for both is exceedingly similar. If the node is the target of\n+ // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it\n+ // should be set to the appropriate BIND_* constant, like BIND_VAR or\n+ // BIND_LEXICAL.\n+ //\n+ // If the function is called with a non-BIND_NONE bindingType, then\n+ // additionally a checkClashes object may be specified to allow checking for\n+ // duplicate argument names. checkClashes is ignored if the provided construct\n+ // is an assignment (i.e., bindingType is BIND_NONE).\n \n- default:\n- this.raise(expr.start, (isBind ? \"Binding\" : \"Assigning to\") + \" rvalue\");\n- }\n- };\n+ pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {\n+ if (bindingType === void 0) bindingType = BIND_NONE;\n \n- pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {\n- if (bindingType === void 0) bindingType = BIND_NONE;\n+ var isBind = bindingType !== BIND_NONE;\n \n- switch (expr.type) {\n- case \"ObjectPattern\":\n- for (var i = 0, list = expr.properties; i < list.length; i += 1) {\n- var prop = list[i];\n+ switch (expr.type) {\n+ case \"Identifier\":\n+ if (this.strict && this.reservedWordsStrictBind.test(expr.name)) {\n+ this.raiseRecoverable(expr.start, (isBind ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\");\n+ }\n+ if (isBind) {\n+ if (bindingType === BIND_LEXICAL && expr.name === \"let\") {\n+ this.raiseRecoverable(expr.start, \"let is disallowed as a lexically bound name\");\n+ }\n+ if (checkClashes) {\n+ if (hasOwn(checkClashes, expr.name)) {\n+ this.raiseRecoverable(expr.start, \"Argument name clash\");\n+ }\n+ checkClashes[expr.name] = true;\n+ }\n+ if (bindingType !== BIND_OUTSIDE) {\n+ this.declareName(expr.name, bindingType, expr.start);\n+ }\n+ }\n+ break\n \n- this.checkLValInnerPattern(prop, bindingType, checkClashes);\n- }\n- break\n+ case \"ChainExpression\":\n+ this.raiseRecoverable(expr.start, \"Optional chaining cannot appear in left-hand side\");\n+ break\n \n- case \"ArrayPattern\":\n- for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {\n- var elem = list$1[i$1];\n+ case \"MemberExpression\":\n+ if (isBind) {\n+ this.raiseRecoverable(expr.start, \"Binding member expression\");\n+ }\n+ break\n \n- if (elem) {\n- this.checkLValInnerPattern(elem, bindingType, checkClashes);\n+ case \"ParenthesizedExpression\":\n+ if (isBind) {\n+ this.raiseRecoverable(expr.start, \"Binding parenthesized expression\");\n }\n- }\n- break\n+ return this.checkLValSimple(expr.expression, bindingType, checkClashes)\n \n- default:\n- this.checkLValSimple(expr, bindingType, checkClashes);\n- }\n- };\n+ default:\n+ this.raise(expr.start, (isBind ? \"Binding\" : \"Assigning to\") + \" rvalue\");\n+ }\n+ };\n \n- pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {\n- if (bindingType === void 0) bindingType = BIND_NONE;\n+ pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {\n+ if (bindingType === void 0) bindingType = BIND_NONE;\n \n- switch (expr.type) {\n- case \"Property\":\n- // AssignmentProperty has type === \"Property\"\n- this.checkLValInnerPattern(expr.value, bindingType, checkClashes);\n- break\n-\n- case \"AssignmentPattern\":\n- this.checkLValPattern(expr.left, bindingType, checkClashes);\n- break\n-\n- case \"RestElement\":\n- this.checkLValPattern(expr.argument, bindingType, checkClashes);\n- break\n+ switch (expr.type) {\n+ case \"ObjectPattern\":\n+ for (var i = 0, list = expr.properties; i < list.length; i += 1) {\n+ var prop = list[i];\n \n- default:\n- this.checkLValPattern(expr, bindingType, checkClashes);\n- }\n- };\n+ this.checkLValInnerPattern(prop, bindingType, checkClashes);\n+ }\n+ break\n \n- // The algorithm used to determine whether a regexp can appear at a\n+ case \"ArrayPattern\":\n+ for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {\n+ var elem = list$1[i$1];\n \n- var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {\n- this.token = token;\n- this.isExpr = !!isExpr;\n- this.preserveSpace = !!preserveSpace;\n- this.override = override;\n- this.generator = !!generator;\n- };\n+ if (elem) {\n+ this.checkLValInnerPattern(elem, bindingType, checkClashes);\n+ }\n+ }\n+ break\n \n- var types = {\n- b_stat: new TokContext(\"{\", false),\n- b_expr: new TokContext(\"{\", true),\n- b_tmpl: new TokContext(\"${\", false),\n- p_stat: new TokContext(\"(\", false),\n- p_expr: new TokContext(\"(\", true),\n- q_tmpl: new TokContext(\"`\", true, true, function(p) {\n- return p.tryReadTemplateToken();\n- }),\n- f_stat: new TokContext(\"function\", false),\n- f_expr: new TokContext(\"function\", true),\n- f_expr_gen: new TokContext(\"function\", true, false, null, true),\n- f_gen: new TokContext(\"function\", false, false, null, true)\n- };\n+ default:\n+ this.checkLValSimple(expr, bindingType, checkClashes);\n+ }\n+ };\n \n- var pp$6 = Parser.prototype;\n+ pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {\n+ if (bindingType === void 0) bindingType = BIND_NONE;\n \n- pp$6.initialContext = function() {\n- return [types.b_stat]\n- };\n+ switch (expr.type) {\n+ case \"Property\":\n+ // AssignmentProperty has type === \"Property\"\n+ this.checkLValInnerPattern(expr.value, bindingType, checkClashes);\n+ break\n \n- pp$6.curContext = function() {\n- return this.context[this.context.length - 1]\n- };\n+ case \"AssignmentPattern\":\n+ this.checkLValPattern(expr.left, bindingType, checkClashes);\n+ break\n \n- pp$6.braceIsBlock = function(prevType) {\n- var parent = this.curContext();\n- if (parent === types.f_expr || parent === types.f_stat) {\n- return true\n- }\n- if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) {\n- return !parent.isExpr\n- }\n+ case \"RestElement\":\n+ this.checkLValPattern(expr.argument, bindingType, checkClashes);\n+ break\n \n- // The check for `tt.name && exprAllowed` detects whether we are\n- // after a `yield` or `of` construct. See the `updateContext` for\n- // `tt.name`.\n- if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) {\n- return lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n- }\n- if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) {\n- return true\n- }\n- if (prevType === types$1.braceL) {\n- return parent === types.b_stat\n- }\n- if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) {\n- return false\n- }\n- return !this.exprAllowed\n- };\n+ default:\n+ this.checkLValPattern(expr, bindingType, checkClashes);\n+ }\n+ };\n+\n+ // The algorithm used to determine whether a regexp can appear at a\n+\n+ var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {\n+ this.token = token;\n+ this.isExpr = !!isExpr;\n+ this.preserveSpace = !!preserveSpace;\n+ this.override = override;\n+ this.generator = !!generator;\n+ };\n+\n+ var types = {\n+ b_stat: new TokContext(\"{\", false),\n+ b_expr: new TokContext(\"{\", true),\n+ b_tmpl: new TokContext(\"${\", false),\n+ p_stat: new TokContext(\"(\", false),\n+ p_expr: new TokContext(\"(\", true),\n+ q_tmpl: new TokContext(\"`\", true, true, function(p) {\n+ return p.tryReadTemplateToken();\n+ }),\n+ f_stat: new TokContext(\"function\", false),\n+ f_expr: new TokContext(\"function\", true),\n+ f_expr_gen: new TokContext(\"function\", true, false, null, true),\n+ f_gen: new TokContext(\"function\", false, false, null, true)\n+ };\n+\n+ var pp$6 = Parser.prototype;\n+\n+ pp$6.initialContext = function() {\n+ return [types.b_stat]\n+ };\n+\n+ pp$6.curContext = function() {\n+ return this.context[this.context.length - 1]\n+ };\n \n- pp$6.inGeneratorContext = function() {\n- for (var i = this.context.length - 1; i >= 1; i--) {\n- var context = this.context[i];\n- if (context.token === \"function\") {\n- return context.generator\n+ pp$6.braceIsBlock = function(prevType) {\n+ var parent = this.curContext();\n+ if (parent === types.f_expr || parent === types.f_stat) {\n+ return true\n+ }\n+ if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) {\n+ return !parent.isExpr\n }\n- }\n- return false\n- };\n \n- pp$6.updateContext = function(prevType) {\n- var update, type = this.type;\n- if (type.keyword && prevType === types$1.dot) {\n- this.exprAllowed = false;\n- } else if (update = type.updateContext) {\n- update.call(this, prevType);\n- } else {\n- this.exprAllowed = type.beforeExpr;\n- }\n- };\n+ // The check for `tt.name && exprAllowed` detects whether we are\n+ // after a `yield` or `of` construct. See the `updateContext` for\n+ // `tt.name`.\n+ if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) {\n+ return lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n+ }\n+ if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) {\n+ return true\n+ }\n+ if (prevType === types$1.braceL) {\n+ return parent === types.b_stat\n+ }\n+ if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) {\n+ return false\n+ }\n+ return !this.exprAllowed\n+ };\n \n- // Used to handle egde cases when token context could not be inferred correctly during tokenization phase\n+ pp$6.inGeneratorContext = function() {\n+ for (var i = this.context.length - 1; i >= 1; i--) {\n+ var context = this.context[i];\n+ if (context.token === \"function\") {\n+ return context.generator\n+ }\n+ }\n+ return false\n+ };\n \n- pp$6.overrideContext = function(tokenCtx) {\n- if (this.curContext() !== tokenCtx) {\n- this.context[this.context.length - 1] = tokenCtx;\n- }\n- };\n+ pp$6.updateContext = function(prevType) {\n+ var update, type = this.type;\n+ if (type.keyword && prevType === types$1.dot) {\n+ this.exprAllowed = false;\n+ } else if (update = type.updateContext) {\n+ update.call(this, prevType);\n+ } else {\n+ this.exprAllowed = type.beforeExpr;\n+ }\n+ };\n \n- // Token-specific context update code\n+ // Used to handle egde cases when token context could not be inferred correctly during tokenization phase\n \n- types$1.parenR.updateContext = types$1.braceR.updateContext = function() {\n- if (this.context.length === 1) {\n- this.exprAllowed = true;\n- return\n- }\n- var out = this.context.pop();\n- if (out === types.b_stat && this.curContext().token === \"function\") {\n- out = this.context.pop();\n- }\n- this.exprAllowed = !out.isExpr;\n- };\n+ pp$6.overrideContext = function(tokenCtx) {\n+ if (this.curContext() !== tokenCtx) {\n+ this.context[this.context.length - 1] = tokenCtx;\n+ }\n+ };\n \n- types$1.braceL.updateContext = function(prevType) {\n- this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);\n- this.exprAllowed = true;\n- };\n+ // Token-specific context update code\n \n- types$1.dollarBraceL.updateContext = function() {\n- this.context.push(types.b_tmpl);\n- this.exprAllowed = true;\n- };\n+ types$1.parenR.updateContext = types$1.braceR.updateContext = function() {\n+ if (this.context.length === 1) {\n+ this.exprAllowed = true;\n+ return\n+ }\n+ var out = this.context.pop();\n+ if (out === types.b_stat && this.curContext().token === \"function\") {\n+ out = this.context.pop();\n+ }\n+ this.exprAllowed = !out.isExpr;\n+ };\n \n- types$1.parenL.updateContext = function(prevType) {\n- var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;\n- this.context.push(statementParens ? types.p_stat : types.p_expr);\n- this.exprAllowed = true;\n- };\n+ types$1.braceL.updateContext = function(prevType) {\n+ this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);\n+ this.exprAllowed = true;\n+ };\n \n- types$1.incDec.updateContext = function() {\n- // tokExprAllowed stays unchanged\n- };\n+ types$1.dollarBraceL.updateContext = function() {\n+ this.context.push(types.b_tmpl);\n+ this.exprAllowed = true;\n+ };\n \n- types$1._function.updateContext = types$1._class.updateContext = function(prevType) {\n- if (prevType.beforeExpr && prevType !== types$1._else &&\n- !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&\n- !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n- !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) {\n- this.context.push(types.f_expr);\n- } else {\n- this.context.push(types.f_stat);\n- }\n- this.exprAllowed = false;\n- };\n+ types$1.parenL.updateContext = function(prevType) {\n+ var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;\n+ this.context.push(statementParens ? types.p_stat : types.p_expr);\n+ this.exprAllowed = true;\n+ };\n \n- types$1.backQuote.updateContext = function() {\n- if (this.curContext() === types.q_tmpl) {\n- this.context.pop();\n- } else {\n- this.context.push(types.q_tmpl);\n- }\n- this.exprAllowed = false;\n- };\n+ types$1.incDec.updateContext = function() {\n+ // tokExprAllowed stays unchanged\n+ };\n \n- types$1.star.updateContext = function(prevType) {\n- if (prevType === types$1._function) {\n- var index = this.context.length - 1;\n- if (this.context[index] === types.f_expr) {\n- this.context[index] = types.f_expr_gen;\n+ types$1._function.updateContext = types$1._class.updateContext = function(prevType) {\n+ if (prevType.beforeExpr && prevType !== types$1._else &&\n+ !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&\n+ !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n+ !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) {\n+ this.context.push(types.f_expr);\n } else {\n- this.context[index] = types.f_gen;\n+ this.context.push(types.f_stat);\n }\n- }\n- this.exprAllowed = true;\n- };\n+ this.exprAllowed = false;\n+ };\n \n- types$1.name.updateContext = function(prevType) {\n- var allowed = false;\n- if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {\n- if (this.value === \"of\" && !this.exprAllowed ||\n- this.value === \"yield\" && this.inGeneratorContext()) {\n- allowed = true;\n+ types$1.backQuote.updateContext = function() {\n+ if (this.curContext() === types.q_tmpl) {\n+ this.context.pop();\n+ } else {\n+ this.context.push(types.q_tmpl);\n }\n- }\n- this.exprAllowed = allowed;\n- };\n+ this.exprAllowed = false;\n+ };\n \n- // A recursive descent parser operates by defining functions for all\n+ types$1.star.updateContext = function(prevType) {\n+ if (prevType === types$1._function) {\n+ var index = this.context.length - 1;\n+ if (this.context[index] === types.f_expr) {\n+ this.context[index] = types.f_expr_gen;\n+ } else {\n+ this.context[index] = types.f_gen;\n+ }\n+ }\n+ this.exprAllowed = true;\n+ };\n+\n+ types$1.name.updateContext = function(prevType) {\n+ var allowed = false;\n+ if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {\n+ if (this.value === \"of\" && !this.exprAllowed ||\n+ this.value === \"yield\" && this.inGeneratorContext()) {\n+ allowed = true;\n+ }\n+ }\n+ this.exprAllowed = allowed;\n+ };\n+\n+ // A recursive descent parser operates by defining functions for all\n \n- var pp$5 = Parser.prototype;\n+ var pp$5 = Parser.prototype;\n \n- // Check if property name clashes with already added.\n- // Object/class getters and setters are not allowed to clash \u2014\n- // either with each other or with an init property \u2014 and in\n- // strict mode, init properties are also not allowed to be repeated.\n-\n- pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n- if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\") {\n- return\n- }\n- if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) {\n- return\n- }\n- var key = prop.key;\n- var name;\n- switch (key.type) {\n- case \"Identifier\":\n- name = key.name;\n- break\n- case \"Literal\":\n- name = String(key.value);\n- break\n- default:\n+ // Check if property name clashes with already added.\n+ // Object/class getters and setters are not allowed to clash \u2014\n+ // either with each other or with an init property \u2014 and in\n+ // strict mode, init properties are also not allowed to be repeated.\n+\n+ pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n+ if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\") {\n return\n- }\n- var kind = prop.kind;\n- if (this.options.ecmaVersion >= 6) {\n- if (name === \"__proto__\" && kind === \"init\") {\n- if (propHash.proto) {\n- if (refDestructuringErrors) {\n- if (refDestructuringErrors.doubleProto < 0) {\n- refDestructuringErrors.doubleProto = key.start;\n+ }\n+ if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) {\n+ return\n+ }\n+ var key = prop.key;\n+ var name;\n+ switch (key.type) {\n+ case \"Identifier\":\n+ name = key.name;\n+ break\n+ case \"Literal\":\n+ name = String(key.value);\n+ break\n+ default:\n+ return\n+ }\n+ var kind = prop.kind;\n+ if (this.options.ecmaVersion >= 6) {\n+ if (name === \"__proto__\" && kind === \"init\") {\n+ if (propHash.proto) {\n+ if (refDestructuringErrors) {\n+ if (refDestructuringErrors.doubleProto < 0) {\n+ refDestructuringErrors.doubleProto = key.start;\n+ }\n+ } else {\n+ this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\");\n }\n- } else {\n- this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\");\n }\n+ propHash.proto = true;\n }\n- propHash.proto = true;\n+ return\n }\n- return\n- }\n- name = \"$\" + name;\n- var other = propHash[name];\n- if (other) {\n- var redefinition;\n- if (kind === \"init\") {\n- redefinition = this.strict && other.init || other.get || other.set;\n+ name = \"$\" + name;\n+ var other = propHash[name];\n+ if (other) {\n+ var redefinition;\n+ if (kind === \"init\") {\n+ redefinition = this.strict && other.init || other.get || other.set;\n+ } else {\n+ redefinition = other.init || other[kind];\n+ }\n+ if (redefinition) {\n+ this.raiseRecoverable(key.start, \"Redefinition of property\");\n+ }\n } else {\n- redefinition = other.init || other[kind];\n- }\n- if (redefinition) {\n- this.raiseRecoverable(key.start, \"Redefinition of property\");\n+ other = propHash[name] = {\n+ init: false,\n+ get: false,\n+ set: false\n+ };\n }\n- } else {\n- other = propHash[name] = {\n- init: false,\n- get: false,\n- set: false\n- };\n- }\n- other[kind] = true;\n- };\n+ other[kind] = true;\n+ };\n \n- // ### Expression parsing\n+ // ### Expression parsing\n \n- // These nest, from the most general expression type at the top to\n- // 'atomic', nondivisible expression types at the bottom. Most of\n- // the functions will simply let the function(s) below them parse,\n- // and, *if* the syntactic construct they handle is present, wrap\n- // the AST node that the inner parser gave them in another node.\n-\n- // Parse a full expression. The optional arguments are used to\n- // forbid the `in` operator (in for loops initalization expressions)\n- // and provide reference for storing '=' operator inside shorthand\n- // property assignment in contexts where both object expression\n- // and object pattern might appear (so it's possible to raise\n- // delayed syntax error at correct position).\n-\n- pp$5.parseExpression = function(forInit, refDestructuringErrors) {\n- var startPos = this.start,\n- startLoc = this.startLoc;\n- var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);\n- if (this.type === types$1.comma) {\n- var node = this.startNodeAt(startPos, startLoc);\n- node.expressions = [expr];\n- while (this.eat(types$1.comma)) {\n- node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));\n+ // These nest, from the most general expression type at the top to\n+ // 'atomic', nondivisible expression types at the bottom. Most of\n+ // the functions will simply let the function(s) below them parse,\n+ // and, *if* the syntactic construct they handle is present, wrap\n+ // the AST node that the inner parser gave them in another node.\n+\n+ // Parse a full expression. The optional arguments are used to\n+ // forbid the `in` operator (in for loops initalization expressions)\n+ // and provide reference for storing '=' operator inside shorthand\n+ // property assignment in contexts where both object expression\n+ // and object pattern might appear (so it's possible to raise\n+ // delayed syntax error at correct position).\n+\n+ pp$5.parseExpression = function(forInit, refDestructuringErrors) {\n+ var startPos = this.start,\n+ startLoc = this.startLoc;\n+ var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);\n+ if (this.type === types$1.comma) {\n+ var node = this.startNodeAt(startPos, startLoc);\n+ node.expressions = [expr];\n+ while (this.eat(types$1.comma)) {\n+ node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));\n+ }\n+ return this.finishNode(node, \"SequenceExpression\")\n }\n- return this.finishNode(node, \"SequenceExpression\")\n- }\n- return expr\n- };\n+ return expr\n+ };\n \n- // Parse an assignment expression. This includes applications of\n- // operators like `+=`.\n+ // Parse an assignment expression. This includes applications of\n+ // operators like `+=`.\n \n- pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {\n- if (this.isContextual(\"yield\")) {\n- if (this.inGenerator) {\n- return this.parseYield(forInit)\n- }\n- // The tokenizer will assume an expression is allowed after\n- // `yield`, but this isn't that kind of yield\n- else {\n- this.exprAllowed = false;\n+ pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {\n+ if (this.isContextual(\"yield\")) {\n+ if (this.inGenerator) {\n+ return this.parseYield(forInit)\n+ }\n+ // The tokenizer will assume an expression is allowed after\n+ // `yield`, but this isn't that kind of yield\n+ else {\n+ this.exprAllowed = false;\n+ }\n }\n- }\n \n- var ownDestructuringErrors = false,\n- oldParenAssign = -1,\n- oldTrailingComma = -1,\n- oldDoubleProto = -1;\n- if (refDestructuringErrors) {\n- oldParenAssign = refDestructuringErrors.parenthesizedAssign;\n- oldTrailingComma = refDestructuringErrors.trailingComma;\n- oldDoubleProto = refDestructuringErrors.doubleProto;\n- refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;\n- } else {\n- refDestructuringErrors = new DestructuringErrors;\n- ownDestructuringErrors = true;\n- }\n-\n- var startPos = this.start,\n- startLoc = this.startLoc;\n- if (this.type === types$1.parenL || this.type === types$1.name) {\n- this.potentialArrowAt = this.start;\n- this.potentialArrowInForAwait = forInit === \"await\";\n- }\n- var left = this.parseMaybeConditional(forInit, refDestructuringErrors);\n- if (afterLeftParse) {\n- left = afterLeftParse.call(this, left, startPos, startLoc);\n- }\n- if (this.type.isAssign) {\n- var node = this.startNodeAt(startPos, startLoc);\n- node.operator = this.value;\n- if (this.type === types$1.eq) {\n- left = this.toAssignable(left, false, refDestructuringErrors);\n- }\n- if (!ownDestructuringErrors) {\n- refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;\n- }\n- if (refDestructuringErrors.shorthandAssign >= left.start) {\n- refDestructuringErrors.shorthandAssign = -1;\n- } // reset because shorthand default was used correctly\n- if (this.type === types$1.eq) {\n- this.checkLValPattern(left);\n+ var ownDestructuringErrors = false,\n+ oldParenAssign = -1,\n+ oldTrailingComma = -1,\n+ oldDoubleProto = -1;\n+ if (refDestructuringErrors) {\n+ oldParenAssign = refDestructuringErrors.parenthesizedAssign;\n+ oldTrailingComma = refDestructuringErrors.trailingComma;\n+ oldDoubleProto = refDestructuringErrors.doubleProto;\n+ refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;\n } else {\n- this.checkLValSimple(left);\n- }\n- node.left = left;\n- this.next();\n- node.right = this.parseMaybeAssign(forInit);\n- if (oldDoubleProto > -1) {\n- refDestructuringErrors.doubleProto = oldDoubleProto;\n- }\n- return this.finishNode(node, \"AssignmentExpression\")\n- } else {\n- if (ownDestructuringErrors) {\n- this.checkExpressionErrors(refDestructuringErrors, true);\n+ refDestructuringErrors = new DestructuringErrors;\n+ ownDestructuringErrors = true;\n }\n- }\n- if (oldParenAssign > -1) {\n- refDestructuringErrors.parenthesizedAssign = oldParenAssign;\n- }\n- if (oldTrailingComma > -1) {\n- refDestructuringErrors.trailingComma = oldTrailingComma;\n- }\n- return left\n- };\n-\n- // Parse a ternary conditional (`?:`) operator.\n-\n- pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {\n- var startPos = this.start,\n- startLoc = this.startLoc;\n- var expr = this.parseExprOps(forInit, refDestructuringErrors);\n- if (this.checkExpressionErrors(refDestructuringErrors)) {\n- return expr\n- }\n- if (this.eat(types$1.question)) {\n- var node = this.startNodeAt(startPos, startLoc);\n- node.test = expr;\n- node.consequent = this.parseMaybeAssign();\n- this.expect(types$1.colon);\n- node.alternate = this.parseMaybeAssign(forInit);\n- return this.finishNode(node, \"ConditionalExpression\")\n- }\n- return expr\n- };\n-\n- // Start the precedence parser.\n \n- pp$5.parseExprOps = function(forInit, refDestructuringErrors) {\n- var startPos = this.start,\n- startLoc = this.startLoc;\n- var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);\n- if (this.checkExpressionErrors(refDestructuringErrors)) {\n- return expr\n- }\n- return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)\n- };\n-\n- // Parse binary operators with the operator precedence parsing\n- // algorithm. `left` is the left-hand side of the operator.\n- // `minPrec` provides context that allows the function to stop and\n- // defer further parser to one of its callers when it encounters an\n- // operator that has a lower precedence than the set it is parsing.\n-\n- pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {\n- var prec = this.type.binop;\n- if (prec != null && (!forInit || this.type !== types$1._in)) {\n- if (prec > minPrec) {\n- var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;\n- var coalesce = this.type === types$1.coalesce;\n- if (coalesce) {\n- // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.\n- // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.\n- prec = types$1.logicalAND.binop;\n+ var startPos = this.start,\n+ startLoc = this.startLoc;\n+ if (this.type === types$1.parenL || this.type === types$1.name) {\n+ this.potentialArrowAt = this.start;\n+ this.potentialArrowInForAwait = forInit === \"await\";\n+ }\n+ var left = this.parseMaybeConditional(forInit, refDestructuringErrors);\n+ if (afterLeftParse) {\n+ left = afterLeftParse.call(this, left, startPos, startLoc);\n+ }\n+ if (this.type.isAssign) {\n+ var node = this.startNodeAt(startPos, startLoc);\n+ node.operator = this.value;\n+ if (this.type === types$1.eq) {\n+ left = this.toAssignable(left, false, refDestructuringErrors);\n+ }\n+ if (!ownDestructuringErrors) {\n+ refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;\n+ }\n+ if (refDestructuringErrors.shorthandAssign >= left.start) {\n+ refDestructuringErrors.shorthandAssign = -1;\n+ } // reset because shorthand default was used correctly\n+ if (this.type === types$1.eq) {\n+ this.checkLValPattern(left);\n+ } else {\n+ this.checkLValSimple(left);\n }\n- var op = this.value;\n+ node.left = left;\n this.next();\n- var startPos = this.start,\n- startLoc = this.startLoc;\n- var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);\n- var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);\n- if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {\n- this.raiseRecoverable(this.start, \"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses\");\n+ node.right = this.parseMaybeAssign(forInit);\n+ if (oldDoubleProto > -1) {\n+ refDestructuringErrors.doubleProto = oldDoubleProto;\n }\n- return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)\n- }\n- }\n- return left\n- };\n-\n- pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n- if (right.type === \"PrivateIdentifier\") {\n- this.raise(right.start, \"Private identifier can only be left side of binary expression\");\n- }\n- var node = this.startNodeAt(startPos, startLoc);\n- node.left = left;\n- node.operator = op;\n- node.right = right;\n- return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n- };\n-\n- // Parse unary operators, both prefix and postfix.\n-\n- pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {\n- var startPos = this.start,\n- startLoc = this.startLoc,\n- expr;\n- if (this.isContextual(\"await\") && this.canAwait) {\n- expr = this.parseAwait(forInit);\n- sawUnary = true;\n- } else if (this.type.prefix) {\n- var node = this.startNode(),\n- update = this.type === types$1.incDec;\n- node.operator = this.value;\n- node.prefix = true;\n- this.next();\n- node.argument = this.parseMaybeUnary(null, true, update, forInit);\n- this.checkExpressionErrors(refDestructuringErrors, true);\n- if (update) {\n- this.checkLValSimple(node.argument);\n- } else if (this.strict && node.operator === \"delete\" &&\n- node.argument.type === \"Identifier\") {\n- this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\");\n- } else if (node.operator === \"delete\" && isPrivateFieldAccess(node.argument)) {\n- this.raiseRecoverable(node.start, \"Private fields can not be deleted\");\n+ return this.finishNode(node, \"AssignmentExpression\")\n } else {\n- sawUnary = true;\n+ if (ownDestructuringErrors) {\n+ this.checkExpressionErrors(refDestructuringErrors, true);\n+ }\n }\n- expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\");\n- } else if (!sawUnary && this.type === types$1.privateId) {\n- if (forInit || this.privateNameStack.length === 0) {\n- this.unexpected();\n+ if (oldParenAssign > -1) {\n+ refDestructuringErrors.parenthesizedAssign = oldParenAssign;\n }\n- expr = this.parsePrivateIdent();\n- // only could be private fields in 'in', such as #x in obj\n- if (this.type !== types$1._in) {\n- this.unexpected();\n+ if (oldTrailingComma > -1) {\n+ refDestructuringErrors.trailingComma = oldTrailingComma;\n }\n- } else {\n- expr = this.parseExprSubscripts(refDestructuringErrors, forInit);\n+ return left\n+ };\n+\n+ // Parse a ternary conditional (`?:`) operator.\n+\n+ pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {\n+ var startPos = this.start,\n+ startLoc = this.startLoc;\n+ var expr = this.parseExprOps(forInit, refDestructuringErrors);\n if (this.checkExpressionErrors(refDestructuringErrors)) {\n return expr\n }\n- while (this.type.postfix && !this.canInsertSemicolon()) {\n- var node$1 = this.startNodeAt(startPos, startLoc);\n- node$1.operator = this.value;\n- node$1.prefix = false;\n- node$1.argument = expr;\n- this.checkLValSimple(expr);\n- this.next();\n- expr = this.finishNode(node$1, \"UpdateExpression\");\n- }\n- }\n-\n- if (!incDec && this.eat(types$1.starstar)) {\n- if (sawUnary) {\n- this.unexpected(this.lastTokStart);\n- } else {\n- return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), \"**\", false)\n+ if (this.eat(types$1.question)) {\n+ var node = this.startNodeAt(startPos, startLoc);\n+ node.test = expr;\n+ node.consequent = this.parseMaybeAssign();\n+ this.expect(types$1.colon);\n+ node.alternate = this.parseMaybeAssign(forInit);\n+ return this.finishNode(node, \"ConditionalExpression\")\n }\n- } else {\n return expr\n- }\n- };\n-\n- function isPrivateFieldAccess(node) {\n- return (\n- node.type === \"MemberExpression\" && node.property.type === \"PrivateIdentifier\" ||\n- node.type === \"ChainExpression\" && isPrivateFieldAccess(node.expression)\n- )\n- }\n+ };\n \n- // Parse call, dot, and `[]`-subscript expressions.\n+ // Start the precedence parser.\n \n- pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {\n- var startPos = this.start,\n- startLoc = this.startLoc;\n- var expr = this.parseExprAtom(refDestructuringErrors, forInit);\n- if (expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\") {\n- return expr\n- }\n- var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);\n- if (refDestructuringErrors && result.type === \"MemberExpression\") {\n- if (refDestructuringErrors.parenthesizedAssign >= result.start) {\n- refDestructuringErrors.parenthesizedAssign = -1;\n- }\n- if (refDestructuringErrors.parenthesizedBind >= result.start) {\n- refDestructuringErrors.parenthesizedBind = -1;\n+ pp$5.parseExprOps = function(forInit, refDestructuringErrors) {\n+ var startPos = this.start,\n+ startLoc = this.startLoc;\n+ var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);\n+ if (this.checkExpressionErrors(refDestructuringErrors)) {\n+ return expr\n }\n- if (refDestructuringErrors.trailingComma >= result.start) {\n- refDestructuringErrors.trailingComma = -1;\n+ return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)\n+ };\n+\n+ // Parse binary operators with the operator precedence parsing\n+ // algorithm. `left` is the left-hand side of the operator.\n+ // `minPrec` provides context that allows the function to stop and\n+ // defer further parser to one of its callers when it encounters an\n+ // operator that has a lower precedence than the set it is parsing.\n+\n+ pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {\n+ var prec = this.type.binop;\n+ if (prec != null && (!forInit || this.type !== types$1._in)) {\n+ if (prec > minPrec) {\n+ var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;\n+ var coalesce = this.type === types$1.coalesce;\n+ if (coalesce) {\n+ // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.\n+ // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.\n+ prec = types$1.logicalAND.binop;\n+ }\n+ var op = this.value;\n+ this.next();\n+ var startPos = this.start,\n+ startLoc = this.startLoc;\n+ var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);\n+ var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);\n+ if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {\n+ this.raiseRecoverable(this.start, \"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses\");\n+ }\n+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)\n+ }\n }\n- }\n- return result\n- };\n+ return left\n+ };\n \n- pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {\n- var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n- this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&\n- this.potentialArrowAt === base.start;\n- var optionalChained = false;\n+ pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n+ if (right.type === \"PrivateIdentifier\") {\n+ this.raise(right.start, \"Private identifier can only be left side of binary expression\");\n+ }\n+ var node = this.startNodeAt(startPos, startLoc);\n+ node.left = left;\n+ node.operator = op;\n+ node.right = right;\n+ return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n+ };\n \n- while (true) {\n- var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);\n+ // Parse unary operators, both prefix and postfix.\n \n- if (element.optional) {\n- optionalChained = true;\n+ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {\n+ var startPos = this.start,\n+ startLoc = this.startLoc,\n+ expr;\n+ if (this.isContextual(\"await\") && this.canAwait) {\n+ expr = this.parseAwait(forInit);\n+ sawUnary = true;\n+ } else if (this.type.prefix) {\n+ var node = this.startNode(),\n+ update = this.type === types$1.incDec;\n+ node.operator = this.value;\n+ node.prefix = true;\n+ this.next();\n+ node.argument = this.parseMaybeUnary(null, true, update, forInit);\n+ this.checkExpressionErrors(refDestructuringErrors, true);\n+ if (update) {\n+ this.checkLValSimple(node.argument);\n+ } else if (this.strict && node.operator === \"delete\" &&\n+ node.argument.type === \"Identifier\") {\n+ this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\");\n+ } else if (node.operator === \"delete\" && isPrivateFieldAccess(node.argument)) {\n+ this.raiseRecoverable(node.start, \"Private fields can not be deleted\");\n+ } else {\n+ sawUnary = true;\n+ }\n+ expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\");\n+ } else if (!sawUnary && this.type === types$1.privateId) {\n+ if (forInit || this.privateNameStack.length === 0) {\n+ this.unexpected();\n+ }\n+ expr = this.parsePrivateIdent();\n+ // only could be private fields in 'in', such as #x in obj\n+ if (this.type !== types$1._in) {\n+ this.unexpected();\n+ }\n+ } else {\n+ expr = this.parseExprSubscripts(refDestructuringErrors, forInit);\n+ if (this.checkExpressionErrors(refDestructuringErrors)) {\n+ return expr\n+ }\n+ while (this.type.postfix && !this.canInsertSemicolon()) {\n+ var node$1 = this.startNodeAt(startPos, startLoc);\n+ node$1.operator = this.value;\n+ node$1.prefix = false;\n+ node$1.argument = expr;\n+ this.checkLValSimple(expr);\n+ this.next();\n+ expr = this.finishNode(node$1, \"UpdateExpression\");\n+ }\n }\n- if (element === base || element.type === \"ArrowFunctionExpression\") {\n- if (optionalChained) {\n- var chainNode = this.startNodeAt(startPos, startLoc);\n- chainNode.expression = element;\n- element = this.finishNode(chainNode, \"ChainExpression\");\n+\n+ if (!incDec && this.eat(types$1.starstar)) {\n+ if (sawUnary) {\n+ this.unexpected(this.lastTokStart);\n+ } else {\n+ return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), \"**\", false)\n }\n- return element\n+ } else {\n+ return expr\n }\n+ };\n \n- base = element;\n+ function isPrivateFieldAccess(node) {\n+ return (\n+ node.type === \"MemberExpression\" && node.property.type === \"PrivateIdentifier\" ||\n+ node.type === \"ChainExpression\" && isPrivateFieldAccess(node.expression)\n+ )\n }\n- };\n \n- pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {\n- var optionalSupported = this.options.ecmaVersion >= 11;\n- var optional = optionalSupported && this.eat(types$1.questionDot);\n- if (noCalls && optional) {\n- this.raise(this.lastTokStart, \"Optional chaining cannot appear in the callee of new expressions\");\n- }\n+ // Parse call, dot, and `[]`-subscript expressions.\n \n- var computed = this.eat(types$1.bracketL);\n- if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {\n- var node = this.startNodeAt(startPos, startLoc);\n- node.object = base;\n- if (computed) {\n- node.property = this.parseExpression();\n- this.expect(types$1.bracketR);\n- } else if (this.type === types$1.privateId && base.type !== \"Super\") {\n- node.property = this.parsePrivateIdent();\n- } else {\n- node.property = this.parseIdent(this.options.allowReserved !== \"never\");\n+ pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {\n+ var startPos = this.start,\n+ startLoc = this.startLoc;\n+ var expr = this.parseExprAtom(refDestructuringErrors, forInit);\n+ if (expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\") {\n+ return expr\n }\n- node.computed = !!computed;\n- if (optionalSupported) {\n- node.optional = optional;\n- }\n- base = this.finishNode(node, \"MemberExpression\");\n- } else if (!noCalls && this.eat(types$1.parenL)) {\n- var refDestructuringErrors = new DestructuringErrors,\n- oldYieldPos = this.yieldPos,\n- oldAwaitPos = this.awaitPos,\n- oldAwaitIdentPos = this.awaitIdentPos;\n- this.yieldPos = 0;\n- this.awaitPos = 0;\n- this.awaitIdentPos = 0;\n- var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);\n- if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {\n- this.checkPatternErrors(refDestructuringErrors, false);\n- this.checkYieldAwaitInDefaultParams();\n- if (this.awaitIdentPos > 0) {\n- this.raise(this.awaitIdentPos, \"Cannot use 'await' as identifier inside an async function\");\n- }\n- this.yieldPos = oldYieldPos;\n- this.awaitPos = oldAwaitPos;\n- this.awaitIdentPos = oldAwaitIdentPos;\n- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)\n- }\n- this.checkExpressionErrors(refDestructuringErrors, true);\n- this.yieldPos = oldYieldPos || this.yieldPos;\n- this.awaitPos = oldAwaitPos || this.awaitPos;\n- this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;\n- var node$1 = this.startNodeAt(startPos, startLoc);\n- node$1.callee = base;\n- node$1.arguments = exprList;\n- if (optionalSupported) {\n- node$1.optional = optional;\n- }\n- base = this.finishNode(node$1, \"CallExpression\");\n- } else if (this.type === types$1.backQuote) {\n- if (optional || optionalChained) {\n- this.raise(this.start, \"Optional chaining cannot appear in the tag of tagged template expressions\");\n- }\n- var node$2 = this.startNodeAt(startPos, startLoc);\n- node$2.tag = base;\n- node$2.quasi = this.parseTemplate({\n- isTagged: true\n- });\n- base = this.finishNode(node$2, \"TaggedTemplateExpression\");\n- }\n- return base\n- };\n-\n- // Parse an atomic expression \u2014 either a single token that is an\n- // expression, an expression started by a keyword like `function` or\n- // `new`, or an expression wrapped in punctuation like `()`, `[]`,\n- // or `{}`.\n-\n- pp$5.parseExprAtom = function(refDestructuringErrors, forInit) {\n- // If a division operator appears in an expression position, the\n- // tokenizer got confused, and we force it to read a regexp instead.\n- if (this.type === types$1.slash) {\n- this.readRegexp();\n- }\n-\n- var node, canBeArrow = this.potentialArrowAt === this.start;\n- switch (this.type) {\n- case types$1._super:\n- if (!this.allowSuper) {\n- this.raise(this.start, \"'super' keyword outside a method\");\n+ var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);\n+ if (refDestructuringErrors && result.type === \"MemberExpression\") {\n+ if (refDestructuringErrors.parenthesizedAssign >= result.start) {\n+ refDestructuringErrors.parenthesizedAssign = -1;\n }\n- node = this.startNode();\n- this.next();\n- if (this.type === types$1.parenL && !this.allowDirectSuper) {\n- this.raise(node.start, \"super() call outside constructor of a subclass\");\n+ if (refDestructuringErrors.parenthesizedBind >= result.start) {\n+ refDestructuringErrors.parenthesizedBind = -1;\n }\n- // The `super` keyword can appear at below:\n- // SuperProperty:\n- // super [ Expression ]\n- // super . IdentifierName\n- // SuperCall:\n- // super ( Arguments )\n- if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) {\n- this.unexpected();\n+ if (refDestructuringErrors.trailingComma >= result.start) {\n+ refDestructuringErrors.trailingComma = -1;\n }\n- return this.finishNode(node, \"Super\")\n+ }\n+ return result\n+ };\n \n- case types$1._this:\n- node = this.startNode();\n- this.next();\n- return this.finishNode(node, \"ThisExpression\")\n+ pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {\n+ var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n+ this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&\n+ this.potentialArrowAt === base.start;\n+ var optionalChained = false;\n \n- case types$1.name:\n- var startPos = this.start,\n- startLoc = this.startLoc,\n- containsEsc = this.containsEsc;\n- var id = this.parseIdent(false);\n- if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(types$1._function)) {\n- this.overrideContext(types.f_expr);\n- return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)\n- }\n- if (canBeArrow && !this.canInsertSemicolon()) {\n- if (this.eat(types$1.arrow)) {\n- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit)\n- }\n- if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === types$1.name && !containsEsc &&\n- (!this.potentialArrowInForAwait || this.value !== \"of\" || this.containsEsc)) {\n- id = this.parseIdent(false);\n- if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) {\n- this.unexpected();\n- }\n- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)\n+ while (true) {\n+ var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);\n+\n+ if (element.optional) {\n+ optionalChained = true;\n+ }\n+ if (element === base || element.type === \"ArrowFunctionExpression\") {\n+ if (optionalChained) {\n+ var chainNode = this.startNodeAt(startPos, startLoc);\n+ chainNode.expression = element;\n+ element = this.finishNode(chainNode, \"ChainExpression\");\n }\n+ return element\n }\n- return id\n \n- case types$1.regexp:\n- var value = this.value;\n- node = this.parseLiteral(value.value);\n- node.regex = {\n- pattern: value.pattern,\n- flags: value.flags\n- };\n- return node\n+ base = element;\n+ }\n+ };\n \n- case types$1.num:\n- case types$1.string:\n- return this.parseLiteral(this.value)\n-\n- case types$1._null:\n- case types$1._true:\n- case types$1._false:\n- node = this.startNode();\n- node.value = this.type === types$1._null ? null : this.type === types$1._true;\n- node.raw = this.type.keyword;\n- this.next();\n- return this.finishNode(node, \"Literal\")\n+ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {\n+ var optionalSupported = this.options.ecmaVersion >= 11;\n+ var optional = optionalSupported && this.eat(types$1.questionDot);\n+ if (noCalls && optional) {\n+ this.raise(this.lastTokStart, \"Optional chaining cannot appear in the callee of new expressions\");\n+ }\n+\n+ var computed = this.eat(types$1.bracketL);\n+ if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {\n+ var node = this.startNodeAt(startPos, startLoc);\n+ node.object = base;\n+ if (computed) {\n+ node.property = this.parseExpression();\n+ this.expect(types$1.bracketR);\n+ } else if (this.type === types$1.privateId && base.type !== \"Super\") {\n+ node.property = this.parsePrivateIdent();\n+ } else {\n+ node.property = this.parseIdent(this.options.allowReserved !== \"never\");\n+ }\n+ node.computed = !!computed;\n+ if (optionalSupported) {\n+ node.optional = optional;\n+ }\n+ base = this.finishNode(node, \"MemberExpression\");\n+ } else if (!noCalls && this.eat(types$1.parenL)) {\n+ var refDestructuringErrors = new DestructuringErrors,\n+ oldYieldPos = this.yieldPos,\n+ oldAwaitPos = this.awaitPos,\n+ oldAwaitIdentPos = this.awaitIdentPos;\n+ this.yieldPos = 0;\n+ this.awaitPos = 0;\n+ this.awaitIdentPos = 0;\n+ var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);\n+ if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {\n+ this.checkPatternErrors(refDestructuringErrors, false);\n+ this.checkYieldAwaitInDefaultParams();\n+ if (this.awaitIdentPos > 0) {\n+ this.raise(this.awaitIdentPos, \"Cannot use 'await' as identifier inside an async function\");\n+ }\n+ this.yieldPos = oldYieldPos;\n+ this.awaitPos = oldAwaitPos;\n+ this.awaitIdentPos = oldAwaitIdentPos;\n+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)\n+ }\n+ this.checkExpressionErrors(refDestructuringErrors, true);\n+ this.yieldPos = oldYieldPos || this.yieldPos;\n+ this.awaitPos = oldAwaitPos || this.awaitPos;\n+ this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;\n+ var node$1 = this.startNodeAt(startPos, startLoc);\n+ node$1.callee = base;\n+ node$1.arguments = exprList;\n+ if (optionalSupported) {\n+ node$1.optional = optional;\n+ }\n+ base = this.finishNode(node$1, \"CallExpression\");\n+ } else if (this.type === types$1.backQuote) {\n+ if (optional || optionalChained) {\n+ this.raise(this.start, \"Optional chaining cannot appear in the tag of tagged template expressions\");\n+ }\n+ var node$2 = this.startNodeAt(startPos, startLoc);\n+ node$2.tag = base;\n+ node$2.quasi = this.parseTemplate({\n+ isTagged: true\n+ });\n+ base = this.finishNode(node$2, \"TaggedTemplateExpression\");\n+ }\n+ return base\n+ };\n+\n+ // Parse an atomic expression \u2014 either a single token that is an\n+ // expression, an expression started by a keyword like `function` or\n+ // `new`, or an expression wrapped in punctuation like `()`, `[]`,\n+ // or `{}`.\n+\n+ pp$5.parseExprAtom = function(refDestructuringErrors, forInit) {\n+ // If a division operator appears in an expression position, the\n+ // tokenizer got confused, and we force it to read a regexp instead.\n+ if (this.type === types$1.slash) {\n+ this.readRegexp();\n+ }\n \n- case types$1.parenL:\n- var start = this.start,\n- expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);\n- if (refDestructuringErrors) {\n- if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) {\n- refDestructuringErrors.parenthesizedAssign = start;\n+ var node, canBeArrow = this.potentialArrowAt === this.start;\n+ switch (this.type) {\n+ case types$1._super:\n+ if (!this.allowSuper) {\n+ this.raise(this.start, \"'super' keyword outside a method\");\n+ }\n+ node = this.startNode();\n+ this.next();\n+ if (this.type === types$1.parenL && !this.allowDirectSuper) {\n+ this.raise(node.start, \"super() call outside constructor of a subclass\");\n }\n- if (refDestructuringErrors.parenthesizedBind < 0) {\n- refDestructuringErrors.parenthesizedBind = start;\n+ // The `super` keyword can appear at below:\n+ // SuperProperty:\n+ // super [ Expression ]\n+ // super . IdentifierName\n+ // SuperCall:\n+ // super ( Arguments )\n+ if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) {\n+ this.unexpected();\n }\n- }\n- return expr\n+ return this.finishNode(node, \"Super\")\n \n- case types$1.bracketL:\n- node = this.startNode();\n- this.next();\n- node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);\n- return this.finishNode(node, \"ArrayExpression\")\n+ case types$1._this:\n+ node = this.startNode();\n+ this.next();\n+ return this.finishNode(node, \"ThisExpression\")\n \n- case types$1.braceL:\n- this.overrideContext(types.b_expr);\n- return this.parseObj(false, refDestructuringErrors)\n+ case types$1.name:\n+ var startPos = this.start,\n+ startLoc = this.startLoc,\n+ containsEsc = this.containsEsc;\n+ var id = this.parseIdent(false);\n+ if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(types$1._function)) {\n+ this.overrideContext(types.f_expr);\n+ return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)\n+ }\n+ if (canBeArrow && !this.canInsertSemicolon()) {\n+ if (this.eat(types$1.arrow)) {\n+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit)\n+ }\n+ if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === types$1.name && !containsEsc &&\n+ (!this.potentialArrowInForAwait || this.value !== \"of\" || this.containsEsc)) {\n+ id = this.parseIdent(false);\n+ if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) {\n+ this.unexpected();\n+ }\n+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)\n+ }\n+ }\n+ return id\n \n- case types$1._function:\n- node = this.startNode();\n- this.next();\n- return this.parseFunction(node, 0)\n+ case types$1.regexp:\n+ var value = this.value;\n+ node = this.parseLiteral(value.value);\n+ node.regex = {\n+ pattern: value.pattern,\n+ flags: value.flags\n+ };\n+ return node\n+\n+ case types$1.num:\n+ case types$1.string:\n+ return this.parseLiteral(this.value)\n+\n+ case types$1._null:\n+ case types$1._true:\n+ case types$1._false:\n+ node = this.startNode();\n+ node.value = this.type === types$1._null ? null : this.type === types$1._true;\n+ node.raw = this.type.keyword;\n+ this.next();\n+ return this.finishNode(node, \"Literal\")\n \n- case types$1._class:\n- return this.parseClass(this.startNode(), false)\n+ case types$1.parenL:\n+ var start = this.start,\n+ expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);\n+ if (refDestructuringErrors) {\n+ if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) {\n+ refDestructuringErrors.parenthesizedAssign = start;\n+ }\n+ if (refDestructuringErrors.parenthesizedBind < 0) {\n+ refDestructuringErrors.parenthesizedBind = start;\n+ }\n+ }\n+ return expr\n \n- case types$1._new:\n- return this.parseNew()\n+ case types$1.bracketL:\n+ node = this.startNode();\n+ this.next();\n+ node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);\n+ return this.finishNode(node, \"ArrayExpression\")\n \n- case types$1.backQuote:\n- return this.parseTemplate()\n+ case types$1.braceL:\n+ this.overrideContext(types.b_expr);\n+ return this.parseObj(false, refDestructuringErrors)\n \n- case types$1._import:\n- if (this.options.ecmaVersion >= 11) {\n- return this.parseExprImport()\n- } else {\n- return this.unexpected()\n- }\n+ case types$1._function:\n+ node = this.startNode();\n+ this.next();\n+ return this.parseFunction(node, 0)\n \n- default:\n- this.unexpected();\n- }\n- };\n+ case types$1._class:\n+ return this.parseClass(this.startNode(), false)\n \n- pp$5.parseExprImport = function() {\n- var node = this.startNode();\n+ case types$1._new:\n+ return this.parseNew()\n \n- // Consume `import` as an identifier for `import.meta`.\n- // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.\n- if (this.containsEsc) {\n- this.raiseRecoverable(this.start, \"Escape sequence in keyword import\");\n- }\n- var meta = this.parseIdent(true);\n-\n- switch (this.type) {\n- case types$1.parenL:\n- return this.parseDynamicImport(node)\n- case types$1.dot:\n- node.meta = meta;\n- return this.parseImportMeta(node)\n- default:\n- this.unexpected();\n- }\n- };\n+ case types$1.backQuote:\n+ return this.parseTemplate()\n+\n+ case types$1._import:\n+ if (this.options.ecmaVersion >= 11) {\n+ return this.parseExprImport()\n+ } else {\n+ return this.unexpected()\n+ }\n \n- pp$5.parseDynamicImport = function(node) {\n- this.next(); // skip `(`\n+ default:\n+ this.unexpected();\n+ }\n+ };\n \n- // Parse node.source.\n- node.source = this.parseMaybeAssign();\n+ pp$5.parseExprImport = function() {\n+ var node = this.startNode();\n \n- // Verify ending.\n- if (!this.eat(types$1.parenR)) {\n- var errorPos = this.start;\n- if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {\n- this.raiseRecoverable(errorPos, \"Trailing comma is not allowed in import()\");\n- } else {\n- this.unexpected(errorPos);\n+ // Consume `import` as an identifier for `import.meta`.\n+ // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.\n+ if (this.containsEsc) {\n+ this.raiseRecoverable(this.start, \"Escape sequence in keyword import\");\n }\n- }\n+ var meta = this.parseIdent(true);\n \n- return this.finishNode(node, \"ImportExpression\")\n- };\n+ switch (this.type) {\n+ case types$1.parenL:\n+ return this.parseDynamicImport(node)\n+ case types$1.dot:\n+ node.meta = meta;\n+ return this.parseImportMeta(node)\n+ default:\n+ this.unexpected();\n+ }\n+ };\n \n- pp$5.parseImportMeta = function(node) {\n- this.next(); // skip `.`\n+ pp$5.parseDynamicImport = function(node) {\n+ this.next(); // skip `(`\n \n- var containsEsc = this.containsEsc;\n- node.property = this.parseIdent(true);\n+ // Parse node.source.\n+ node.source = this.parseMaybeAssign();\n \n- if (node.property.name !== \"meta\") {\n- this.raiseRecoverable(node.property.start, \"The only valid meta property for import is 'import.meta'\");\n- }\n- if (containsEsc) {\n- this.raiseRecoverable(node.start, \"'import.meta' must not contain escaped characters\");\n- }\n- if (this.options.sourceType !== \"module\" && !this.options.allowImportExportEverywhere) {\n- this.raiseRecoverable(node.start, \"Cannot use 'import.meta' outside a module\");\n- }\n+ // Verify ending.\n+ if (!this.eat(types$1.parenR)) {\n+ var errorPos = this.start;\n+ if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {\n+ this.raiseRecoverable(errorPos, \"Trailing comma is not allowed in import()\");\n+ } else {\n+ this.unexpected(errorPos);\n+ }\n+ }\n \n- return this.finishNode(node, \"MetaProperty\")\n- };\n+ return this.finishNode(node, \"ImportExpression\")\n+ };\n \n- pp$5.parseLiteral = function(value) {\n- var node = this.startNode();\n- node.value = value;\n- node.raw = this.input.slice(this.start, this.end);\n- if (node.raw.charCodeAt(node.raw.length - 1) === 110) {\n- node.bigint = node.raw.slice(0, -1).replace(/_/g, \"\");\n- }\n- this.next();\n- return this.finishNode(node, \"Literal\")\n- };\n+ pp$5.parseImportMeta = function(node) {\n+ this.next(); // skip `.`\n \n- pp$5.parseParenExpression = function() {\n- this.expect(types$1.parenL);\n- var val = this.parseExpression();\n- this.expect(types$1.parenR);\n- return val\n- };\n+ var containsEsc = this.containsEsc;\n+ node.property = this.parseIdent(true);\n+\n+ if (node.property.name !== \"meta\") {\n+ this.raiseRecoverable(node.property.start, \"The only valid meta property for import is 'import.meta'\");\n+ }\n+ if (containsEsc) {\n+ this.raiseRecoverable(node.start, \"'import.meta' must not contain escaped characters\");\n+ }\n+ if (this.options.sourceType !== \"module\" && !this.options.allowImportExportEverywhere) {\n+ this.raiseRecoverable(node.start, \"Cannot use 'import.meta' outside a module\");\n+ }\n+\n+ return this.finishNode(node, \"MetaProperty\")\n+ };\n \n- pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {\n- var startPos = this.start,\n- startLoc = this.startLoc,\n- val, allowTrailingComma = this.options.ecmaVersion >= 8;\n- if (this.options.ecmaVersion >= 6) {\n+ pp$5.parseLiteral = function(value) {\n+ var node = this.startNode();\n+ node.value = value;\n+ node.raw = this.input.slice(this.start, this.end);\n+ if (node.raw.charCodeAt(node.raw.length - 1) === 110) {\n+ node.bigint = node.raw.slice(0, -1).replace(/_/g, \"\");\n+ }\n this.next();\n+ return this.finishNode(node, \"Literal\")\n+ };\n \n- var innerStartPos = this.start,\n- innerStartLoc = this.startLoc;\n- var exprList = [],\n- first = true,\n- lastIsComma = false;\n- var refDestructuringErrors = new DestructuringErrors,\n- oldYieldPos = this.yieldPos,\n- oldAwaitPos = this.awaitPos,\n- spreadStart;\n- this.yieldPos = 0;\n- this.awaitPos = 0;\n- // Do not save awaitIdentPos to allow checking awaits nested in parameters\n- while (this.type !== types$1.parenR) {\n- first ? first = false : this.expect(types$1.comma);\n- if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {\n- lastIsComma = true;\n- break\n- } else if (this.type === types$1.ellipsis) {\n- spreadStart = this.start;\n- exprList.push(this.parseParenItem(this.parseRestBinding()));\n- if (this.type === types$1.comma) {\n- this.raise(this.start, \"Comma is not permitted after the rest element\");\n+ pp$5.parseParenExpression = function() {\n+ this.expect(types$1.parenL);\n+ var val = this.parseExpression();\n+ this.expect(types$1.parenR);\n+ return val\n+ };\n+\n+ pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {\n+ var startPos = this.start,\n+ startLoc = this.startLoc,\n+ val, allowTrailingComma = this.options.ecmaVersion >= 8;\n+ if (this.options.ecmaVersion >= 6) {\n+ this.next();\n+\n+ var innerStartPos = this.start,\n+ innerStartLoc = this.startLoc;\n+ var exprList = [],\n+ first = true,\n+ lastIsComma = false;\n+ var refDestructuringErrors = new DestructuringErrors,\n+ oldYieldPos = this.yieldPos,\n+ oldAwaitPos = this.awaitPos,\n+ spreadStart;\n+ this.yieldPos = 0;\n+ this.awaitPos = 0;\n+ // Do not save awaitIdentPos to allow checking awaits nested in parameters\n+ while (this.type !== types$1.parenR) {\n+ first ? first = false : this.expect(types$1.comma);\n+ if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {\n+ lastIsComma = true;\n+ break\n+ } else if (this.type === types$1.ellipsis) {\n+ spreadStart = this.start;\n+ exprList.push(this.parseParenItem(this.parseRestBinding()));\n+ if (this.type === types$1.comma) {\n+ this.raise(this.start, \"Comma is not permitted after the rest element\");\n+ }\n+ break\n+ } else {\n+ exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));\n }\n- break\n+ }\n+ var innerEndPos = this.lastTokEnd,\n+ innerEndLoc = this.lastTokEndLoc;\n+ this.expect(types$1.parenR);\n+\n+ if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {\n+ this.checkPatternErrors(refDestructuringErrors, false);\n+ this.checkYieldAwaitInDefaultParams();\n+ this.yieldPos = oldYieldPos;\n+ this.awaitPos = oldAwaitPos;\n+ return this.parseParenArrowList(startPos, startLoc, exprList, forInit)\n+ }\n+\n+ if (!exprList.length || lastIsComma) {\n+ this.unexpected(this.lastTokStart);\n+ }\n+ if (spreadStart) {\n+ this.unexpected(spreadStart);\n+ }\n+ this.checkExpressionErrors(refDestructuringErrors, true);\n+ this.yieldPos = oldYieldPos || this.yieldPos;\n+ this.awaitPos = oldAwaitPos || this.awaitPos;\n+\n+ if (exprList.length > 1) {\n+ val = this.startNodeAt(innerStartPos, innerStartLoc);\n+ val.expressions = exprList;\n+ this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc);\n } else {\n- exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));\n+ val = exprList[0];\n }\n+ } else {\n+ val = this.parseParenExpression();\n }\n- var innerEndPos = this.lastTokEnd,\n- innerEndLoc = this.lastTokEndLoc;\n- this.expect(types$1.parenR);\n \n- if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {\n- this.checkPatternErrors(refDestructuringErrors, false);\n- this.checkYieldAwaitInDefaultParams();\n- this.yieldPos = oldYieldPos;\n- this.awaitPos = oldAwaitPos;\n- return this.parseParenArrowList(startPos, startLoc, exprList, forInit)\n- }\n-\n- if (!exprList.length || lastIsComma) {\n- this.unexpected(this.lastTokStart);\n- }\n- if (spreadStart) {\n- this.unexpected(spreadStart);\n- }\n- this.checkExpressionErrors(refDestructuringErrors, true);\n- this.yieldPos = oldYieldPos || this.yieldPos;\n- this.awaitPos = oldAwaitPos || this.awaitPos;\n-\n- if (exprList.length > 1) {\n- val = this.startNodeAt(innerStartPos, innerStartLoc);\n- val.expressions = exprList;\n- this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc);\n+ if (this.options.preserveParens) {\n+ var par = this.startNodeAt(startPos, startLoc);\n+ par.expression = val;\n+ return this.finishNode(par, \"ParenthesizedExpression\")\n } else {\n- val = exprList[0];\n+ return val\n }\n- } else {\n- val = this.parseParenExpression();\n- }\n-\n- if (this.options.preserveParens) {\n- var par = this.startNodeAt(startPos, startLoc);\n- par.expression = val;\n- return this.finishNode(par, \"ParenthesizedExpression\")\n- } else {\n- return val\n- }\n- };\n+ };\n \n- pp$5.parseParenItem = function(item) {\n- return item\n- };\n+ pp$5.parseParenItem = function(item) {\n+ return item\n+ };\n \n- pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {\n- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)\n- };\n+ pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {\n+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)\n+ };\n \n- // New's precedence is slightly tricky. It must allow its argument to\n- // be a `[]` or dot subscript expression, but not a call \u2014 at least,\n- // not without wrapping it in parentheses. Thus, it uses the noCalls\n- // argument to parseSubscripts to prevent it from consuming the\n- // argument list.\n-\n- var empty = [];\n-\n- pp$5.parseNew = function() {\n- if (this.containsEsc) {\n- this.raiseRecoverable(this.start, \"Escape sequence in keyword new\");\n- }\n- var node = this.startNode();\n- var meta = this.parseIdent(true);\n- if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) {\n- node.meta = meta;\n- var containsEsc = this.containsEsc;\n- node.property = this.parseIdent(true);\n- if (node.property.name !== \"target\") {\n- this.raiseRecoverable(node.property.start, \"The only valid meta property for new is 'new.target'\");\n+ // New's precedence is slightly tricky. It must allow its argument to\n+ // be a `[]` or dot subscript expression, but not a call \u2014 at least,\n+ // not without wrapping it in parentheses. Thus, it uses the noCalls\n+ // argument to parseSubscripts to prevent it from consuming the\n+ // argument list.\n+\n+ var empty = [];\n+\n+ pp$5.parseNew = function() {\n+ if (this.containsEsc) {\n+ this.raiseRecoverable(this.start, \"Escape sequence in keyword new\");\n }\n- if (containsEsc) {\n- this.raiseRecoverable(node.start, \"'new.target' must not contain escaped characters\");\n+ var node = this.startNode();\n+ var meta = this.parseIdent(true);\n+ if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) {\n+ node.meta = meta;\n+ var containsEsc = this.containsEsc;\n+ node.property = this.parseIdent(true);\n+ if (node.property.name !== \"target\") {\n+ this.raiseRecoverable(node.property.start, \"The only valid meta property for new is 'new.target'\");\n+ }\n+ if (containsEsc) {\n+ this.raiseRecoverable(node.start, \"'new.target' must not contain escaped characters\");\n+ }\n+ if (!this.allowNewDotTarget) {\n+ this.raiseRecoverable(node.start, \"'new.target' can only be used in functions and class static block\");\n+ }\n+ return this.finishNode(node, \"MetaProperty\")\n+ }\n+ var startPos = this.start,\n+ startLoc = this.startLoc,\n+ isImport = this.type === types$1._import;\n+ node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false);\n+ if (isImport && node.callee.type === \"ImportExpression\") {\n+ this.raise(startPos, \"Cannot use new with import()\");\n }\n- if (!this.allowNewDotTarget) {\n- this.raiseRecoverable(node.start, \"'new.target' can only be used in functions and class static block\");\n+ if (this.eat(types$1.parenL)) {\n+ node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);\n+ } else {\n+ node.arguments = empty;\n }\n- return this.finishNode(node, \"MetaProperty\")\n- }\n- var startPos = this.start,\n- startLoc = this.startLoc,\n- isImport = this.type === types$1._import;\n- node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false);\n- if (isImport && node.callee.type === \"ImportExpression\") {\n- this.raise(startPos, \"Cannot use new with import()\");\n- }\n- if (this.eat(types$1.parenL)) {\n- node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);\n- } else {\n- node.arguments = empty;\n- }\n- return this.finishNode(node, \"NewExpression\")\n- };\n+ return this.finishNode(node, \"NewExpression\")\n+ };\n \n- // Parse template expression.\n+ // Parse template expression.\n \n- pp$5.parseTemplateElement = function(ref) {\n- var isTagged = ref.isTagged;\n+ pp$5.parseTemplateElement = function(ref) {\n+ var isTagged = ref.isTagged;\n \n- var elem = this.startNode();\n- if (this.type === types$1.invalidTemplate) {\n- if (!isTagged) {\n- this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\");\n- }\n- elem.value = {\n- raw: this.value,\n- cooked: null\n- };\n- } else {\n- elem.value = {\n- raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n- cooked: this.value\n- };\n- }\n- this.next();\n- elem.tail = this.type === types$1.backQuote;\n- return this.finishNode(elem, \"TemplateElement\")\n- };\n+ var elem = this.startNode();\n+ if (this.type === types$1.invalidTemplate) {\n+ if (!isTagged) {\n+ this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\");\n+ }\n+ elem.value = {\n+ raw: this.value,\n+ cooked: null\n+ };\n+ } else {\n+ elem.value = {\n+ raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n+ cooked: this.value\n+ };\n+ }\n+ this.next();\n+ elem.tail = this.type === types$1.backQuote;\n+ return this.finishNode(elem, \"TemplateElement\")\n+ };\n \n- pp$5.parseTemplate = function(ref) {\n- if (ref === void 0) ref = {};\n- var isTagged = ref.isTagged;\n- if (isTagged === void 0) isTagged = false;\n-\n- var node = this.startNode();\n- this.next();\n- node.expressions = [];\n- var curElt = this.parseTemplateElement({\n- isTagged: isTagged\n- });\n- node.quasis = [curElt];\n- while (!curElt.tail) {\n- if (this.type === types$1.eof) {\n- this.raise(this.pos, \"Unterminated template literal\");\n- }\n- this.expect(types$1.dollarBraceL);\n- node.expressions.push(this.parseExpression());\n- this.expect(types$1.braceR);\n- node.quasis.push(curElt = this.parseTemplateElement({\n+ pp$5.parseTemplate = function(ref) {\n+ if (ref === void 0) ref = {};\n+ var isTagged = ref.isTagged;\n+ if (isTagged === void 0) isTagged = false;\n+\n+ var node = this.startNode();\n+ this.next();\n+ node.expressions = [];\n+ var curElt = this.parseTemplateElement({\n isTagged: isTagged\n- }));\n- }\n- this.next();\n- return this.finishNode(node, \"TemplateLiteral\")\n- };\n+ });\n+ node.quasis = [curElt];\n+ while (!curElt.tail) {\n+ if (this.type === types$1.eof) {\n+ this.raise(this.pos, \"Unterminated template literal\");\n+ }\n+ this.expect(types$1.dollarBraceL);\n+ node.expressions.push(this.parseExpression());\n+ this.expect(types$1.braceR);\n+ node.quasis.push(curElt = this.parseTemplateElement({\n+ isTagged: isTagged\n+ }));\n+ }\n+ this.next();\n+ return this.finishNode(node, \"TemplateLiteral\")\n+ };\n \n- pp$5.isAsyncProp = function(prop) {\n- return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n- (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&\n- !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n- };\n+ pp$5.isAsyncProp = function(prop) {\n+ return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n+ (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&\n+ !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n+ };\n \n- // Parse an object literal or binding pattern.\n+ // Parse an object literal or binding pattern.\n \n- pp$5.parseObj = function(isPattern, refDestructuringErrors) {\n- var node = this.startNode(),\n- first = true,\n- propHash = {};\n- node.properties = [];\n- this.next();\n- while (!this.eat(types$1.braceR)) {\n- if (!first) {\n- this.expect(types$1.comma);\n- if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) {\n- break\n+ pp$5.parseObj = function(isPattern, refDestructuringErrors) {\n+ var node = this.startNode(),\n+ first = true,\n+ propHash = {};\n+ node.properties = [];\n+ this.next();\n+ while (!this.eat(types$1.braceR)) {\n+ if (!first) {\n+ this.expect(types$1.comma);\n+ if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) {\n+ break\n+ }\n+ } else {\n+ first = false;\n }\n- } else {\n- first = false;\n- }\n \n- var prop = this.parseProperty(isPattern, refDestructuringErrors);\n- if (!isPattern) {\n- this.checkPropClash(prop, propHash, refDestructuringErrors);\n+ var prop = this.parseProperty(isPattern, refDestructuringErrors);\n+ if (!isPattern) {\n+ this.checkPropClash(prop, propHash, refDestructuringErrors);\n+ }\n+ node.properties.push(prop);\n }\n- node.properties.push(prop);\n- }\n- return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n- };\n+ return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n+ };\n \n- pp$5.parseProperty = function(isPattern, refDestructuringErrors) {\n- var prop = this.startNode(),\n- isGenerator, isAsync, startPos, startLoc;\n- if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {\n- if (isPattern) {\n- prop.argument = this.parseIdent(false);\n- if (this.type === types$1.comma) {\n- this.raise(this.start, \"Comma is not permitted after the rest element\");\n- }\n- return this.finishNode(prop, \"RestElement\")\n- }\n- // Parse argument.\n- prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n- // To disallow trailing comma via `this.toAssignable()`.\n- if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n- refDestructuringErrors.trailingComma = this.start;\n- }\n- // Finish\n- return this.finishNode(prop, \"SpreadElement\")\n- }\n- if (this.options.ecmaVersion >= 6) {\n- prop.method = false;\n- prop.shorthand = false;\n- if (isPattern || refDestructuringErrors) {\n- startPos = this.start;\n- startLoc = this.startLoc;\n+ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {\n+ var prop = this.startNode(),\n+ isGenerator, isAsync, startPos, startLoc;\n+ if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {\n+ if (isPattern) {\n+ prop.argument = this.parseIdent(false);\n+ if (this.type === types$1.comma) {\n+ this.raise(this.start, \"Comma is not permitted after the rest element\");\n+ }\n+ return this.finishNode(prop, \"RestElement\")\n+ }\n+ // Parse argument.\n+ prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n+ // To disallow trailing comma via `this.toAssignable()`.\n+ if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n+ refDestructuringErrors.trailingComma = this.start;\n+ }\n+ // Finish\n+ return this.finishNode(prop, \"SpreadElement\")\n }\n- if (!isPattern) {\n- isGenerator = this.eat(types$1.star);\n+ if (this.options.ecmaVersion >= 6) {\n+ prop.method = false;\n+ prop.shorthand = false;\n+ if (isPattern || refDestructuringErrors) {\n+ startPos = this.start;\n+ startLoc = this.startLoc;\n+ }\n+ if (!isPattern) {\n+ isGenerator = this.eat(types$1.star);\n+ }\n }\n- }\n- var containsEsc = this.containsEsc;\n- this.parsePropertyName(prop);\n- if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n- isAsync = true;\n- isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);\n- this.parsePropertyName(prop, refDestructuringErrors);\n- } else {\n- isAsync = false;\n- }\n- this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);\n- return this.finishNode(prop, \"Property\")\n- };\n-\n- pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n- if ((isGenerator || isAsync) && this.type === types$1.colon) {\n- this.unexpected();\n- }\n-\n- if (this.eat(types$1.colon)) {\n- prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);\n- prop.kind = \"init\";\n- } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {\n- if (isPattern) {\n- this.unexpected();\n+ var containsEsc = this.containsEsc;\n+ this.parsePropertyName(prop);\n+ if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n+ isAsync = true;\n+ isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);\n+ this.parsePropertyName(prop, refDestructuringErrors);\n+ } else {\n+ isAsync = false;\n }\n- prop.kind = \"init\";\n- prop.method = true;\n- prop.value = this.parseMethod(isGenerator, isAsync);\n- } else if (!isPattern && !containsEsc &&\n- this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n- (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n- (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {\n- if (isGenerator || isAsync) {\n+ this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);\n+ return this.finishNode(prop, \"Property\")\n+ };\n+\n+ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n+ if ((isGenerator || isAsync) && this.type === types$1.colon) {\n this.unexpected();\n }\n- prop.kind = prop.key.name;\n- this.parsePropertyName(prop);\n- prop.value = this.parseMethod(false);\n- var paramCount = prop.kind === \"get\" ? 0 : 1;\n- if (prop.value.params.length !== paramCount) {\n- var start = prop.value.start;\n- if (prop.kind === \"get\") {\n- this.raiseRecoverable(start, \"getter should have no params\");\n+\n+ if (this.eat(types$1.colon)) {\n+ prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);\n+ prop.kind = \"init\";\n+ } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {\n+ if (isPattern) {\n+ this.unexpected();\n+ }\n+ prop.kind = \"init\";\n+ prop.method = true;\n+ prop.value = this.parseMethod(isGenerator, isAsync);\n+ } else if (!isPattern && !containsEsc &&\n+ this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n+ (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n+ (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {\n+ if (isGenerator || isAsync) {\n+ this.unexpected();\n+ }\n+ prop.kind = prop.key.name;\n+ this.parsePropertyName(prop);\n+ prop.value = this.parseMethod(false);\n+ var paramCount = prop.kind === \"get\" ? 0 : 1;\n+ if (prop.value.params.length !== paramCount) {\n+ var start = prop.value.start;\n+ if (prop.kind === \"get\") {\n+ this.raiseRecoverable(start, \"getter should have no params\");\n+ } else {\n+ this.raiseRecoverable(start, \"setter should have exactly one param\");\n+ }\n } else {\n- this.raiseRecoverable(start, \"setter should have exactly one param\");\n+ if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\") {\n+ this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\");\n+ }\n }\n- } else {\n- if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\") {\n- this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\");\n+ } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n+ if (isGenerator || isAsync) {\n+ this.unexpected();\n }\n- }\n- } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n- if (isGenerator || isAsync) {\n+ this.checkUnreserved(prop.key);\n+ if (prop.key.name === \"await\" && !this.awaitIdentPos) {\n+ this.awaitIdentPos = startPos;\n+ }\n+ prop.kind = \"init\";\n+ if (isPattern) {\n+ prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n+ } else if (this.type === types$1.eq && refDestructuringErrors) {\n+ if (refDestructuringErrors.shorthandAssign < 0) {\n+ refDestructuringErrors.shorthandAssign = this.start;\n+ }\n+ prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n+ } else {\n+ prop.value = this.copyNode(prop.key);\n+ }\n+ prop.shorthand = true;\n+ } else {\n this.unexpected();\n }\n- this.checkUnreserved(prop.key);\n- if (prop.key.name === \"await\" && !this.awaitIdentPos) {\n- this.awaitIdentPos = startPos;\n- }\n- prop.kind = \"init\";\n- if (isPattern) {\n- prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n- } else if (this.type === types$1.eq && refDestructuringErrors) {\n- if (refDestructuringErrors.shorthandAssign < 0) {\n- refDestructuringErrors.shorthandAssign = this.start;\n+ };\n+\n+ pp$5.parsePropertyName = function(prop) {\n+ if (this.options.ecmaVersion >= 6) {\n+ if (this.eat(types$1.bracketL)) {\n+ prop.computed = true;\n+ prop.key = this.parseMaybeAssign();\n+ this.expect(types$1.bracketR);\n+ return prop.key\n+ } else {\n+ prop.computed = false;\n }\n- prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n- } else {\n- prop.value = this.copyNode(prop.key);\n }\n- prop.shorthand = true;\n- } else {\n- this.unexpected();\n- }\n- };\n+ return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== \"never\")\n+ };\n \n- pp$5.parsePropertyName = function(prop) {\n- if (this.options.ecmaVersion >= 6) {\n- if (this.eat(types$1.bracketL)) {\n- prop.computed = true;\n- prop.key = this.parseMaybeAssign();\n- this.expect(types$1.bracketR);\n- return prop.key\n- } else {\n- prop.computed = false;\n+ // Initialize empty function node.\n+\n+ pp$5.initFunction = function(node) {\n+ node.id = null;\n+ if (this.options.ecmaVersion >= 6) {\n+ node.generator = node.expression = false;\n }\n- }\n- return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== \"never\")\n- };\n+ if (this.options.ecmaVersion >= 8) {\n+ node.async = false;\n+ }\n+ };\n \n- // Initialize empty function node.\n+ // Parse object or class method.\n \n- pp$5.initFunction = function(node) {\n- node.id = null;\n- if (this.options.ecmaVersion >= 6) {\n- node.generator = node.expression = false;\n- }\n- if (this.options.ecmaVersion >= 8) {\n- node.async = false;\n- }\n- };\n+ pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n+ var node = this.startNode(),\n+ oldYieldPos = this.yieldPos,\n+ oldAwaitPos = this.awaitPos,\n+ oldAwaitIdentPos = this.awaitIdentPos;\n \n- // Parse object or class method.\n+ this.initFunction(node);\n+ if (this.options.ecmaVersion >= 6) {\n+ node.generator = isGenerator;\n+ }\n+ if (this.options.ecmaVersion >= 8) {\n+ node.async = !!isAsync;\n+ }\n \n- pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n- var node = this.startNode(),\n- oldYieldPos = this.yieldPos,\n- oldAwaitPos = this.awaitPos,\n- oldAwaitIdentPos = this.awaitIdentPos;\n-\n- this.initFunction(node);\n- if (this.options.ecmaVersion >= 6) {\n- node.generator = isGenerator;\n- }\n- if (this.options.ecmaVersion >= 8) {\n- node.async = !!isAsync;\n- }\n-\n- this.yieldPos = 0;\n- this.awaitPos = 0;\n- this.awaitIdentPos = 0;\n- this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));\n-\n- this.expect(types$1.parenL);\n- node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n- this.checkYieldAwaitInDefaultParams();\n- this.parseFunctionBody(node, false, true, false);\n-\n- this.yieldPos = oldYieldPos;\n- this.awaitPos = oldAwaitPos;\n- this.awaitIdentPos = oldAwaitIdentPos;\n- return this.finishNode(node, \"FunctionExpression\")\n- };\n+ this.yieldPos = 0;\n+ this.awaitPos = 0;\n+ this.awaitIdentPos = 0;\n+ this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));\n \n- // Parse arrow function expression with given parameters.\n+ this.expect(types$1.parenL);\n+ node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n+ this.checkYieldAwaitInDefaultParams();\n+ this.parseFunctionBody(node, false, true, false);\n+\n+ this.yieldPos = oldYieldPos;\n+ this.awaitPos = oldAwaitPos;\n+ this.awaitIdentPos = oldAwaitIdentPos;\n+ return this.finishNode(node, \"FunctionExpression\")\n+ };\n \n- pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {\n- var oldYieldPos = this.yieldPos,\n- oldAwaitPos = this.awaitPos,\n- oldAwaitIdentPos = this.awaitIdentPos;\n-\n- this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);\n- this.initFunction(node);\n- if (this.options.ecmaVersion >= 8) {\n- node.async = !!isAsync;\n- }\n-\n- this.yieldPos = 0;\n- this.awaitPos = 0;\n- this.awaitIdentPos = 0;\n-\n- node.params = this.toAssignableList(params, true);\n- this.parseFunctionBody(node, true, false, forInit);\n-\n- this.yieldPos = oldYieldPos;\n- this.awaitPos = oldAwaitPos;\n- this.awaitIdentPos = oldAwaitIdentPos;\n- return this.finishNode(node, \"ArrowFunctionExpression\")\n- };\n+ // Parse arrow function expression with given parameters.\n \n- // Parse function body and check parameters.\n+ pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {\n+ var oldYieldPos = this.yieldPos,\n+ oldAwaitPos = this.awaitPos,\n+ oldAwaitIdentPos = this.awaitIdentPos;\n \n- pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {\n- var isExpression = isArrowFunction && this.type !== types$1.braceL;\n- var oldStrict = this.strict,\n- useStrict = false;\n-\n- if (isExpression) {\n- node.body = this.parseMaybeAssign(forInit);\n- node.expression = true;\n- this.checkParams(node, false);\n- } else {\n- var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);\n- if (!oldStrict || nonSimple) {\n- useStrict = this.strictDirective(this.end);\n- // If this is a strict mode function, verify that argument names\n- // are not repeated, and it does not try to bind the words `eval`\n- // or `arguments`.\n- if (useStrict && nonSimple) {\n- this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\");\n- }\n- }\n- // Start a new scope with regard to labels and the `inFunction`\n- // flag (restore them to their old value afterwards).\n- var oldLabels = this.labels;\n- this.labels = [];\n- if (useStrict) {\n- this.strict = true;\n+ this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);\n+ this.initFunction(node);\n+ if (this.options.ecmaVersion >= 8) {\n+ node.async = !!isAsync;\n }\n \n- // Add the params to varDeclaredNames to ensure that an error is thrown\n- // if a let/const declaration in the function clashes with one of the params.\n- this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));\n- // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n- if (this.strict && node.id) {\n- this.checkLValSimple(node.id, BIND_OUTSIDE);\n- }\n- node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);\n- node.expression = false;\n- this.adaptDirectivePrologue(node.body.body);\n- this.labels = oldLabels;\n- }\n- this.exitScope();\n- };\n+ this.yieldPos = 0;\n+ this.awaitPos = 0;\n+ this.awaitIdentPos = 0;\n \n- pp$5.isSimpleParamList = function(params) {\n- for (var i = 0, list = params; i < list.length; i += 1) {\n- var param = list[i];\n+ node.params = this.toAssignableList(params, true);\n+ this.parseFunctionBody(node, true, false, forInit);\n \n- if (param.type !== \"Identifier\") {\n- return false\n+ this.yieldPos = oldYieldPos;\n+ this.awaitPos = oldAwaitPos;\n+ this.awaitIdentPos = oldAwaitIdentPos;\n+ return this.finishNode(node, \"ArrowFunctionExpression\")\n+ };\n+\n+ // Parse function body and check parameters.\n+\n+ pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {\n+ var isExpression = isArrowFunction && this.type !== types$1.braceL;\n+ var oldStrict = this.strict,\n+ useStrict = false;\n+\n+ if (isExpression) {\n+ node.body = this.parseMaybeAssign(forInit);\n+ node.expression = true;\n+ this.checkParams(node, false);\n+ } else {\n+ var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);\n+ if (!oldStrict || nonSimple) {\n+ useStrict = this.strictDirective(this.end);\n+ // If this is a strict mode function, verify that argument names\n+ // are not repeated, and it does not try to bind the words `eval`\n+ // or `arguments`.\n+ if (useStrict && nonSimple) {\n+ this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\");\n+ }\n+ }\n+ // Start a new scope with regard to labels and the `inFunction`\n+ // flag (restore them to their old value afterwards).\n+ var oldLabels = this.labels;\n+ this.labels = [];\n+ if (useStrict) {\n+ this.strict = true;\n+ }\n+\n+ // Add the params to varDeclaredNames to ensure that an error is thrown\n+ // if a let/const declaration in the function clashes with one of the params.\n+ this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));\n+ // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n+ if (this.strict && node.id) {\n+ this.checkLValSimple(node.id, BIND_OUTSIDE);\n+ }\n+ node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);\n+ node.expression = false;\n+ this.adaptDirectivePrologue(node.body.body);\n+ this.labels = oldLabels;\n }\n- }\n- return true\n- };\n+ this.exitScope();\n+ };\n \n- // Checks function params for various disallowed patterns such as using \"eval\"\n- // or \"arguments\" and duplicate parameters.\n+ pp$5.isSimpleParamList = function(params) {\n+ for (var i = 0, list = params; i < list.length; i += 1) {\n+ var param = list[i];\n \n- pp$5.checkParams = function(node, allowDuplicates) {\n- var nameHash = Object.create(null);\n- for (var i = 0, list = node.params; i < list.length; i += 1) {\n- var param = list[i];\n+ if (param.type !== \"Identifier\") {\n+ return false\n+ }\n+ }\n+ return true\n+ };\n \n- this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);\n- }\n- };\n+ // Checks function params for various disallowed patterns such as using \"eval\"\n+ // or \"arguments\" and duplicate parameters.\n \n- // Parses a comma-separated list of expressions, and returns them as\n- // an array. `close` is the token type that ends the list, and\n- // `allowEmpty` can be turned on to allow subsequent commas with\n- // nothing in between them to be parsed as `null` (which is needed\n- // for array literals).\n-\n- pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n- var elts = [],\n- first = true;\n- while (!this.eat(close)) {\n- if (!first) {\n- this.expect(types$1.comma);\n- if (allowTrailingComma && this.afterTrailingComma(close)) {\n- break\n+ pp$5.checkParams = function(node, allowDuplicates) {\n+ var nameHash = Object.create(null);\n+ for (var i = 0, list = node.params; i < list.length; i += 1) {\n+ var param = list[i];\n+\n+ this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);\n+ }\n+ };\n+\n+ // Parses a comma-separated list of expressions, and returns them as\n+ // an array. `close` is the token type that ends the list, and\n+ // `allowEmpty` can be turned on to allow subsequent commas with\n+ // nothing in between them to be parsed as `null` (which is needed\n+ // for array literals).\n+\n+ pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n+ var elts = [],\n+ first = true;\n+ while (!this.eat(close)) {\n+ if (!first) {\n+ this.expect(types$1.comma);\n+ if (allowTrailingComma && this.afterTrailingComma(close)) {\n+ break\n+ }\n+ } else {\n+ first = false;\n }\n- } else {\n- first = false;\n+\n+ var elt = (void 0);\n+ if (allowEmpty && this.type === types$1.comma) {\n+ elt = null;\n+ } else if (this.type === types$1.ellipsis) {\n+ elt = this.parseSpread(refDestructuringErrors);\n+ if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) {\n+ refDestructuringErrors.trailingComma = this.start;\n+ }\n+ } else {\n+ elt = this.parseMaybeAssign(false, refDestructuringErrors);\n+ }\n+ elts.push(elt);\n }\n+ return elts\n+ };\n \n- var elt = (void 0);\n- if (allowEmpty && this.type === types$1.comma) {\n- elt = null;\n- } else if (this.type === types$1.ellipsis) {\n- elt = this.parseSpread(refDestructuringErrors);\n- if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) {\n- refDestructuringErrors.trailingComma = this.start;\n+ pp$5.checkUnreserved = function(ref) {\n+ var start = ref.start;\n+ var end = ref.end;\n+ var name = ref.name;\n+\n+ if (this.inGenerator && name === \"yield\") {\n+ this.raiseRecoverable(start, \"Cannot use 'yield' as identifier inside a generator\");\n+ }\n+ if (this.inAsync && name === \"await\") {\n+ this.raiseRecoverable(start, \"Cannot use 'await' as identifier inside an async function\");\n+ }\n+ if (this.currentThisScope().inClassFieldInit && name === \"arguments\") {\n+ this.raiseRecoverable(start, \"Cannot use 'arguments' in class field initializer\");\n+ }\n+ if (this.inClassStaticBlock && (name === \"arguments\" || name === \"await\")) {\n+ this.raise(start, (\"Cannot use \" + name + \" in class static initialization block\"));\n+ }\n+ if (this.keywords.test(name)) {\n+ this.raise(start, (\"Unexpected keyword '\" + name + \"'\"));\n+ }\n+ if (this.options.ecmaVersion < 6 &&\n+ this.input.slice(start, end).indexOf(\"\\\\\") !== -1) {\n+ return\n+ }\n+ var re = this.strict ? this.reservedWordsStrict : this.reservedWords;\n+ if (re.test(name)) {\n+ if (!this.inAsync && name === \"await\") {\n+ this.raiseRecoverable(start, \"Cannot use keyword 'await' outside an async function\");\n }\n- } else {\n- elt = this.parseMaybeAssign(false, refDestructuringErrors);\n+ this.raiseRecoverable(start, (\"The keyword '\" + name + \"' is reserved\"));\n }\n- elts.push(elt);\n- }\n- return elts\n- };\n+ };\n \n- pp$5.checkUnreserved = function(ref) {\n- var start = ref.start;\n- var end = ref.end;\n- var name = ref.name;\n+ // Parse the next token as an identifier. If `liberal` is true (used\n+ // when parsing properties), it will also convert keywords into\n+ // identifiers.\n \n- if (this.inGenerator && name === \"yield\") {\n- this.raiseRecoverable(start, \"Cannot use 'yield' as identifier inside a generator\");\n- }\n- if (this.inAsync && name === \"await\") {\n- this.raiseRecoverable(start, \"Cannot use 'await' as identifier inside an async function\");\n- }\n- if (this.currentThisScope().inClassFieldInit && name === \"arguments\") {\n- this.raiseRecoverable(start, \"Cannot use 'arguments' in class field initializer\");\n- }\n- if (this.inClassStaticBlock && (name === \"arguments\" || name === \"await\")) {\n- this.raise(start, (\"Cannot use \" + name + \" in class static initialization block\"));\n- }\n- if (this.keywords.test(name)) {\n- this.raise(start, (\"Unexpected keyword '\" + name + \"'\"));\n- }\n- if (this.options.ecmaVersion < 6 &&\n- this.input.slice(start, end).indexOf(\"\\\\\") !== -1) {\n- return\n- }\n- var re = this.strict ? this.reservedWordsStrict : this.reservedWords;\n- if (re.test(name)) {\n- if (!this.inAsync && name === \"await\") {\n- this.raiseRecoverable(start, \"Cannot use keyword 'await' outside an async function\");\n+ pp$5.parseIdent = function(liberal, isBinding) {\n+ var node = this.startNode();\n+ if (this.type === types$1.name) {\n+ node.name = this.value;\n+ } else if (this.type.keyword) {\n+ node.name = this.type.keyword;\n+\n+ // To fix https://github.com/acornjs/acorn/issues/575\n+ // `class` and `function` keywords push new context into this.context.\n+ // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n+ // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n+ if ((node.name === \"class\" || node.name === \"function\") &&\n+ (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n+ this.context.pop();\n+ }\n+ } else {\n+ this.unexpected();\n }\n- this.raiseRecoverable(start, (\"The keyword '\" + name + \"' is reserved\"));\n- }\n- };\n+ this.next(!!liberal);\n+ this.finishNode(node, \"Identifier\");\n+ if (!liberal) {\n+ this.checkUnreserved(node);\n+ if (node.name === \"await\" && !this.awaitIdentPos) {\n+ this.awaitIdentPos = node.start;\n+ }\n+ }\n+ return node\n+ };\n \n- // Parse the next token as an identifier. If `liberal` is true (used\n- // when parsing properties), it will also convert keywords into\n- // identifiers.\n-\n- pp$5.parseIdent = function(liberal, isBinding) {\n- var node = this.startNode();\n- if (this.type === types$1.name) {\n- node.name = this.value;\n- } else if (this.type.keyword) {\n- node.name = this.type.keyword;\n-\n- // To fix https://github.com/acornjs/acorn/issues/575\n- // `class` and `function` keywords push new context into this.context.\n- // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n- // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n- if ((node.name === \"class\" || node.name === \"function\") &&\n- (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n- this.context.pop();\n+ pp$5.parsePrivateIdent = function() {\n+ var node = this.startNode();\n+ if (this.type === types$1.privateId) {\n+ node.name = this.value;\n+ } else {\n+ this.unexpected();\n }\n- } else {\n- this.unexpected();\n- }\n- this.next(!!liberal);\n- this.finishNode(node, \"Identifier\");\n- if (!liberal) {\n- this.checkUnreserved(node);\n- if (node.name === \"await\" && !this.awaitIdentPos) {\n- this.awaitIdentPos = node.start;\n+ this.next();\n+ this.finishNode(node, \"PrivateIdentifier\");\n+\n+ // For validating existence\n+ if (this.privateNameStack.length === 0) {\n+ this.raise(node.start, (\"Private field '#\" + (node.name) + \"' must be declared in an enclosing class\"));\n+ } else {\n+ this.privateNameStack[this.privateNameStack.length - 1].used.push(node);\n }\n- }\n- return node\n- };\n \n- pp$5.parsePrivateIdent = function() {\n- var node = this.startNode();\n- if (this.type === types$1.privateId) {\n- node.name = this.value;\n- } else {\n- this.unexpected();\n- }\n- this.next();\n- this.finishNode(node, \"PrivateIdentifier\");\n-\n- // For validating existence\n- if (this.privateNameStack.length === 0) {\n- this.raise(node.start, (\"Private field '#\" + (node.name) + \"' must be declared in an enclosing class\"));\n- } else {\n- this.privateNameStack[this.privateNameStack.length - 1].used.push(node);\n- }\n+ return node\n+ };\n \n- return node\n- };\n+ // Parses yield expression inside generator.\n \n- // Parses yield expression inside generator.\n+ pp$5.parseYield = function(forInit) {\n+ if (!this.yieldPos) {\n+ this.yieldPos = this.start;\n+ }\n \n- pp$5.parseYield = function(forInit) {\n- if (!this.yieldPos) {\n- this.yieldPos = this.start;\n- }\n-\n- var node = this.startNode();\n- this.next();\n- if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {\n- node.delegate = false;\n- node.argument = null;\n- } else {\n- node.delegate = this.eat(types$1.star);\n- node.argument = this.parseMaybeAssign(forInit);\n- }\n- return this.finishNode(node, \"YieldExpression\")\n- };\n+ var node = this.startNode();\n+ this.next();\n+ if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {\n+ node.delegate = false;\n+ node.argument = null;\n+ } else {\n+ node.delegate = this.eat(types$1.star);\n+ node.argument = this.parseMaybeAssign(forInit);\n+ }\n+ return this.finishNode(node, \"YieldExpression\")\n+ };\n \n- pp$5.parseAwait = function(forInit) {\n- if (!this.awaitPos) {\n- this.awaitPos = this.start;\n- }\n+ pp$5.parseAwait = function(forInit) {\n+ if (!this.awaitPos) {\n+ this.awaitPos = this.start;\n+ }\n \n- var node = this.startNode();\n- this.next();\n- node.argument = this.parseMaybeUnary(null, true, false, forInit);\n- return this.finishNode(node, \"AwaitExpression\")\n- };\n+ var node = this.startNode();\n+ this.next();\n+ node.argument = this.parseMaybeUnary(null, true, false, forInit);\n+ return this.finishNode(node, \"AwaitExpression\")\n+ };\n \n- var pp$4 = Parser.prototype;\n+ var pp$4 = Parser.prototype;\n \n- // This function is used to raise exceptions on parse errors. It\n- // takes an offset integer (into the current `input`) to indicate\n- // the location of the error, attaches the position to the end\n- // of the error message, and then raises a `SyntaxError` with that\n- // message.\n-\n- pp$4.raise = function(pos, message) {\n- var loc = getLineInfo(this.input, pos);\n- message += \" (\" + loc.line + \":\" + loc.column + \")\";\n- var err = new SyntaxError(message);\n- err.pos = pos;\n- err.loc = loc;\n- err.raisedAt = this.pos;\n- throw err\n- };\n+ // This function is used to raise exceptions on parse errors. It\n+ // takes an offset integer (into the current `input`) to indicate\n+ // the location of the error, attaches the position to the end\n+ // of the error message, and then raises a `SyntaxError` with that\n+ // message.\n+\n+ pp$4.raise = function(pos, message) {\n+ var loc = getLineInfo(this.input, pos);\n+ message += \" (\" + loc.line + \":\" + loc.column + \")\";\n+ var err = new SyntaxError(message);\n+ err.pos = pos;\n+ err.loc = loc;\n+ err.raisedAt = this.pos;\n+ throw err\n+ };\n \n- pp$4.raiseRecoverable = pp$4.raise;\n+ pp$4.raiseRecoverable = pp$4.raise;\n \n- pp$4.curPosition = function() {\n- if (this.options.locations) {\n- return new Position(this.curLine, this.pos - this.lineStart)\n- }\n- };\n+ pp$4.curPosition = function() {\n+ if (this.options.locations) {\n+ return new Position(this.curLine, this.pos - this.lineStart)\n+ }\n+ };\n \n- var pp$3 = Parser.prototype;\n+ var pp$3 = Parser.prototype;\n \n- var Scope = function Scope(flags) {\n- this.flags = flags;\n- // A list of var-declared names in the current lexical scope\n- this.var = [];\n- // A list of lexically-declared names in the current lexical scope\n- this.lexical = [];\n- // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n- this.functions = [];\n- // A switch to disallow the identifier reference 'arguments'\n- this.inClassFieldInit = false;\n- };\n+ var Scope = function Scope(flags) {\n+ this.flags = flags;\n+ // A list of var-declared names in the current lexical scope\n+ this.var = [];\n+ // A list of lexically-declared names in the current lexical scope\n+ this.lexical = [];\n+ // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n+ this.functions = [];\n+ // A switch to disallow the identifier reference 'arguments'\n+ this.inClassFieldInit = false;\n+ };\n \n- // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n+ // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n \n- pp$3.enterScope = function(flags) {\n- this.scopeStack.push(new Scope(flags));\n- };\n+ pp$3.enterScope = function(flags) {\n+ this.scopeStack.push(new Scope(flags));\n+ };\n \n- pp$3.exitScope = function() {\n- this.scopeStack.pop();\n- };\n+ pp$3.exitScope = function() {\n+ this.scopeStack.pop();\n+ };\n \n- // The spec says:\n- // > At the top level of a function, or script, function declarations are\n- // > treated like var declarations rather than like lexical declarations.\n- pp$3.treatFunctionsAsVarInScope = function(scope) {\n- return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)\n- };\n+ // The spec says:\n+ // > At the top level of a function, or script, function declarations are\n+ // > treated like var declarations rather than like lexical declarations.\n+ pp$3.treatFunctionsAsVarInScope = function(scope) {\n+ return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)\n+ };\n \n- pp$3.declareName = function(name, bindingType, pos) {\n- var redeclared = false;\n- if (bindingType === BIND_LEXICAL) {\n- var scope = this.currentScope();\n- redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;\n- scope.lexical.push(name);\n- if (this.inModule && (scope.flags & SCOPE_TOP)) {\n- delete this.undefinedExports[name];\n- }\n- } else if (bindingType === BIND_SIMPLE_CATCH) {\n- var scope$1 = this.currentScope();\n- scope$1.lexical.push(name);\n- } else if (bindingType === BIND_FUNCTION) {\n- var scope$2 = this.currentScope();\n- if (this.treatFunctionsAsVar) {\n- redeclared = scope$2.lexical.indexOf(name) > -1;\n- } else {\n- redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1;\n- }\n- scope$2.functions.push(name);\n- } else {\n- for (var i = this.scopeStack.length - 1; i >= 0; --i) {\n- var scope$3 = this.scopeStack[i];\n- if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||\n- !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {\n- redeclared = true;\n- break\n- }\n- scope$3.var.push(name);\n- if (this.inModule && (scope$3.flags & SCOPE_TOP)) {\n+ pp$3.declareName = function(name, bindingType, pos) {\n+ var redeclared = false;\n+ if (bindingType === BIND_LEXICAL) {\n+ var scope = this.currentScope();\n+ redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;\n+ scope.lexical.push(name);\n+ if (this.inModule && (scope.flags & SCOPE_TOP)) {\n delete this.undefinedExports[name];\n }\n- if (scope$3.flags & SCOPE_VAR) {\n- break\n+ } else if (bindingType === BIND_SIMPLE_CATCH) {\n+ var scope$1 = this.currentScope();\n+ scope$1.lexical.push(name);\n+ } else if (bindingType === BIND_FUNCTION) {\n+ var scope$2 = this.currentScope();\n+ if (this.treatFunctionsAsVar) {\n+ redeclared = scope$2.lexical.indexOf(name) > -1;\n+ } else {\n+ redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1;\n+ }\n+ scope$2.functions.push(name);\n+ } else {\n+ for (var i = this.scopeStack.length - 1; i >= 0; --i) {\n+ var scope$3 = this.scopeStack[i];\n+ if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||\n+ !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {\n+ redeclared = true;\n+ break\n+ }\n+ scope$3.var.push(name);\n+ if (this.inModule && (scope$3.flags & SCOPE_TOP)) {\n+ delete this.undefinedExports[name];\n+ }\n+ if (scope$3.flags & SCOPE_VAR) {\n+ break\n+ }\n }\n }\n- }\n- if (redeclared) {\n- this.raiseRecoverable(pos, (\"Identifier '\" + name + \"' has already been declared\"));\n- }\n- };\n-\n- pp$3.checkLocalExport = function(id) {\n- // scope.functions must be empty as Module code is always strict.\n- if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n- this.scopeStack[0].var.indexOf(id.name) === -1) {\n- this.undefinedExports[id.name] = id;\n- }\n- };\n-\n- pp$3.currentScope = function() {\n- return this.scopeStack[this.scopeStack.length - 1]\n- };\n-\n- pp$3.currentVarScope = function() {\n- for (var i = this.scopeStack.length - 1;; i--) {\n- var scope = this.scopeStack[i];\n- if (scope.flags & SCOPE_VAR) {\n- return scope\n+ if (redeclared) {\n+ this.raiseRecoverable(pos, (\"Identifier '\" + name + \"' has already been declared\"));\n }\n- }\n- };\n+ };\n \n- // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n- pp$3.currentThisScope = function() {\n- for (var i = this.scopeStack.length - 1;; i--) {\n- var scope = this.scopeStack[i];\n- if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) {\n- return scope\n+ pp$3.checkLocalExport = function(id) {\n+ // scope.functions must be empty as Module code is always strict.\n+ if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n+ this.scopeStack[0].var.indexOf(id.name) === -1) {\n+ this.undefinedExports[id.name] = id;\n }\n- }\n- };\n-\n- var Node = function Node(parser, pos, loc) {\n- this.type = \"\";\n- this.start = pos;\n- this.end = 0;\n- if (parser.options.locations) {\n- this.loc = new SourceLocation(parser, loc);\n- }\n- if (parser.options.directSourceFile) {\n- this.sourceFile = parser.options.directSourceFile;\n- }\n- if (parser.options.ranges) {\n- this.range = [pos, 0];\n- }\n- };\n+ };\n \n- // Start an AST node, attaching a start offset.\n+ pp$3.currentScope = function() {\n+ return this.scopeStack[this.scopeStack.length - 1]\n+ };\n \n- var pp$2 = Parser.prototype;\n+ pp$3.currentVarScope = function() {\n+ for (var i = this.scopeStack.length - 1;; i--) {\n+ var scope = this.scopeStack[i];\n+ if (scope.flags & SCOPE_VAR) {\n+ return scope\n+ }\n+ }\n+ };\n \n- pp$2.startNode = function() {\n- return new Node(this, this.start, this.startLoc)\n- };\n+ // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n+ pp$3.currentThisScope = function() {\n+ for (var i = this.scopeStack.length - 1;; i--) {\n+ var scope = this.scopeStack[i];\n+ if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) {\n+ return scope\n+ }\n+ }\n+ };\n \n- pp$2.startNodeAt = function(pos, loc) {\n- return new Node(this, pos, loc)\n- };\n+ var Node = function Node(parser, pos, loc) {\n+ this.type = \"\";\n+ this.start = pos;\n+ this.end = 0;\n+ if (parser.options.locations) {\n+ this.loc = new SourceLocation(parser, loc);\n+ }\n+ if (parser.options.directSourceFile) {\n+ this.sourceFile = parser.options.directSourceFile;\n+ }\n+ if (parser.options.ranges) {\n+ this.range = [pos, 0];\n+ }\n+ };\n \n- // Finish an AST node, adding `type` and `end` properties.\n+ // Start an AST node, attaching a start offset.\n \n- function finishNodeAt(node, type, pos, loc) {\n- node.type = type;\n- node.end = pos;\n- if (this.options.locations) {\n- node.loc.end = loc;\n- }\n- if (this.options.ranges) {\n- node.range[1] = pos;\n- }\n- return node\n- }\n+ var pp$2 = Parser.prototype;\n \n- pp$2.finishNode = function(node, type) {\n- return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n- };\n+ pp$2.startNode = function() {\n+ return new Node(this, this.start, this.startLoc)\n+ };\n \n- // Finish node at given position\n+ pp$2.startNodeAt = function(pos, loc) {\n+ return new Node(this, pos, loc)\n+ };\n \n- pp$2.finishNodeAt = function(node, type, pos, loc) {\n- return finishNodeAt.call(this, node, type, pos, loc)\n- };\n+ // Finish an AST node, adding `type` and `end` properties.\n \n- pp$2.copyNode = function(node) {\n- var newNode = new Node(this, node.start, this.startLoc);\n- for (var prop in node) {\n- newNode[prop] = node[prop];\n+ function finishNodeAt(node, type, pos, loc) {\n+ node.type = type;\n+ node.end = pos;\n+ if (this.options.locations) {\n+ node.loc.end = loc;\n+ }\n+ if (this.options.ranges) {\n+ node.range[1] = pos;\n+ }\n+ return node\n }\n- return newNode\n- };\n \n- // This file contains Unicode properties extracted from the ECMAScript\n- // specification. The lists are extracted like so:\n- // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)\n-\n- // #table-binary-unicode-properties\n- var ecma9BinaryProperties = \"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS\";\n- var ecma10BinaryProperties = ecma9BinaryProperties + \" Extended_Pictographic\";\n- var ecma11BinaryProperties = ecma10BinaryProperties;\n- var ecma12BinaryProperties = ecma11BinaryProperties + \" EBase EComp EMod EPres ExtPict\";\n- var ecma13BinaryProperties = ecma12BinaryProperties;\n- var unicodeBinaryProperties = {\n- 9: ecma9BinaryProperties,\n- 10: ecma10BinaryProperties,\n- 11: ecma11BinaryProperties,\n- 12: ecma12BinaryProperties,\n- 13: ecma13BinaryProperties\n- };\n+ pp$2.finishNode = function(node, type) {\n+ return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n+ };\n \n- // #table-unicode-general-category-values\n- var unicodeGeneralCategoryValues = \"Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu\";\n+ // Finish node at given position\n \n- // #table-unicode-script-values\n- var ecma9ScriptValues = \"Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb\";\n- var ecma10ScriptValues = ecma9ScriptValues + \" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd\";\n- var ecma11ScriptValues = ecma10ScriptValues + \" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho\";\n- var ecma12ScriptValues = ecma11ScriptValues + \" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi\";\n- var ecma13ScriptValues = ecma12ScriptValues + \" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith\";\n- var unicodeScriptValues = {\n- 9: ecma9ScriptValues,\n- 10: ecma10ScriptValues,\n- 11: ecma11ScriptValues,\n- 12: ecma12ScriptValues,\n- 13: ecma13ScriptValues\n- };\n-\n- var data = {};\n+ pp$2.finishNodeAt = function(node, type, pos, loc) {\n+ return finishNodeAt.call(this, node, type, pos, loc)\n+ };\n \n- function buildUnicodeData(ecmaVersion) {\n- var d = data[ecmaVersion] = {\n- binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + \" \" + unicodeGeneralCategoryValues),\n- nonBinary: {\n- General_Category: wordsRegexp(unicodeGeneralCategoryValues),\n- Script: wordsRegexp(unicodeScriptValues[ecmaVersion])\n+ pp$2.copyNode = function(node) {\n+ var newNode = new Node(this, node.start, this.startLoc);\n+ for (var prop in node) {\n+ newNode[prop] = node[prop];\n }\n+ return newNode\n };\n- d.nonBinary.Script_Extensions = d.nonBinary.Script;\n \n- d.nonBinary.gc = d.nonBinary.General_Category;\n- d.nonBinary.sc = d.nonBinary.Script;\n- d.nonBinary.scx = d.nonBinary.Script_Extensions;\n- }\n+ // This file contains Unicode properties extracted from the ECMAScript\n+ // specification. The lists are extracted like so:\n+ // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)\n+\n+ // #table-binary-unicode-properties\n+ var ecma9BinaryProperties = \"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS\";\n+ var ecma10BinaryProperties = ecma9BinaryProperties + \" Extended_Pictographic\";\n+ var ecma11BinaryProperties = ecma10BinaryProperties;\n+ var ecma12BinaryProperties = ecma11BinaryProperties + \" EBase EComp EMod EPres ExtPict\";\n+ var ecma13BinaryProperties = ecma12BinaryProperties;\n+ var unicodeBinaryProperties = {\n+ 9: ecma9BinaryProperties,\n+ 10: ecma10BinaryProperties,\n+ 11: ecma11BinaryProperties,\n+ 12: ecma12BinaryProperties,\n+ 13: ecma13BinaryProperties\n+ };\n \n- for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) {\n- var ecmaVersion = list[i];\n+ // #table-unicode-general-category-values\n+ var unicodeGeneralCategoryValues = \"Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu\";\n \n- buildUnicodeData(ecmaVersion);\n- }\n+ // #table-unicode-script-values\n+ var ecma9ScriptValues = \"Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb\";\n+ var ecma10ScriptValues = ecma9ScriptValues + \" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd\";\n+ var ecma11ScriptValues = ecma10ScriptValues + \" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho\";\n+ var ecma12ScriptValues = ecma11ScriptValues + \" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi\";\n+ var ecma13ScriptValues = ecma12ScriptValues + \" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith\";\n+ var unicodeScriptValues = {\n+ 9: ecma9ScriptValues,\n+ 10: ecma10ScriptValues,\n+ 11: ecma11ScriptValues,\n+ 12: ecma12ScriptValues,\n+ 13: ecma13ScriptValues\n+ };\n \n- var pp$1 = Parser.prototype;\n+ var data = {};\n \n- var RegExpValidationState = function RegExpValidationState(parser) {\n- this.parser = parser;\n- this.validFlags = \"gim\" + (parser.options.ecmaVersion >= 6 ? \"uy\" : \"\") + (parser.options.ecmaVersion >= 9 ? \"s\" : \"\") + (parser.options.ecmaVersion >= 13 ? \"d\" : \"\");\n- this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion];\n- this.source = \"\";\n- this.flags = \"\";\n- this.start = 0;\n- this.switchU = false;\n- this.switchN = false;\n- this.pos = 0;\n- this.lastIntValue = 0;\n- this.lastStringValue = \"\";\n- this.lastAssertionIsQuantifiable = false;\n- this.numCapturingParens = 0;\n- this.maxBackReference = 0;\n- this.groupNames = [];\n- this.backReferenceNames = [];\n- };\n+ function buildUnicodeData(ecmaVersion) {\n+ var d = data[ecmaVersion] = {\n+ binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + \" \" + unicodeGeneralCategoryValues),\n+ nonBinary: {\n+ General_Category: wordsRegexp(unicodeGeneralCategoryValues),\n+ Script: wordsRegexp(unicodeScriptValues[ecmaVersion])\n+ }\n+ };\n+ d.nonBinary.Script_Extensions = d.nonBinary.Script;\n \n- RegExpValidationState.prototype.reset = function reset(start, pattern, flags) {\n- var unicode = flags.indexOf(\"u\") !== -1;\n- this.start = start | 0;\n- this.source = pattern + \"\";\n- this.flags = flags;\n- this.switchU = unicode && this.parser.options.ecmaVersion >= 6;\n- this.switchN = unicode && this.parser.options.ecmaVersion >= 9;\n- };\n+ d.nonBinary.gc = d.nonBinary.General_Category;\n+ d.nonBinary.sc = d.nonBinary.Script;\n+ d.nonBinary.scx = d.nonBinary.Script_Extensions;\n+ }\n+\n+ for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) {\n+ var ecmaVersion = list[i];\n+\n+ buildUnicodeData(ecmaVersion);\n+ }\n+\n+ var pp$1 = Parser.prototype;\n+\n+ var RegExpValidationState = function RegExpValidationState(parser) {\n+ this.parser = parser;\n+ this.validFlags = \"gim\" + (parser.options.ecmaVersion >= 6 ? \"uy\" : \"\") + (parser.options.ecmaVersion >= 9 ? \"s\" : \"\") + (parser.options.ecmaVersion >= 13 ? \"d\" : \"\");\n+ this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion];\n+ this.source = \"\";\n+ this.flags = \"\";\n+ this.start = 0;\n+ this.switchU = false;\n+ this.switchN = false;\n+ this.pos = 0;\n+ this.lastIntValue = 0;\n+ this.lastStringValue = \"\";\n+ this.lastAssertionIsQuantifiable = false;\n+ this.numCapturingParens = 0;\n+ this.maxBackReference = 0;\n+ this.groupNames = [];\n+ this.backReferenceNames = [];\n+ };\n \n- RegExpValidationState.prototype.raise = function raise(message) {\n- this.parser.raiseRecoverable(this.start, (\"Invalid regular expression: /\" + (this.source) + \"/: \" + message));\n- };\n+ RegExpValidationState.prototype.reset = function reset(start, pattern, flags) {\n+ var unicode = flags.indexOf(\"u\") !== -1;\n+ this.start = start | 0;\n+ this.source = pattern + \"\";\n+ this.flags = flags;\n+ this.switchU = unicode && this.parser.options.ecmaVersion >= 6;\n+ this.switchN = unicode && this.parser.options.ecmaVersion >= 9;\n+ };\n \n- // If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n- // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\n- RegExpValidationState.prototype.at = function at(i, forceU) {\n- if (forceU === void 0) forceU = false;\n-\n- var s = this.source;\n- var l = s.length;\n- if (i >= l) {\n- return -1\n- }\n- var c = s.charCodeAt(i);\n- if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n- return c\n- }\n- var next = s.charCodeAt(i + 1);\n- return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c\n- };\n+ RegExpValidationState.prototype.raise = function raise(message) {\n+ this.parser.raiseRecoverable(this.start, (\"Invalid regular expression: /\" + (this.source) + \"/: \" + message));\n+ };\n \n- RegExpValidationState.prototype.nextIndex = function nextIndex(i, forceU) {\n- if (forceU === void 0) forceU = false;\n+ // If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n+ // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\n+ RegExpValidationState.prototype.at = function at(i, forceU) {\n+ if (forceU === void 0) forceU = false;\n+\n+ var s = this.source;\n+ var l = s.length;\n+ if (i >= l) {\n+ return -1\n+ }\n+ var c = s.charCodeAt(i);\n+ if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n+ return c\n+ }\n+ var next = s.charCodeAt(i + 1);\n+ return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c\n+ };\n \n- var s = this.source;\n- var l = s.length;\n- if (i >= l) {\n- return l\n- }\n- var c = s.charCodeAt(i),\n- next;\n- if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||\n- (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {\n- return i + 1\n- }\n- return i + 2\n- };\n+ RegExpValidationState.prototype.nextIndex = function nextIndex(i, forceU) {\n+ if (forceU === void 0) forceU = false;\n \n- RegExpValidationState.prototype.current = function current(forceU) {\n- if (forceU === void 0) forceU = false;\n+ var s = this.source;\n+ var l = s.length;\n+ if (i >= l) {\n+ return l\n+ }\n+ var c = s.charCodeAt(i),\n+ next;\n+ if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||\n+ (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {\n+ return i + 1\n+ }\n+ return i + 2\n+ };\n \n- return this.at(this.pos, forceU)\n- };\n+ RegExpValidationState.prototype.current = function current(forceU) {\n+ if (forceU === void 0) forceU = false;\n \n- RegExpValidationState.prototype.lookahead = function lookahead(forceU) {\n- if (forceU === void 0) forceU = false;\n+ return this.at(this.pos, forceU)\n+ };\n \n- return this.at(this.nextIndex(this.pos, forceU), forceU)\n- };\n+ RegExpValidationState.prototype.lookahead = function lookahead(forceU) {\n+ if (forceU === void 0) forceU = false;\n \n- RegExpValidationState.prototype.advance = function advance(forceU) {\n- if (forceU === void 0) forceU = false;\n+ return this.at(this.nextIndex(this.pos, forceU), forceU)\n+ };\n \n- this.pos = this.nextIndex(this.pos, forceU);\n- };\n+ RegExpValidationState.prototype.advance = function advance(forceU) {\n+ if (forceU === void 0) forceU = false;\n \n- RegExpValidationState.prototype.eat = function eat(ch, forceU) {\n- if (forceU === void 0) forceU = false;\n+ this.pos = this.nextIndex(this.pos, forceU);\n+ };\n \n- if (this.current(forceU) === ch) {\n- this.advance(forceU);\n- return true\n- }\n- return false\n- };\n+ RegExpValidationState.prototype.eat = function eat(ch, forceU) {\n+ if (forceU === void 0) forceU = false;\n \n- /**\n- * Validate the flags part of a given RegExpLiteral.\n- *\n- * @param {RegExpValidationState} state The state to validate RegExp.\n- * @returns {void}\n- */\n- pp$1.validateRegExpFlags = function(state) {\n- var validFlags = state.validFlags;\n- var flags = state.flags;\n-\n- for (var i = 0; i < flags.length; i++) {\n- var flag = flags.charAt(i);\n- if (validFlags.indexOf(flag) === -1) {\n- this.raise(state.start, \"Invalid regular expression flag\");\n+ if (this.current(forceU) === ch) {\n+ this.advance(forceU);\n+ return true\n }\n- if (flags.indexOf(flag, i + 1) > -1) {\n- this.raise(state.start, \"Duplicate regular expression flag\");\n+ return false\n+ };\n+\n+ /**\n+ * Validate the flags part of a given RegExpLiteral.\n+ *\n+ * @param {RegExpValidationState} state The state to validate RegExp.\n+ * @returns {void}\n+ */\n+ pp$1.validateRegExpFlags = function(state) {\n+ var validFlags = state.validFlags;\n+ var flags = state.flags;\n+\n+ for (var i = 0; i < flags.length; i++) {\n+ var flag = flags.charAt(i);\n+ if (validFlags.indexOf(flag) === -1) {\n+ this.raise(state.start, \"Invalid regular expression flag\");\n+ }\n+ if (flags.indexOf(flag, i + 1) > -1) {\n+ this.raise(state.start, \"Duplicate regular expression flag\");\n+ }\n }\n- }\n- };\n+ };\n \n- /**\n- * Validate the pattern part of a given RegExpLiteral.\n- *\n- * @param {RegExpValidationState} state The state to validate RegExp.\n- * @returns {void}\n- */\n- pp$1.validateRegExpPattern = function(state) {\n- this.regexp_pattern(state);\n-\n- // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n- // parsing contains a |GroupName|, reparse with the goal symbol\n- // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n- // exception if _P_ did not conform to the grammar, if any elements of _P_\n- // were not matched by the parse, or if any Early Error conditions exist.\n- if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {\n- state.switchN = true;\n+ /**\n+ * Validate the pattern part of a given RegExpLiteral.\n+ *\n+ * @param {RegExpValidationState} state The state to validate RegExp.\n+ * @returns {void}\n+ */\n+ pp$1.validateRegExpPattern = function(state) {\n this.regexp_pattern(state);\n- }\n- };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\n- pp$1.regexp_pattern = function(state) {\n- state.pos = 0;\n- state.lastIntValue = 0;\n- state.lastStringValue = \"\";\n- state.lastAssertionIsQuantifiable = false;\n- state.numCapturingParens = 0;\n- state.maxBackReference = 0;\n- state.groupNames.length = 0;\n- state.backReferenceNames.length = 0;\n-\n- this.regexp_disjunction(state);\n-\n- if (state.pos !== state.source.length) {\n- // Make the same messages as V8.\n- if (state.eat(0x29 /* ) */ )) {\n- state.raise(\"Unmatched ')'\");\n+ // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n+ // parsing contains a |GroupName|, reparse with the goal symbol\n+ // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n+ // exception if _P_ did not conform to the grammar, if any elements of _P_\n+ // were not matched by the parse, or if any Early Error conditions exist.\n+ if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {\n+ state.switchN = true;\n+ this.regexp_pattern(state);\n }\n- if (state.eat(0x5D /* ] */ ) || state.eat(0x7D /* } */ )) {\n- state.raise(\"Lone quantifier brackets\");\n+ };\n+\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\n+ pp$1.regexp_pattern = function(state) {\n+ state.pos = 0;\n+ state.lastIntValue = 0;\n+ state.lastStringValue = \"\";\n+ state.lastAssertionIsQuantifiable = false;\n+ state.numCapturingParens = 0;\n+ state.maxBackReference = 0;\n+ state.groupNames.length = 0;\n+ state.backReferenceNames.length = 0;\n+\n+ this.regexp_disjunction(state);\n+\n+ if (state.pos !== state.source.length) {\n+ // Make the same messages as V8.\n+ if (state.eat(0x29 /* ) */ )) {\n+ state.raise(\"Unmatched ')'\");\n+ }\n+ if (state.eat(0x5D /* ] */ ) || state.eat(0x7D /* } */ )) {\n+ state.raise(\"Lone quantifier brackets\");\n+ }\n }\n- }\n- if (state.maxBackReference > state.numCapturingParens) {\n- state.raise(\"Invalid escape\");\n- }\n- for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {\n- var name = list[i];\n+ if (state.maxBackReference > state.numCapturingParens) {\n+ state.raise(\"Invalid escape\");\n+ }\n+ for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {\n+ var name = list[i];\n \n- if (state.groupNames.indexOf(name) === -1) {\n- state.raise(\"Invalid named capture referenced\");\n+ if (state.groupNames.indexOf(name) === -1) {\n+ state.raise(\"Invalid named capture referenced\");\n+ }\n }\n- }\n- };\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\n- pp$1.regexp_disjunction = function(state) {\n- this.regexp_alternative(state);\n- while (state.eat(0x7C /* | */ )) {\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\n+ pp$1.regexp_disjunction = function(state) {\n this.regexp_alternative(state);\n- }\n+ while (state.eat(0x7C /* | */ )) {\n+ this.regexp_alternative(state);\n+ }\n \n- // Make the same message as V8.\n- if (this.regexp_eatQuantifier(state, true)) {\n- state.raise(\"Nothing to repeat\");\n- }\n- if (state.eat(0x7B /* { */ )) {\n- state.raise(\"Lone quantifier brackets\");\n- }\n- };\n+ // Make the same message as V8.\n+ if (this.regexp_eatQuantifier(state, true)) {\n+ state.raise(\"Nothing to repeat\");\n+ }\n+ if (state.eat(0x7B /* { */ )) {\n+ state.raise(\"Lone quantifier brackets\");\n+ }\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\n- pp$1.regexp_alternative = function(state) {\n- while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}\n- };\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\n+ pp$1.regexp_alternative = function(state) {\n+ while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\n- pp$1.regexp_eatTerm = function(state) {\n- if (this.regexp_eatAssertion(state)) {\n- // Handle `QuantifiableAssertion Quantifier` alternative.\n- // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n- // is a QuantifiableAssertion.\n- if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n- // Make the same message as V8.\n- if (state.switchU) {\n- state.raise(\"Invalid quantifier\");\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\n+ pp$1.regexp_eatTerm = function(state) {\n+ if (this.regexp_eatAssertion(state)) {\n+ // Handle `QuantifiableAssertion Quantifier` alternative.\n+ // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n+ // is a QuantifiableAssertion.\n+ if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n+ // Make the same message as V8.\n+ if (state.switchU) {\n+ state.raise(\"Invalid quantifier\");\n+ }\n }\n+ return true\n }\n- return true\n- }\n \n- if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n- this.regexp_eatQuantifier(state);\n- return true\n- }\n-\n- return false\n- };\n+ if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n+ this.regexp_eatQuantifier(state);\n+ return true\n+ }\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\n- pp$1.regexp_eatAssertion = function(state) {\n- var start = state.pos;\n- state.lastAssertionIsQuantifiable = false;\n+ return false\n+ };\n \n- // ^, $\n- if (state.eat(0x5E /* ^ */ ) || state.eat(0x24 /* $ */ )) {\n- return true\n- }\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\n+ pp$1.regexp_eatAssertion = function(state) {\n+ var start = state.pos;\n+ state.lastAssertionIsQuantifiable = false;\n \n- // \\b \\B\n- if (state.eat(0x5C /* \\ */ )) {\n- if (state.eat(0x42 /* B */ ) || state.eat(0x62 /* b */ )) {\n+ // ^, $\n+ if (state.eat(0x5E /* ^ */ ) || state.eat(0x24 /* $ */ )) {\n return true\n }\n- state.pos = start;\n- }\n \n- // Lookahead / Lookbehind\n- if (state.eat(0x28 /* ( */ ) && state.eat(0x3F /* ? */ )) {\n- var lookbehind = false;\n- if (this.options.ecmaVersion >= 9) {\n- lookbehind = state.eat(0x3C /* < */ );\n+ // \\b \\B\n+ if (state.eat(0x5C /* \\ */ )) {\n+ if (state.eat(0x42 /* B */ ) || state.eat(0x62 /* b */ )) {\n+ return true\n+ }\n+ state.pos = start;\n }\n- if (state.eat(0x3D /* = */ ) || state.eat(0x21 /* ! */ )) {\n- this.regexp_disjunction(state);\n- if (!state.eat(0x29 /* ) */ )) {\n- state.raise(\"Unterminated group\");\n+\n+ // Lookahead / Lookbehind\n+ if (state.eat(0x28 /* ( */ ) && state.eat(0x3F /* ? */ )) {\n+ var lookbehind = false;\n+ if (this.options.ecmaVersion >= 9) {\n+ lookbehind = state.eat(0x3C /* < */ );\n+ }\n+ if (state.eat(0x3D /* = */ ) || state.eat(0x21 /* ! */ )) {\n+ this.regexp_disjunction(state);\n+ if (!state.eat(0x29 /* ) */ )) {\n+ state.raise(\"Unterminated group\");\n+ }\n+ state.lastAssertionIsQuantifiable = !lookbehind;\n+ return true\n }\n- state.lastAssertionIsQuantifiable = !lookbehind;\n- return true\n }\n- }\n \n- state.pos = start;\n- return false\n- };\n+ state.pos = start;\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\n- pp$1.regexp_eatQuantifier = function(state, noError) {\n- if (noError === void 0) noError = false;\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\n+ pp$1.regexp_eatQuantifier = function(state, noError) {\n+ if (noError === void 0) noError = false;\n \n- if (this.regexp_eatQuantifierPrefix(state, noError)) {\n- state.eat(0x3F /* ? */ );\n- return true\n- }\n- return false\n- };\n+ if (this.regexp_eatQuantifierPrefix(state, noError)) {\n+ state.eat(0x3F /* ? */ );\n+ return true\n+ }\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\n- pp$1.regexp_eatQuantifierPrefix = function(state, noError) {\n- return (\n- state.eat(0x2A /* * */ ) ||\n- state.eat(0x2B /* + */ ) ||\n- state.eat(0x3F /* ? */ ) ||\n- this.regexp_eatBracedQuantifier(state, noError)\n- )\n- };\n- pp$1.regexp_eatBracedQuantifier = function(state, noError) {\n- var start = state.pos;\n- if (state.eat(0x7B /* { */ )) {\n- var min = 0,\n- max = -1;\n- if (this.regexp_eatDecimalDigits(state)) {\n- min = state.lastIntValue;\n- if (state.eat(0x2C /* , */ ) && this.regexp_eatDecimalDigits(state)) {\n- max = state.lastIntValue;\n- }\n- if (state.eat(0x7D /* } */ )) {\n- // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n- if (max !== -1 && max < min && !noError) {\n- state.raise(\"numbers out of order in {} quantifier\");\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\n+ pp$1.regexp_eatQuantifierPrefix = function(state, noError) {\n+ return (\n+ state.eat(0x2A /* * */ ) ||\n+ state.eat(0x2B /* + */ ) ||\n+ state.eat(0x3F /* ? */ ) ||\n+ this.regexp_eatBracedQuantifier(state, noError)\n+ )\n+ };\n+ pp$1.regexp_eatBracedQuantifier = function(state, noError) {\n+ var start = state.pos;\n+ if (state.eat(0x7B /* { */ )) {\n+ var min = 0,\n+ max = -1;\n+ if (this.regexp_eatDecimalDigits(state)) {\n+ min = state.lastIntValue;\n+ if (state.eat(0x2C /* , */ ) && this.regexp_eatDecimalDigits(state)) {\n+ max = state.lastIntValue;\n+ }\n+ if (state.eat(0x7D /* } */ )) {\n+ // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n+ if (max !== -1 && max < min && !noError) {\n+ state.raise(\"numbers out of order in {} quantifier\");\n+ }\n+ return true\n }\n- return true\n }\n+ if (state.switchU && !noError) {\n+ state.raise(\"Incomplete quantifier\");\n+ }\n+ state.pos = start;\n }\n- if (state.switchU && !noError) {\n- state.raise(\"Incomplete quantifier\");\n- }\n- state.pos = start;\n- }\n- return false\n- };\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\n- pp$1.regexp_eatAtom = function(state) {\n- return (\n- this.regexp_eatPatternCharacters(state) ||\n- state.eat(0x2E /* . */ ) ||\n- this.regexp_eatReverseSolidusAtomEscape(state) ||\n- this.regexp_eatCharacterClass(state) ||\n- this.regexp_eatUncapturingGroup(state) ||\n- this.regexp_eatCapturingGroup(state)\n- )\n- };\n- pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {\n- var start = state.pos;\n- if (state.eat(0x5C /* \\ */ )) {\n- if (this.regexp_eatAtomEscape(state)) {\n- return true\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\n+ pp$1.regexp_eatAtom = function(state) {\n+ return (\n+ this.regexp_eatPatternCharacters(state) ||\n+ state.eat(0x2E /* . */ ) ||\n+ this.regexp_eatReverseSolidusAtomEscape(state) ||\n+ this.regexp_eatCharacterClass(state) ||\n+ this.regexp_eatUncapturingGroup(state) ||\n+ this.regexp_eatCapturingGroup(state)\n+ )\n+ };\n+ pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {\n+ var start = state.pos;\n+ if (state.eat(0x5C /* \\ */ )) {\n+ if (this.regexp_eatAtomEscape(state)) {\n+ return true\n+ }\n+ state.pos = start;\n }\n- state.pos = start;\n- }\n- return false\n- };\n- pp$1.regexp_eatUncapturingGroup = function(state) {\n- var start = state.pos;\n- if (state.eat(0x28 /* ( */ )) {\n- if (state.eat(0x3F /* ? */ ) && state.eat(0x3A /* : */ )) {\n+ return false\n+ };\n+ pp$1.regexp_eatUncapturingGroup = function(state) {\n+ var start = state.pos;\n+ if (state.eat(0x28 /* ( */ )) {\n+ if (state.eat(0x3F /* ? */ ) && state.eat(0x3A /* : */ )) {\n+ this.regexp_disjunction(state);\n+ if (state.eat(0x29 /* ) */ )) {\n+ return true\n+ }\n+ state.raise(\"Unterminated group\");\n+ }\n+ state.pos = start;\n+ }\n+ return false\n+ };\n+ pp$1.regexp_eatCapturingGroup = function(state) {\n+ if (state.eat(0x28 /* ( */ )) {\n+ if (this.options.ecmaVersion >= 9) {\n+ this.regexp_groupSpecifier(state);\n+ } else if (state.current() === 0x3F /* ? */ ) {\n+ state.raise(\"Invalid group\");\n+ }\n this.regexp_disjunction(state);\n if (state.eat(0x29 /* ) */ )) {\n+ state.numCapturingParens += 1;\n return true\n }\n state.raise(\"Unterminated group\");\n }\n- state.pos = start;\n- }\n- return false\n- };\n- pp$1.regexp_eatCapturingGroup = function(state) {\n- if (state.eat(0x28 /* ( */ )) {\n- if (this.options.ecmaVersion >= 9) {\n- this.regexp_groupSpecifier(state);\n- } else if (state.current() === 0x3F /* ? */ ) {\n- state.raise(\"Invalid group\");\n+ return false\n+ };\n+\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\n+ pp$1.regexp_eatExtendedAtom = function(state) {\n+ return (\n+ state.eat(0x2E /* . */ ) ||\n+ this.regexp_eatReverseSolidusAtomEscape(state) ||\n+ this.regexp_eatCharacterClass(state) ||\n+ this.regexp_eatUncapturingGroup(state) ||\n+ this.regexp_eatCapturingGroup(state) ||\n+ this.regexp_eatInvalidBracedQuantifier(state) ||\n+ this.regexp_eatExtendedPatternCharacter(state)\n+ )\n+ };\n+\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\n+ pp$1.regexp_eatInvalidBracedQuantifier = function(state) {\n+ if (this.regexp_eatBracedQuantifier(state, true)) {\n+ state.raise(\"Nothing to repeat\");\n }\n- this.regexp_disjunction(state);\n- if (state.eat(0x29 /* ) */ )) {\n- state.numCapturingParens += 1;\n+ return false\n+ };\n+\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\n+ pp$1.regexp_eatSyntaxCharacter = function(state) {\n+ var ch = state.current();\n+ if (isSyntaxCharacter(ch)) {\n+ state.lastIntValue = ch;\n+ state.advance();\n return true\n }\n- state.raise(\"Unterminated group\");\n- }\n- return false\n- };\n-\n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\n- pp$1.regexp_eatExtendedAtom = function(state) {\n- return (\n- state.eat(0x2E /* . */ ) ||\n- this.regexp_eatReverseSolidusAtomEscape(state) ||\n- this.regexp_eatCharacterClass(state) ||\n- this.regexp_eatUncapturingGroup(state) ||\n- this.regexp_eatCapturingGroup(state) ||\n- this.regexp_eatInvalidBracedQuantifier(state) ||\n- this.regexp_eatExtendedPatternCharacter(state)\n- )\n- };\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\n- pp$1.regexp_eatInvalidBracedQuantifier = function(state) {\n- if (this.regexp_eatBracedQuantifier(state, true)) {\n- state.raise(\"Nothing to repeat\");\n+ function isSyntaxCharacter(ch) {\n+ return (\n+ ch === 0x24 /* $ */ ||\n+ ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n+ ch === 0x2E /* . */ ||\n+ ch === 0x3F /* ? */ ||\n+ ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n+ ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n+ )\n }\n- return false\n- };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\n- pp$1.regexp_eatSyntaxCharacter = function(state) {\n- var ch = state.current();\n- if (isSyntaxCharacter(ch)) {\n- state.lastIntValue = ch;\n- state.advance();\n- return true\n- }\n- return false\n- };\n-\n- function isSyntaxCharacter(ch) {\n- return (\n- ch === 0x24 /* $ */ ||\n- ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n- ch === 0x2E /* . */ ||\n- ch === 0x3F /* ? */ ||\n- ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n- ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n- )\n- }\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n+ // But eat eager.\n+ pp$1.regexp_eatPatternCharacters = function(state) {\n+ var start = state.pos;\n+ var ch = 0;\n+ while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n+ state.advance();\n+ }\n+ return state.pos !== start\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n- // But eat eager.\n- pp$1.regexp_eatPatternCharacters = function(state) {\n- var start = state.pos;\n- var ch = 0;\n- while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n- state.advance();\n- }\n- return state.pos !== start\n- };\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\n+ pp$1.regexp_eatExtendedPatternCharacter = function(state) {\n+ var ch = state.current();\n+ if (\n+ ch !== -1 &&\n+ ch !== 0x24 /* $ */ &&\n+ !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ) &&\n+ ch !== 0x2E /* . */ &&\n+ ch !== 0x3F /* ? */ &&\n+ ch !== 0x5B /* [ */ &&\n+ ch !== 0x5E /* ^ */ &&\n+ ch !== 0x7C /* | */\n+ ) {\n+ state.advance();\n+ return true\n+ }\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\n- pp$1.regexp_eatExtendedPatternCharacter = function(state) {\n- var ch = state.current();\n- if (\n- ch !== -1 &&\n- ch !== 0x24 /* $ */ &&\n- !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ) &&\n- ch !== 0x2E /* . */ &&\n- ch !== 0x3F /* ? */ &&\n- ch !== 0x5B /* [ */ &&\n- ch !== 0x5E /* ^ */ &&\n- ch !== 0x7C /* | */\n- ) {\n- state.advance();\n- return true\n- }\n- return false\n- };\n+ // GroupSpecifier ::\n+ // [empty]\n+ // `?` GroupName\n+ pp$1.regexp_groupSpecifier = function(state) {\n+ if (state.eat(0x3F /* ? */ )) {\n+ if (this.regexp_eatGroupName(state)) {\n+ if (state.groupNames.indexOf(state.lastStringValue) !== -1) {\n+ state.raise(\"Duplicate capture group name\");\n+ }\n+ state.groupNames.push(state.lastStringValue);\n+ return\n+ }\n+ state.raise(\"Invalid group\");\n+ }\n+ };\n \n- // GroupSpecifier ::\n- // [empty]\n- // `?` GroupName\n- pp$1.regexp_groupSpecifier = function(state) {\n- if (state.eat(0x3F /* ? */ )) {\n- if (this.regexp_eatGroupName(state)) {\n- if (state.groupNames.indexOf(state.lastStringValue) !== -1) {\n- state.raise(\"Duplicate capture group name\");\n+ // GroupName ::\n+ // `<` RegExpIdentifierName `>`\n+ // Note: this updates `state.lastStringValue` property with the eaten name.\n+ pp$1.regexp_eatGroupName = function(state) {\n+ state.lastStringValue = \"\";\n+ if (state.eat(0x3C /* < */ )) {\n+ if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */ )) {\n+ return true\n }\n- state.groupNames.push(state.lastStringValue);\n- return\n+ state.raise(\"Invalid capture group name\");\n }\n- state.raise(\"Invalid group\");\n- }\n- };\n+ return false\n+ };\n \n- // GroupName ::\n- // `<` RegExpIdentifierName `>`\n- // Note: this updates `state.lastStringValue` property with the eaten name.\n- pp$1.regexp_eatGroupName = function(state) {\n- state.lastStringValue = \"\";\n- if (state.eat(0x3C /* < */ )) {\n- if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */ )) {\n+ // RegExpIdentifierName ::\n+ // RegExpIdentifierStart\n+ // RegExpIdentifierName RegExpIdentifierPart\n+ // Note: this updates `state.lastStringValue` property with the eaten name.\n+ pp$1.regexp_eatRegExpIdentifierName = function(state) {\n+ state.lastStringValue = \"\";\n+ if (this.regexp_eatRegExpIdentifierStart(state)) {\n+ state.lastStringValue += codePointToString(state.lastIntValue);\n+ while (this.regexp_eatRegExpIdentifierPart(state)) {\n+ state.lastStringValue += codePointToString(state.lastIntValue);\n+ }\n return true\n }\n- state.raise(\"Invalid capture group name\");\n- }\n- return false\n- };\n+ return false\n+ };\n \n- // RegExpIdentifierName ::\n- // RegExpIdentifierStart\n- // RegExpIdentifierName RegExpIdentifierPart\n- // Note: this updates `state.lastStringValue` property with the eaten name.\n- pp$1.regexp_eatRegExpIdentifierName = function(state) {\n- state.lastStringValue = \"\";\n- if (this.regexp_eatRegExpIdentifierStart(state)) {\n- state.lastStringValue += codePointToString(state.lastIntValue);\n- while (this.regexp_eatRegExpIdentifierPart(state)) {\n- state.lastStringValue += codePointToString(state.lastIntValue);\n+ // RegExpIdentifierStart ::\n+ // UnicodeIDStart\n+ // `$`\n+ // `_`\n+ // `\\` RegExpUnicodeEscapeSequence[+U]\n+ pp$1.regexp_eatRegExpIdentifierStart = function(state) {\n+ var start = state.pos;\n+ var forceU = this.options.ecmaVersion >= 11;\n+ var ch = state.current(forceU);\n+ state.advance(forceU);\n+\n+ if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n+ ch = state.lastIntValue;\n+ }\n+ if (isRegExpIdentifierStart(ch)) {\n+ state.lastIntValue = ch;\n+ return true\n }\n- return true\n- }\n- return false\n- };\n \n- // RegExpIdentifierStart ::\n- // UnicodeIDStart\n- // `$`\n- // `_`\n- // `\\` RegExpUnicodeEscapeSequence[+U]\n- pp$1.regexp_eatRegExpIdentifierStart = function(state) {\n- var start = state.pos;\n- var forceU = this.options.ecmaVersion >= 11;\n- var ch = state.current(forceU);\n- state.advance(forceU);\n+ state.pos = start;\n+ return false\n+ };\n \n- if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n- ch = state.lastIntValue;\n- }\n- if (isRegExpIdentifierStart(ch)) {\n- state.lastIntValue = ch;\n- return true\n+ function isRegExpIdentifierStart(ch) {\n+ return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n }\n \n- state.pos = start;\n- return false\n- };\n+ // RegExpIdentifierPart ::\n+ // UnicodeIDContinue\n+ // `$`\n+ // `_`\n+ // `\\` RegExpUnicodeEscapeSequence[+U]\n+ // \n+ // \n+ pp$1.regexp_eatRegExpIdentifierPart = function(state) {\n+ var start = state.pos;\n+ var forceU = this.options.ecmaVersion >= 11;\n+ var ch = state.current(forceU);\n+ state.advance(forceU);\n \n- function isRegExpIdentifierStart(ch) {\n- return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n- }\n+ if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n+ ch = state.lastIntValue;\n+ }\n+ if (isRegExpIdentifierPart(ch)) {\n+ state.lastIntValue = ch;\n+ return true\n+ }\n \n- // RegExpIdentifierPart ::\n- // UnicodeIDContinue\n- // `$`\n- // `_`\n- // `\\` RegExpUnicodeEscapeSequence[+U]\n- // \n- // \n- pp$1.regexp_eatRegExpIdentifierPart = function(state) {\n- var start = state.pos;\n- var forceU = this.options.ecmaVersion >= 11;\n- var ch = state.current(forceU);\n- state.advance(forceU);\n+ state.pos = start;\n+ return false\n+ };\n \n- if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n- ch = state.lastIntValue;\n- }\n- if (isRegExpIdentifierPart(ch)) {\n- state.lastIntValue = ch;\n- return true\n+ function isRegExpIdentifierPart(ch) {\n+ return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */\n }\n \n- state.pos = start;\n- return false\n- };\n-\n- function isRegExpIdentifierPart(ch) {\n- return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */\n- }\n-\n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\n- pp$1.regexp_eatAtomEscape = function(state) {\n- if (\n- this.regexp_eatBackReference(state) ||\n- this.regexp_eatCharacterClassEscape(state) ||\n- this.regexp_eatCharacterEscape(state) ||\n- (state.switchN && this.regexp_eatKGroupName(state))\n- ) {\n- return true\n- }\n- if (state.switchU) {\n- // Make the same message as V8.\n- if (state.current() === 0x63 /* c */ ) {\n- state.raise(\"Invalid unicode escape\");\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\n+ pp$1.regexp_eatAtomEscape = function(state) {\n+ if (\n+ this.regexp_eatBackReference(state) ||\n+ this.regexp_eatCharacterClassEscape(state) ||\n+ this.regexp_eatCharacterEscape(state) ||\n+ (state.switchN && this.regexp_eatKGroupName(state))\n+ ) {\n+ return true\n }\n- state.raise(\"Invalid escape\");\n- }\n- return false\n- };\n- pp$1.regexp_eatBackReference = function(state) {\n- var start = state.pos;\n- if (this.regexp_eatDecimalEscape(state)) {\n- var n = state.lastIntValue;\n if (state.switchU) {\n- // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n- if (n > state.maxBackReference) {\n- state.maxBackReference = n;\n+ // Make the same message as V8.\n+ if (state.current() === 0x63 /* c */ ) {\n+ state.raise(\"Invalid unicode escape\");\n+ }\n+ state.raise(\"Invalid escape\");\n+ }\n+ return false\n+ };\n+ pp$1.regexp_eatBackReference = function(state) {\n+ var start = state.pos;\n+ if (this.regexp_eatDecimalEscape(state)) {\n+ var n = state.lastIntValue;\n+ if (state.switchU) {\n+ // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n+ if (n > state.maxBackReference) {\n+ state.maxBackReference = n;\n+ }\n+ return true\n+ }\n+ if (n <= state.numCapturingParens) {\n+ return true\n+ }\n+ state.pos = start;\n+ }\n+ return false\n+ };\n+ pp$1.regexp_eatKGroupName = function(state) {\n+ if (state.eat(0x6B /* k */ )) {\n+ if (this.regexp_eatGroupName(state)) {\n+ state.backReferenceNames.push(state.lastStringValue);\n+ return true\n }\n+ state.raise(\"Invalid named reference\");\n+ }\n+ return false\n+ };\n+\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\n+ pp$1.regexp_eatCharacterEscape = function(state) {\n+ return (\n+ this.regexp_eatControlEscape(state) ||\n+ this.regexp_eatCControlLetter(state) ||\n+ this.regexp_eatZero(state) ||\n+ this.regexp_eatHexEscapeSequence(state) ||\n+ this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||\n+ (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n+ this.regexp_eatIdentityEscape(state)\n+ )\n+ };\n+ pp$1.regexp_eatCControlLetter = function(state) {\n+ var start = state.pos;\n+ if (state.eat(0x63 /* c */ )) {\n+ if (this.regexp_eatControlLetter(state)) {\n+ return true\n+ }\n+ state.pos = start;\n+ }\n+ return false\n+ };\n+ pp$1.regexp_eatZero = function(state) {\n+ if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n+ state.lastIntValue = 0;\n+ state.advance();\n return true\n }\n- if (n <= state.numCapturingParens) {\n+ return false\n+ };\n+\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\n+ pp$1.regexp_eatControlEscape = function(state) {\n+ var ch = state.current();\n+ if (ch === 0x74 /* t */ ) {\n+ state.lastIntValue = 0x09; /* \\t */\n+ state.advance();\n return true\n }\n- state.pos = start;\n- }\n- return false\n- };\n- pp$1.regexp_eatKGroupName = function(state) {\n- if (state.eat(0x6B /* k */ )) {\n- if (this.regexp_eatGroupName(state)) {\n- state.backReferenceNames.push(state.lastStringValue);\n+ if (ch === 0x6E /* n */ ) {\n+ state.lastIntValue = 0x0A; /* \\n */\n+ state.advance();\n return true\n }\n- state.raise(\"Invalid named reference\");\n- }\n- return false\n- };\n-\n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\n- pp$1.regexp_eatCharacterEscape = function(state) {\n- return (\n- this.regexp_eatControlEscape(state) ||\n- this.regexp_eatCControlLetter(state) ||\n- this.regexp_eatZero(state) ||\n- this.regexp_eatHexEscapeSequence(state) ||\n- this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||\n- (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n- this.regexp_eatIdentityEscape(state)\n- )\n- };\n- pp$1.regexp_eatCControlLetter = function(state) {\n- var start = state.pos;\n- if (state.eat(0x63 /* c */ )) {\n- if (this.regexp_eatControlLetter(state)) {\n+ if (ch === 0x76 /* v */ ) {\n+ state.lastIntValue = 0x0B; /* \\v */\n+ state.advance();\n return true\n }\n- state.pos = start;\n- }\n- return false\n- };\n- pp$1.regexp_eatZero = function(state) {\n- if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n- state.lastIntValue = 0;\n- state.advance();\n- return true\n- }\n- return false\n- };\n+ if (ch === 0x66 /* f */ ) {\n+ state.lastIntValue = 0x0C; /* \\f */\n+ state.advance();\n+ return true\n+ }\n+ if (ch === 0x72 /* r */ ) {\n+ state.lastIntValue = 0x0D; /* \\r */\n+ state.advance();\n+ return true\n+ }\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\n- pp$1.regexp_eatControlEscape = function(state) {\n- var ch = state.current();\n- if (ch === 0x74 /* t */ ) {\n- state.lastIntValue = 0x09; /* \\t */\n- state.advance();\n- return true\n- }\n- if (ch === 0x6E /* n */ ) {\n- state.lastIntValue = 0x0A; /* \\n */\n- state.advance();\n- return true\n- }\n- if (ch === 0x76 /* v */ ) {\n- state.lastIntValue = 0x0B; /* \\v */\n- state.advance();\n- return true\n- }\n- if (ch === 0x66 /* f */ ) {\n- state.lastIntValue = 0x0C; /* \\f */\n- state.advance();\n- return true\n- }\n- if (ch === 0x72 /* r */ ) {\n- state.lastIntValue = 0x0D; /* \\r */\n- state.advance();\n- return true\n- }\n- return false\n- };\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\n+ pp$1.regexp_eatControlLetter = function(state) {\n+ var ch = state.current();\n+ if (isControlLetter(ch)) {\n+ state.lastIntValue = ch % 0x20;\n+ state.advance();\n+ return true\n+ }\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\n- pp$1.regexp_eatControlLetter = function(state) {\n- var ch = state.current();\n- if (isControlLetter(ch)) {\n- state.lastIntValue = ch % 0x20;\n- state.advance();\n- return true\n+ function isControlLetter(ch) {\n+ return (\n+ (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */ ) ||\n+ (ch >= 0x61 /* a */ && ch <= 0x7A /* z */ )\n+ )\n }\n- return false\n- };\n-\n- function isControlLetter(ch) {\n- return (\n- (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */ ) ||\n- (ch >= 0x61 /* a */ && ch <= 0x7A /* z */ )\n- )\n- }\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\n- pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {\n- if (forceU === void 0) forceU = false;\n-\n- var start = state.pos;\n- var switchU = forceU || state.switchU;\n-\n- if (state.eat(0x75 /* u */ )) {\n- if (this.regexp_eatFixedHexDigits(state, 4)) {\n- var lead = state.lastIntValue;\n- if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n- var leadSurrogateEnd = state.pos;\n- if (state.eat(0x5C /* \\ */ ) && state.eat(0x75 /* u */ ) && this.regexp_eatFixedHexDigits(state, 4)) {\n- var trail = state.lastIntValue;\n- if (trail >= 0xDC00 && trail <= 0xDFFF) {\n- state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n- return true\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\n+ pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {\n+ if (forceU === void 0) forceU = false;\n+\n+ var start = state.pos;\n+ var switchU = forceU || state.switchU;\n+\n+ if (state.eat(0x75 /* u */ )) {\n+ if (this.regexp_eatFixedHexDigits(state, 4)) {\n+ var lead = state.lastIntValue;\n+ if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n+ var leadSurrogateEnd = state.pos;\n+ if (state.eat(0x5C /* \\ */ ) && state.eat(0x75 /* u */ ) && this.regexp_eatFixedHexDigits(state, 4)) {\n+ var trail = state.lastIntValue;\n+ if (trail >= 0xDC00 && trail <= 0xDFFF) {\n+ state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n+ return true\n+ }\n }\n+ state.pos = leadSurrogateEnd;\n+ state.lastIntValue = lead;\n }\n- state.pos = leadSurrogateEnd;\n- state.lastIntValue = lead;\n+ return true\n }\n- return true\n- }\n- if (\n- switchU &&\n- state.eat(0x7B /* { */ ) &&\n- this.regexp_eatHexDigits(state) &&\n- state.eat(0x7D /* } */ ) &&\n- isValidUnicode(state.lastIntValue)\n- ) {\n- return true\n- }\n- if (switchU) {\n- state.raise(\"Invalid unicode escape\");\n+ if (\n+ switchU &&\n+ state.eat(0x7B /* { */ ) &&\n+ this.regexp_eatHexDigits(state) &&\n+ state.eat(0x7D /* } */ ) &&\n+ isValidUnicode(state.lastIntValue)\n+ ) {\n+ return true\n+ }\n+ if (switchU) {\n+ state.raise(\"Invalid unicode escape\");\n+ }\n+ state.pos = start;\n }\n- state.pos = start;\n- }\n \n- return false\n- };\n+ return false\n+ };\n \n- function isValidUnicode(ch) {\n- return ch >= 0 && ch <= 0x10FFFF\n- }\n+ function isValidUnicode(ch) {\n+ return ch >= 0 && ch <= 0x10FFFF\n+ }\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\n- pp$1.regexp_eatIdentityEscape = function(state) {\n- if (state.switchU) {\n- if (this.regexp_eatSyntaxCharacter(state)) {\n- return true\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\n+ pp$1.regexp_eatIdentityEscape = function(state) {\n+ if (state.switchU) {\n+ if (this.regexp_eatSyntaxCharacter(state)) {\n+ return true\n+ }\n+ if (state.eat(0x2F /* / */ )) {\n+ state.lastIntValue = 0x2F; /* / */\n+ return true\n+ }\n+ return false\n }\n- if (state.eat(0x2F /* / */ )) {\n- state.lastIntValue = 0x2F; /* / */\n+\n+ var ch = state.current();\n+ if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */ )) {\n+ state.lastIntValue = ch;\n+ state.advance();\n return true\n }\n+\n return false\n- }\n+ };\n \n- var ch = state.current();\n- if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */ )) {\n- state.lastIntValue = ch;\n- state.advance();\n- return true\n- }\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\n+ pp$1.regexp_eatDecimalEscape = function(state) {\n+ state.lastIntValue = 0;\n+ var ch = state.current();\n+ if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */ ) {\n+ do {\n+ state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */ );\n+ state.advance();\n+ } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ )\n+ return true\n+ }\n+ return false\n+ };\n \n- return false\n- };\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\n+ pp$1.regexp_eatCharacterClassEscape = function(state) {\n+ var ch = state.current();\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\n- pp$1.regexp_eatDecimalEscape = function(state) {\n- state.lastIntValue = 0;\n- var ch = state.current();\n- if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */ ) {\n- do {\n- state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */ );\n+ if (isCharacterClassEscape(ch)) {\n+ state.lastIntValue = -1;\n state.advance();\n- } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ )\n- return true\n- }\n- return false\n- };\n-\n- // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\n- pp$1.regexp_eatCharacterClassEscape = function(state) {\n- var ch = state.current();\n-\n- if (isCharacterClassEscape(ch)) {\n- state.lastIntValue = -1;\n- state.advance();\n- return true\n- }\n+ return true\n+ }\n \n- if (\n- state.switchU &&\n- this.options.ecmaVersion >= 9 &&\n- (ch === 0x50 /* P */ || ch === 0x70 /* p */ )\n- ) {\n- state.lastIntValue = -1;\n- state.advance();\n if (\n- state.eat(0x7B /* { */ ) &&\n- this.regexp_eatUnicodePropertyValueExpression(state) &&\n- state.eat(0x7D /* } */ )\n+ state.switchU &&\n+ this.options.ecmaVersion >= 9 &&\n+ (ch === 0x50 /* P */ || ch === 0x70 /* p */ )\n ) {\n- return true\n+ state.lastIntValue = -1;\n+ state.advance();\n+ if (\n+ state.eat(0x7B /* { */ ) &&\n+ this.regexp_eatUnicodePropertyValueExpression(state) &&\n+ state.eat(0x7D /* } */ )\n+ ) {\n+ return true\n+ }\n+ state.raise(\"Invalid property name\");\n }\n- state.raise(\"Invalid property name\");\n- }\n \n- return false\n- };\n+ return false\n+ };\n \n- function isCharacterClassEscape(ch) {\n- return (\n- ch === 0x64 /* d */ ||\n- ch === 0x44 /* D */ ||\n- ch === 0x73 /* s */ ||\n- ch === 0x53 /* S */ ||\n- ch === 0x77 /* w */ ||\n- ch === 0x57 /* W */\n- )\n- }\n+ function isCharacterClassEscape(ch) {\n+ return (\n+ ch === 0x64 /* d */ ||\n+ ch === 0x44 /* D */ ||\n+ ch === 0x73 /* s */ ||\n+ ch === 0x53 /* S */ ||\n+ ch === 0x77 /* w */ ||\n+ ch === 0x57 /* W */\n+ )\n+ }\n \n- // UnicodePropertyValueExpression ::\n- // UnicodePropertyName `=` UnicodePropertyValue\n- // LoneUnicodePropertyNameOrValue\n- pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {\n- var start = state.pos;\n-\n- // UnicodePropertyName `=` UnicodePropertyValue\n- if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */ )) {\n- var name = state.lastStringValue;\n- if (this.regexp_eatUnicodePropertyValue(state)) {\n- var value = state.lastStringValue;\n- this.regexp_validateUnicodePropertyNameAndValue(state, name, value);\n+ // UnicodePropertyValueExpression ::\n+ // UnicodePropertyName `=` UnicodePropertyValue\n+ // LoneUnicodePropertyNameOrValue\n+ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {\n+ var start = state.pos;\n+\n+ // UnicodePropertyName `=` UnicodePropertyValue\n+ if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */ )) {\n+ var name = state.lastStringValue;\n+ if (this.regexp_eatUnicodePropertyValue(state)) {\n+ var value = state.lastStringValue;\n+ this.regexp_validateUnicodePropertyNameAndValue(state, name, value);\n+ return true\n+ }\n+ }\n+ state.pos = start;\n+\n+ // LoneUnicodePropertyNameOrValue\n+ if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n+ var nameOrValue = state.lastStringValue;\n+ this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);\n return true\n }\n- }\n- state.pos = start;\n-\n- // LoneUnicodePropertyNameOrValue\n- if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n- var nameOrValue = state.lastStringValue;\n- this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);\n- return true\n- }\n- return false\n- };\n- pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n- if (!hasOwn(state.unicodeProperties.nonBinary, name)) {\n- state.raise(\"Invalid property name\");\n- }\n- if (!state.unicodeProperties.nonBinary[name].test(value)) {\n- state.raise(\"Invalid property value\");\n- }\n- };\n- pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n- if (!state.unicodeProperties.binary.test(nameOrValue)) {\n- state.raise(\"Invalid property name\");\n- }\n- };\n+ return false\n+ };\n+ pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n+ if (!hasOwn(state.unicodeProperties.nonBinary, name)) {\n+ state.raise(\"Invalid property name\");\n+ }\n+ if (!state.unicodeProperties.nonBinary[name].test(value)) {\n+ state.raise(\"Invalid property value\");\n+ }\n+ };\n+ pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n+ if (!state.unicodeProperties.binary.test(nameOrValue)) {\n+ state.raise(\"Invalid property name\");\n+ }\n+ };\n+\n+ // UnicodePropertyName ::\n+ // UnicodePropertyNameCharacters\n+ pp$1.regexp_eatUnicodePropertyName = function(state) {\n+ var ch = 0;\n+ state.lastStringValue = \"\";\n+ while (isUnicodePropertyNameCharacter(ch = state.current())) {\n+ state.lastStringValue += codePointToString(ch);\n+ state.advance();\n+ }\n+ return state.lastStringValue !== \"\"\n+ };\n \n- // UnicodePropertyName ::\n- // UnicodePropertyNameCharacters\n- pp$1.regexp_eatUnicodePropertyName = function(state) {\n- var ch = 0;\n- state.lastStringValue = \"\";\n- while (isUnicodePropertyNameCharacter(ch = state.current())) {\n- state.lastStringValue += codePointToString(ch);\n- state.advance();\n+ function isUnicodePropertyNameCharacter(ch) {\n+ return isControlLetter(ch) || ch === 0x5F /* _ */\n }\n- return state.lastStringValue !== \"\"\n- };\n \n- function isUnicodePropertyNameCharacter(ch) {\n- return isControlLetter(ch) || ch === 0x5F /* _ */\n- }\n+ // UnicodePropertyValue ::\n+ // UnicodePropertyValueCharacters\n+ pp$1.regexp_eatUnicodePropertyValue = function(state) {\n+ var ch = 0;\n+ state.lastStringValue = \"\";\n+ while (isUnicodePropertyValueCharacter(ch = state.current())) {\n+ state.lastStringValue += codePointToString(ch);\n+ state.advance();\n+ }\n+ return state.lastStringValue !== \"\"\n+ };\n \n- // UnicodePropertyValue ::\n- // UnicodePropertyValueCharacters\n- pp$1.regexp_eatUnicodePropertyValue = function(state) {\n- var ch = 0;\n- state.lastStringValue = \"\";\n- while (isUnicodePropertyValueCharacter(ch = state.current())) {\n- state.lastStringValue += codePointToString(ch);\n- state.advance();\n+ function isUnicodePropertyValueCharacter(ch) {\n+ return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n }\n- return state.lastStringValue !== \"\"\n- };\n \n- function isUnicodePropertyValueCharacter(ch) {\n- return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n- }\n-\n- // LoneUnicodePropertyNameOrValue ::\n- // UnicodePropertyValueCharacters\n- pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n- return this.regexp_eatUnicodePropertyValue(state)\n- };\n+ // LoneUnicodePropertyNameOrValue ::\n+ // UnicodePropertyValueCharacters\n+ pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n+ return this.regexp_eatUnicodePropertyValue(state)\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\n- pp$1.regexp_eatCharacterClass = function(state) {\n- if (state.eat(0x5B /* [ */ )) {\n- state.eat(0x5E /* ^ */ );\n- this.regexp_classRanges(state);\n- if (state.eat(0x5D /* ] */ )) {\n- return true\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\n+ pp$1.regexp_eatCharacterClass = function(state) {\n+ if (state.eat(0x5B /* [ */ )) {\n+ state.eat(0x5E /* ^ */ );\n+ this.regexp_classRanges(state);\n+ if (state.eat(0x5D /* ] */ )) {\n+ return true\n+ }\n+ // Unreachable since it threw \"unterminated regular expression\" error before.\n+ state.raise(\"Unterminated character class\");\n }\n- // Unreachable since it threw \"unterminated regular expression\" error before.\n- state.raise(\"Unterminated character class\");\n- }\n- return false\n- };\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\n- // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n- // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\n- pp$1.regexp_classRanges = function(state) {\n- while (this.regexp_eatClassAtom(state)) {\n- var left = state.lastIntValue;\n- if (state.eat(0x2D /* - */ ) && this.regexp_eatClassAtom(state)) {\n- var right = state.lastIntValue;\n- if (state.switchU && (left === -1 || right === -1)) {\n- state.raise(\"Invalid character class\");\n- }\n- if (left !== -1 && right !== -1 && left > right) {\n- state.raise(\"Range out of order in character class\");\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\n+ pp$1.regexp_classRanges = function(state) {\n+ while (this.regexp_eatClassAtom(state)) {\n+ var left = state.lastIntValue;\n+ if (state.eat(0x2D /* - */ ) && this.regexp_eatClassAtom(state)) {\n+ var right = state.lastIntValue;\n+ if (state.switchU && (left === -1 || right === -1)) {\n+ state.raise(\"Invalid character class\");\n+ }\n+ if (left !== -1 && right !== -1 && left > right) {\n+ state.raise(\"Range out of order in character class\");\n+ }\n }\n }\n- }\n- };\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n- // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\n- pp$1.regexp_eatClassAtom = function(state) {\n- var start = state.pos;\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\n+ pp$1.regexp_eatClassAtom = function(state) {\n+ var start = state.pos;\n \n- if (state.eat(0x5C /* \\ */ )) {\n- if (this.regexp_eatClassEscape(state)) {\n- return true\n- }\n- if (state.switchU) {\n- // Make the same message as V8.\n- var ch$1 = state.current();\n- if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {\n- state.raise(\"Invalid class escape\");\n+ if (state.eat(0x5C /* \\ */ )) {\n+ if (this.regexp_eatClassEscape(state)) {\n+ return true\n }\n- state.raise(\"Invalid escape\");\n+ if (state.switchU) {\n+ // Make the same message as V8.\n+ var ch$1 = state.current();\n+ if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {\n+ state.raise(\"Invalid class escape\");\n+ }\n+ state.raise(\"Invalid escape\");\n+ }\n+ state.pos = start;\n }\n- state.pos = start;\n- }\n \n- var ch = state.current();\n- if (ch !== 0x5D /* ] */ ) {\n- state.lastIntValue = ch;\n- state.advance();\n- return true\n- }\n-\n- return false\n- };\n+ var ch = state.current();\n+ if (ch !== 0x5D /* ] */ ) {\n+ state.lastIntValue = ch;\n+ state.advance();\n+ return true\n+ }\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\n- pp$1.regexp_eatClassEscape = function(state) {\n- var start = state.pos;\n+ return false\n+ };\n \n- if (state.eat(0x62 /* b */ )) {\n- state.lastIntValue = 0x08; /* */\n- return true\n- }\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\n+ pp$1.regexp_eatClassEscape = function(state) {\n+ var start = state.pos;\n \n- if (state.switchU && state.eat(0x2D /* - */ )) {\n- state.lastIntValue = 0x2D; /* - */\n- return true\n- }\n+ if (state.eat(0x62 /* b */ )) {\n+ state.lastIntValue = 0x08; /* */\n+ return true\n+ }\n \n- if (!state.switchU && state.eat(0x63 /* c */ )) {\n- if (this.regexp_eatClassControlLetter(state)) {\n+ if (state.switchU && state.eat(0x2D /* - */ )) {\n+ state.lastIntValue = 0x2D; /* - */\n return true\n }\n- state.pos = start;\n- }\n \n- return (\n- this.regexp_eatCharacterClassEscape(state) ||\n- this.regexp_eatCharacterEscape(state)\n- )\n- };\n+ if (!state.switchU && state.eat(0x63 /* c */ )) {\n+ if (this.regexp_eatClassControlLetter(state)) {\n+ return true\n+ }\n+ state.pos = start;\n+ }\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\n- pp$1.regexp_eatClassControlLetter = function(state) {\n- var ch = state.current();\n- if (isDecimalDigit(ch) || ch === 0x5F /* _ */ ) {\n- state.lastIntValue = ch % 0x20;\n- state.advance();\n- return true\n- }\n- return false\n- };\n+ return (\n+ this.regexp_eatCharacterClassEscape(state) ||\n+ this.regexp_eatCharacterEscape(state)\n+ )\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\n- pp$1.regexp_eatHexEscapeSequence = function(state) {\n- var start = state.pos;\n- if (state.eat(0x78 /* x */ )) {\n- if (this.regexp_eatFixedHexDigits(state, 2)) {\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\n+ pp$1.regexp_eatClassControlLetter = function(state) {\n+ var ch = state.current();\n+ if (isDecimalDigit(ch) || ch === 0x5F /* _ */ ) {\n+ state.lastIntValue = ch % 0x20;\n+ state.advance();\n return true\n }\n- if (state.switchU) {\n- state.raise(\"Invalid escape\");\n- }\n- state.pos = start;\n- }\n- return false\n- };\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\n- pp$1.regexp_eatDecimalDigits = function(state) {\n- var start = state.pos;\n- var ch = 0;\n- state.lastIntValue = 0;\n- while (isDecimalDigit(ch = state.current())) {\n- state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */ );\n- state.advance();\n- }\n- return state.pos !== start\n- };\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\n+ pp$1.regexp_eatHexEscapeSequence = function(state) {\n+ var start = state.pos;\n+ if (state.eat(0x78 /* x */ )) {\n+ if (this.regexp_eatFixedHexDigits(state, 2)) {\n+ return true\n+ }\n+ if (state.switchU) {\n+ state.raise(\"Invalid escape\");\n+ }\n+ state.pos = start;\n+ }\n+ return false\n+ };\n \n- function isDecimalDigit(ch) {\n- return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n- }\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\n+ pp$1.regexp_eatDecimalDigits = function(state) {\n+ var start = state.pos;\n+ var ch = 0;\n+ state.lastIntValue = 0;\n+ while (isDecimalDigit(ch = state.current())) {\n+ state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */ );\n+ state.advance();\n+ }\n+ return state.pos !== start\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\n- pp$1.regexp_eatHexDigits = function(state) {\n- var start = state.pos;\n- var ch = 0;\n- state.lastIntValue = 0;\n- while (isHexDigit(ch = state.current())) {\n- state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n- state.advance();\n+ function isDecimalDigit(ch) {\n+ return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n }\n- return state.pos !== start\n- };\n \n- function isHexDigit(ch) {\n- return (\n- (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ ) ||\n- (ch >= 0x41 /* A */ && ch <= 0x46 /* F */ ) ||\n- (ch >= 0x61 /* a */ && ch <= 0x66 /* f */ )\n- )\n- }\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\n+ pp$1.regexp_eatHexDigits = function(state) {\n+ var start = state.pos;\n+ var ch = 0;\n+ state.lastIntValue = 0;\n+ while (isHexDigit(ch = state.current())) {\n+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n+ state.advance();\n+ }\n+ return state.pos !== start\n+ };\n \n- function hexToInt(ch) {\n- if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */ ) {\n- return 10 + (ch - 0x41 /* A */ )\n+ function isHexDigit(ch) {\n+ return (\n+ (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ ) ||\n+ (ch >= 0x41 /* A */ && ch <= 0x46 /* F */ ) ||\n+ (ch >= 0x61 /* a */ && ch <= 0x66 /* f */ )\n+ )\n }\n- if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */ ) {\n- return 10 + (ch - 0x61 /* a */ )\n+\n+ function hexToInt(ch) {\n+ if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */ ) {\n+ return 10 + (ch - 0x41 /* A */ )\n+ }\n+ if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */ ) {\n+ return 10 + (ch - 0x61 /* a */ )\n+ }\n+ return ch - 0x30 /* 0 */\n }\n- return ch - 0x30 /* 0 */\n- }\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n- // Allows only 0-377(octal) i.e. 0-255(decimal).\n- pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {\n- if (this.regexp_eatOctalDigit(state)) {\n- var n1 = state.lastIntValue;\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n+ // Allows only 0-377(octal) i.e. 0-255(decimal).\n+ pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {\n if (this.regexp_eatOctalDigit(state)) {\n- var n2 = state.lastIntValue;\n- if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n- state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;\n+ var n1 = state.lastIntValue;\n+ if (this.regexp_eatOctalDigit(state)) {\n+ var n2 = state.lastIntValue;\n+ if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n+ state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;\n+ } else {\n+ state.lastIntValue = n1 * 8 + n2;\n+ }\n } else {\n- state.lastIntValue = n1 * 8 + n2;\n+ state.lastIntValue = n1;\n }\n- } else {\n- state.lastIntValue = n1;\n+ return true\n }\n- return true\n- }\n- return false\n- };\n-\n- // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\n- pp$1.regexp_eatOctalDigit = function(state) {\n- var ch = state.current();\n- if (isOctalDigit(ch)) {\n- state.lastIntValue = ch - 0x30; /* 0 */\n- state.advance();\n- return true\n- }\n- state.lastIntValue = 0;\n- return false\n- };\n-\n- function isOctalDigit(ch) {\n- return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n- }\n+ return false\n+ };\n \n- // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n- // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n- // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\n- pp$1.regexp_eatFixedHexDigits = function(state, length) {\n- var start = state.pos;\n- state.lastIntValue = 0;\n- for (var i = 0; i < length; ++i) {\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\n+ pp$1.regexp_eatOctalDigit = function(state) {\n var ch = state.current();\n- if (!isHexDigit(ch)) {\n- state.pos = start;\n- return false\n+ if (isOctalDigit(ch)) {\n+ state.lastIntValue = ch - 0x30; /* 0 */\n+ state.advance();\n+ return true\n }\n- state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n- state.advance();\n- }\n- return true\n- };\n+ state.lastIntValue = 0;\n+ return false\n+ };\n \n- // Object type used to represent tokens. Note that normally, tokens\n- // simply exist as properties on the parser object. This is only\n- // used for the onToken callback and the external tokenizer.\n-\n- var Token = function Token(p) {\n- this.type = p.type;\n- this.value = p.value;\n- this.start = p.start;\n- this.end = p.end;\n- if (p.options.locations) {\n- this.loc = new SourceLocation(p, p.startLoc, p.endLoc);\n- }\n- if (p.options.ranges) {\n- this.range = [p.start, p.end];\n+ function isOctalDigit(ch) {\n+ return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n }\n- };\n \n- // ## Tokenizer\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n+ // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\n+ pp$1.regexp_eatFixedHexDigits = function(state, length) {\n+ var start = state.pos;\n+ state.lastIntValue = 0;\n+ for (var i = 0; i < length; ++i) {\n+ var ch = state.current();\n+ if (!isHexDigit(ch)) {\n+ state.pos = start;\n+ return false\n+ }\n+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n+ state.advance();\n+ }\n+ return true\n+ };\n+\n+ // Object type used to represent tokens. Note that normally, tokens\n+ // simply exist as properties on the parser object. This is only\n+ // used for the onToken callback and the external tokenizer.\n+\n+ var Token = function Token(p) {\n+ this.type = p.type;\n+ this.value = p.value;\n+ this.start = p.start;\n+ this.end = p.end;\n+ if (p.options.locations) {\n+ this.loc = new SourceLocation(p, p.startLoc, p.endLoc);\n+ }\n+ if (p.options.ranges) {\n+ this.range = [p.start, p.end];\n+ }\n+ };\n \n- var pp = Parser.prototype;\n+ // ## Tokenizer\n \n- // Move to the next token\n+ var pp = Parser.prototype;\n \n- pp.next = function(ignoreEscapeSequenceInKeyword) {\n- if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) {\n- this.raiseRecoverable(this.start, \"Escape sequence in keyword \" + this.type.keyword);\n- }\n- if (this.options.onToken) {\n- this.options.onToken(new Token(this));\n- }\n+ // Move to the next token\n \n- this.lastTokEnd = this.end;\n- this.lastTokStart = this.start;\n- this.lastTokEndLoc = this.endLoc;\n- this.lastTokStartLoc = this.startLoc;\n- this.nextToken();\n- };\n+ pp.next = function(ignoreEscapeSequenceInKeyword) {\n+ if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) {\n+ this.raiseRecoverable(this.start, \"Escape sequence in keyword \" + this.type.keyword);\n+ }\n+ if (this.options.onToken) {\n+ this.options.onToken(new Token(this));\n+ }\n \n- pp.getToken = function() {\n- this.next();\n- return new Token(this)\n- };\n+ this.lastTokEnd = this.end;\n+ this.lastTokStart = this.start;\n+ this.lastTokEndLoc = this.endLoc;\n+ this.lastTokStartLoc = this.startLoc;\n+ this.nextToken();\n+ };\n \n- // If we're in an ES6 environment, make parsers iterable\n- if (typeof Symbol !== \"undefined\") {\n- pp[Symbol.iterator] = function() {\n- var this$1$1 = this;\n-\n- return {\n- next: function() {\n- var token = this$1$1.getToken();\n- return {\n- done: token.type === types$1.eof,\n- value: token\n+ pp.getToken = function() {\n+ this.next();\n+ return new Token(this)\n+ };\n+\n+ // If we're in an ES6 environment, make parsers iterable\n+ if (typeof Symbol !== \"undefined\") {\n+ pp[Symbol.iterator] = function() {\n+ var this$1$1 = this;\n+\n+ return {\n+ next: function() {\n+ var token = this$1$1.getToken();\n+ return {\n+ done: token.type === types$1.eof,\n+ value: token\n+ }\n }\n }\n- }\n- };\n- }\n+ };\n+ }\n \n- // Toggle strict mode. Re-reads the next number or string to please\n- // pedantic tests (`\"use strict\"; 010;` should fail).\n+ // Toggle strict mode. Re-reads the next number or string to please\n+ // pedantic tests (`\"use strict\"; 010;` should fail).\n \n- // Read a single token, updating the parser object's token-related\n- // properties.\n+ // Read a single token, updating the parser object's token-related\n+ // properties.\n \n- pp.nextToken = function() {\n- var curContext = this.curContext();\n- if (!curContext || !curContext.preserveSpace) {\n- this.skipSpace();\n- }\n+ pp.nextToken = function() {\n+ var curContext = this.curContext();\n+ if (!curContext || !curContext.preserveSpace) {\n+ this.skipSpace();\n+ }\n \n- this.start = this.pos;\n- if (this.options.locations) {\n- this.startLoc = this.curPosition();\n- }\n- if (this.pos >= this.input.length) {\n- return this.finishToken(types$1.eof)\n- }\n+ this.start = this.pos;\n+ if (this.options.locations) {\n+ this.startLoc = this.curPosition();\n+ }\n+ if (this.pos >= this.input.length) {\n+ return this.finishToken(types$1.eof)\n+ }\n \n- if (curContext.override) {\n- return curContext.override(this)\n- } else {\n- this.readToken(this.fullCharCodeAtPos());\n- }\n- };\n+ if (curContext.override) {\n+ return curContext.override(this)\n+ } else {\n+ this.readToken(this.fullCharCodeAtPos());\n+ }\n+ };\n \n- pp.readToken = function(code) {\n- // Identifier or keyword. '\\uXXXX' sequences are allowed in\n- // identifiers, so '\\' also dispatches to that.\n- if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */ ) {\n- return this.readWord()\n- }\n+ pp.readToken = function(code) {\n+ // Identifier or keyword. '\\uXXXX' sequences are allowed in\n+ // identifiers, so '\\' also dispatches to that.\n+ if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */ ) {\n+ return this.readWord()\n+ }\n \n- return this.getTokenFromCode(code)\n- };\n+ return this.getTokenFromCode(code)\n+ };\n \n- pp.fullCharCodeAtPos = function() {\n- var code = this.input.charCodeAt(this.pos);\n- if (code <= 0xd7ff || code >= 0xdc00) {\n- return code\n- }\n- var next = this.input.charCodeAt(this.pos + 1);\n- return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00\n- };\n+ pp.fullCharCodeAtPos = function() {\n+ var code = this.input.charCodeAt(this.pos);\n+ if (code <= 0xd7ff || code >= 0xdc00) {\n+ return code\n+ }\n+ var next = this.input.charCodeAt(this.pos + 1);\n+ return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00\n+ };\n \n- pp.skipBlockComment = function() {\n- var startLoc = this.options.onComment && this.curPosition();\n- var start = this.pos,\n- end = this.input.indexOf(\"*/\", this.pos += 2);\n- if (end === -1) {\n- this.raise(this.pos - 2, \"Unterminated comment\");\n- }\n- this.pos = end + 2;\n- if (this.options.locations) {\n- for (var nextBreak = (void 0), pos = start;\n- (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {\n- ++this.curLine;\n- pos = this.lineStart = nextBreak;\n+ pp.skipBlockComment = function() {\n+ var startLoc = this.options.onComment && this.curPosition();\n+ var start = this.pos,\n+ end = this.input.indexOf(\"*/\", this.pos += 2);\n+ if (end === -1) {\n+ this.raise(this.pos - 2, \"Unterminated comment\");\n }\n- }\n- if (this.options.onComment) {\n- this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n- startLoc, this.curPosition());\n- }\n- };\n+ this.pos = end + 2;\n+ if (this.options.locations) {\n+ for (var nextBreak = (void 0), pos = start;\n+ (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {\n+ ++this.curLine;\n+ pos = this.lineStart = nextBreak;\n+ }\n+ }\n+ if (this.options.onComment) {\n+ this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n+ startLoc, this.curPosition());\n+ }\n+ };\n \n- pp.skipLineComment = function(startSkip) {\n- var start = this.pos;\n- var startLoc = this.options.onComment && this.curPosition();\n- var ch = this.input.charCodeAt(this.pos += startSkip);\n- while (this.pos < this.input.length && !isNewLine(ch)) {\n- ch = this.input.charCodeAt(++this.pos);\n- }\n- if (this.options.onComment) {\n- this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n- startLoc, this.curPosition());\n- }\n- };\n+ pp.skipLineComment = function(startSkip) {\n+ var start = this.pos;\n+ var startLoc = this.options.onComment && this.curPosition();\n+ var ch = this.input.charCodeAt(this.pos += startSkip);\n+ while (this.pos < this.input.length && !isNewLine(ch)) {\n+ ch = this.input.charCodeAt(++this.pos);\n+ }\n+ if (this.options.onComment) {\n+ this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n+ startLoc, this.curPosition());\n+ }\n+ };\n \n- // Called at the start of the parse and after every token. Skips\n- // whitespace and comments, and.\n+ // Called at the start of the parse and after every token. Skips\n+ // whitespace and comments, and.\n \n- pp.skipSpace = function() {\n- loop: while (this.pos < this.input.length) {\n- var ch = this.input.charCodeAt(this.pos);\n- switch (ch) {\n- case 32:\n- case 160: // ' '\n- ++this.pos;\n- break\n- case 13:\n- if (this.input.charCodeAt(this.pos + 1) === 10) {\n+ pp.skipSpace = function() {\n+ loop: while (this.pos < this.input.length) {\n+ var ch = this.input.charCodeAt(this.pos);\n+ switch (ch) {\n+ case 32:\n+ case 160: // ' '\n ++this.pos;\n- }\n- case 10:\n- case 8232:\n- case 8233:\n- ++this.pos;\n- if (this.options.locations) {\n- ++this.curLine;\n- this.lineStart = this.pos;\n- }\n- break\n- case 47: // '/'\n- switch (this.input.charCodeAt(this.pos + 1)) {\n- case 42: // '*'\n- this.skipBlockComment();\n- break\n- case 47:\n- this.skipLineComment(2);\n- break\n- default:\n- break loop\n- }\n- break\n- default:\n- if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n+ break\n+ case 13:\n+ if (this.input.charCodeAt(this.pos + 1) === 10) {\n+ ++this.pos;\n+ }\n+ case 10:\n+ case 8232:\n+ case 8233:\n ++this.pos;\n- } else {\n- break loop\n- }\n+ if (this.options.locations) {\n+ ++this.curLine;\n+ this.lineStart = this.pos;\n+ }\n+ break\n+ case 47: // '/'\n+ switch (this.input.charCodeAt(this.pos + 1)) {\n+ case 42: // '*'\n+ this.skipBlockComment();\n+ break\n+ case 47:\n+ this.skipLineComment(2);\n+ break\n+ default:\n+ break loop\n+ }\n+ break\n+ default:\n+ if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n+ ++this.pos;\n+ } else {\n+ break loop\n+ }\n+ }\n }\n- }\n- };\n+ };\n \n- // Called at the end of every token. Sets `end`, `val`, and\n- // maintains `context` and `exprAllowed`, and skips the space after\n- // the token, so that the next one's `start` will point at the\n- // right position.\n-\n- pp.finishToken = function(type, val) {\n- this.end = this.pos;\n- if (this.options.locations) {\n- this.endLoc = this.curPosition();\n- }\n- var prevType = this.type;\n- this.type = type;\n- this.value = val;\n+ // Called at the end of every token. Sets `end`, `val`, and\n+ // maintains `context` and `exprAllowed`, and skips the space after\n+ // the token, so that the next one's `start` will point at the\n+ // right position.\n \n- this.updateContext(prevType);\n- };\n+ pp.finishToken = function(type, val) {\n+ this.end = this.pos;\n+ if (this.options.locations) {\n+ this.endLoc = this.curPosition();\n+ }\n+ var prevType = this.type;\n+ this.type = type;\n+ this.value = val;\n \n- // ### Token reading\n+ this.updateContext(prevType);\n+ };\n \n- // This is the function that is called to fetch the next token. It\n- // is somewhat obscure, because it works in character codes rather\n- // than characters, and because operator parsing has been inlined\n- // into it.\n- //\n- // All in the name of speed.\n- //\n- pp.readToken_dot = function() {\n- var next = this.input.charCodeAt(this.pos + 1);\n- if (next >= 48 && next <= 57) {\n- return this.readNumber(true)\n- }\n- var next2 = this.input.charCodeAt(this.pos + 2);\n- if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n- this.pos += 3;\n- return this.finishToken(types$1.ellipsis)\n- } else {\n- ++this.pos;\n- return this.finishToken(types$1.dot)\n- }\n- };\n+ // ### Token reading\n \n- pp.readToken_slash = function() { // '/'\n- var next = this.input.charCodeAt(this.pos + 1);\n- if (this.exprAllowed) {\n- ++this.pos;\n- return this.readRegexp()\n- }\n- if (next === 61) {\n- return this.finishOp(types$1.assign, 2)\n- }\n- return this.finishOp(types$1.slash, 1)\n- };\n+ // This is the function that is called to fetch the next token. It\n+ // is somewhat obscure, because it works in character codes rather\n+ // than characters, and because operator parsing has been inlined\n+ // into it.\n+ //\n+ // All in the name of speed.\n+ //\n+ pp.readToken_dot = function() {\n+ var next = this.input.charCodeAt(this.pos + 1);\n+ if (next >= 48 && next <= 57) {\n+ return this.readNumber(true)\n+ }\n+ var next2 = this.input.charCodeAt(this.pos + 2);\n+ if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n+ this.pos += 3;\n+ return this.finishToken(types$1.ellipsis)\n+ } else {\n+ ++this.pos;\n+ return this.finishToken(types$1.dot)\n+ }\n+ };\n \n- pp.readToken_mult_modulo_exp = function(code) { // '%*'\n- var next = this.input.charCodeAt(this.pos + 1);\n- var size = 1;\n- var tokentype = code === 42 ? types$1.star : types$1.modulo;\n-\n- // exponentiation operator ** and **=\n- if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n- ++size;\n- tokentype = types$1.starstar;\n- next = this.input.charCodeAt(this.pos + 2);\n- }\n+ pp.readToken_slash = function() { // '/'\n+ var next = this.input.charCodeAt(this.pos + 1);\n+ if (this.exprAllowed) {\n+ ++this.pos;\n+ return this.readRegexp()\n+ }\n+ if (next === 61) {\n+ return this.finishOp(types$1.assign, 2)\n+ }\n+ return this.finishOp(types$1.slash, 1)\n+ };\n \n- if (next === 61) {\n- return this.finishOp(types$1.assign, size + 1)\n- }\n- return this.finishOp(tokentype, size)\n- };\n+ pp.readToken_mult_modulo_exp = function(code) { // '%*'\n+ var next = this.input.charCodeAt(this.pos + 1);\n+ var size = 1;\n+ var tokentype = code === 42 ? types$1.star : types$1.modulo;\n+\n+ // exponentiation operator ** and **=\n+ if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n+ ++size;\n+ tokentype = types$1.starstar;\n+ next = this.input.charCodeAt(this.pos + 2);\n+ }\n+\n+ if (next === 61) {\n+ return this.finishOp(types$1.assign, size + 1)\n+ }\n+ return this.finishOp(tokentype, size)\n+ };\n \n- pp.readToken_pipe_amp = function(code) { // '|&'\n- var next = this.input.charCodeAt(this.pos + 1);\n- if (next === code) {\n- if (this.options.ecmaVersion >= 12) {\n- var next2 = this.input.charCodeAt(this.pos + 2);\n- if (next2 === 61) {\n- return this.finishOp(types$1.assign, 3)\n+ pp.readToken_pipe_amp = function(code) { // '|&'\n+ var next = this.input.charCodeAt(this.pos + 1);\n+ if (next === code) {\n+ if (this.options.ecmaVersion >= 12) {\n+ var next2 = this.input.charCodeAt(this.pos + 2);\n+ if (next2 === 61) {\n+ return this.finishOp(types$1.assign, 3)\n+ }\n }\n+ return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)\n }\n- return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)\n- }\n- if (next === 61) {\n- return this.finishOp(types$1.assign, 2)\n- }\n- return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)\n- };\n+ if (next === 61) {\n+ return this.finishOp(types$1.assign, 2)\n+ }\n+ return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)\n+ };\n \n- pp.readToken_caret = function() { // '^'\n- var next = this.input.charCodeAt(this.pos + 1);\n- if (next === 61) {\n- return this.finishOp(types$1.assign, 2)\n- }\n- return this.finishOp(types$1.bitwiseXOR, 1)\n- };\n+ pp.readToken_caret = function() { // '^'\n+ var next = this.input.charCodeAt(this.pos + 1);\n+ if (next === 61) {\n+ return this.finishOp(types$1.assign, 2)\n+ }\n+ return this.finishOp(types$1.bitwiseXOR, 1)\n+ };\n \n- pp.readToken_plus_min = function(code) { // '+-'\n- var next = this.input.charCodeAt(this.pos + 1);\n- if (next === code) {\n- if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n- (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n- // A `-->` line comment\n- this.skipLineComment(3);\n+ pp.readToken_plus_min = function(code) { // '+-'\n+ var next = this.input.charCodeAt(this.pos + 1);\n+ if (next === code) {\n+ if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n+ (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n+ // A `-->` line comment\n+ this.skipLineComment(3);\n+ this.skipSpace();\n+ return this.nextToken()\n+ }\n+ return this.finishOp(types$1.incDec, 2)\n+ }\n+ if (next === 61) {\n+ return this.finishOp(types$1.assign, 2)\n+ }\n+ return this.finishOp(types$1.plusMin, 1)\n+ };\n+\n+ pp.readToken_lt_gt = function(code) { // '<>'\n+ var next = this.input.charCodeAt(this.pos + 1);\n+ var size = 1;\n+ if (next === code) {\n+ size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n+ if (this.input.charCodeAt(this.pos + size) === 61) {\n+ return this.finishOp(types$1.assign, size + 1)\n+ }\n+ return this.finishOp(types$1.bitShift, size)\n+ }\n+ if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n+ this.input.charCodeAt(this.pos + 3) === 45) {\n+ // `