diff --git a/package-lock.json b/package-lock.json index bfe8cd65d70..cd392c76aac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -193,9 +193,9 @@ } }, "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" + "version": "0.0.40", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.40.tgz", + "integrity": "sha512-p3KZgMto/JyxosKGmnLDJ/dG5wf+qTRMUjHJcspC2oQKa4jP7mz+tv0ND56lLBu3ojHlhzY33Ol+khLyNmilkA==" }, "@types/events": { "version": "3.0.0", @@ -245,9 +245,9 @@ "dev": true }, "@types/node": { - "version": "12.12.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.12.tgz", - "integrity": "sha512-MGuvYJrPU0HUwqF7LqvIj50RZUX23Z+m583KBygKYUZLlZ88n6w28XRNJRJgsHukLEnLz6w6SvxZoLgbr5wLqQ==" + "version": "12.12.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.14.tgz", + "integrity": "sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -354,10 +354,21 @@ "dev": true }, "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz", + "integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } }, "ansi-regex": { "version": "3.0.0", @@ -488,6 +499,12 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, "array-includes": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", @@ -844,12 +861,12 @@ "dev": true }, "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { - "restore-cursor": "^2.0.0" + "restore-cursor": "^3.1.0" } }, "cli-truncate": { @@ -1079,9 +1096,9 @@ "dev": true }, "core-js": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.2.tgz", - "integrity": "sha512-bUTfqFWtNKWp73oNIfRkqwYZJeNT3lstzZcAkhhiuvDraRSgOH1/+F9ZklbpR4zpdKuo4cpXN8tKP7s61yjX+g==", + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.7.tgz", + "integrity": "sha512-qaPVGw30J1wQ0GR3GvoPqlGf9GZfKKF4kFC7kiHlcsPTqH3txrs9crCp3ZiMAXuSenhz89Jnl4GZs/67S5VOSg==", "dev": true }, "core-util-is": { @@ -1469,9 +1486,9 @@ "dev": true }, "eslint": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.7.1.tgz", - "integrity": "sha512-UWzBS79pNcsDSxgxbdjkmzn/B6BhsXMfUaOHnNwyE8nD+Q6pyT96ow2MccVayUTV4yMid4qLhMiQaywctRkBLA==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.7.2.tgz", + "integrity": "sha512-qMlSWJaCSxDFr8fBPvJM9kJwbazrhNcBU3+DszDW1OlEwKBBRWsJc7NJFelvwQpanHCR14cOLD41x8Eqvo3Nng==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -1720,9 +1737,9 @@ "dev": true }, "execa": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-3.3.0.tgz", - "integrity": "sha512-j5Vit5WZR/cbHlqU97+qcnw9WHRCIL4V1SVe75VcHcD1JRBdt8fv0zw89b7CQHQdUHTt2VjuhcF5ibAgVOxqpg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-3.4.0.tgz", + "integrity": "sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -1749,9 +1766,9 @@ } }, "path-key": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.0.tgz", - "integrity": "sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "shebang-command": { @@ -1770,9 +1787,9 @@ "dev": true }, "which": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.1.tgz", - "integrity": "sha512-N7GBZOTswtB9lkQBZA4+zAXrjEIWAUOB93AvzUiudRzRxhUdLURQ7D/gAIMY1gatT/LTbmbcv8SiYazy3eYB7w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -1919,9 +1936,9 @@ "dev": true }, "fast-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.0.tgz", - "integrity": "sha512-TrUz3THiq2Vy3bjfQUB2wNyPdGBeGmdjbzzBLhfHN4YFurYptCKwGq/TfiRavbGywFRzY6U2CdmQ1zmsY5yYaw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.1.tgz", + "integrity": "sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -1964,13 +1981,12 @@ } }, "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz", + "integrity": "sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg==", "dev": true, "requires": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" + "escape-string-regexp": "^1.0.5" } }, "file-entry-cache": { @@ -2867,15 +2883,6 @@ "through": "^2.3.6" }, "dependencies": { - "ansi-escapes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz", - "integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } - }, "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", @@ -2893,30 +2900,12 @@ "supports-color": "^5.3.0" } }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "figures": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz", - "integrity": "sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2929,16 +2918,6 @@ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -2977,12 +2956,6 @@ "dev": true } } - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true } } }, @@ -3198,6 +3171,14 @@ "dev": true, "requires": { "@types/estree": "0.0.39" + }, + "dependencies": { + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + } } }, "is-regex": { @@ -3473,9 +3454,9 @@ } }, "lint-staged": { - "version": "9.4.3", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-9.4.3.tgz", - "integrity": "sha512-PejnI+rwOAmKAIO+5UuAZU9gxdej/ovSEOAY34yMfC3OS4Ac82vCBPzAWLReR9zCPOMqeVwQRaZ3bUBpAsaL2Q==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-9.5.0.tgz", + "integrity": "sha512-nawMob9cb/G1J98nb8v3VC/E8rcX1rryUYXVZ69aT9kde6YWX+uvNOEHY5yf2gcWcTJGiD0kqXmCnS3oD75GIA==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -3558,9 +3539,9 @@ } }, "path-key": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.0.tgz", - "integrity": "sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "shebang-command": { @@ -3579,9 +3560,9 @@ "dev": true }, "which": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.1.tgz", - "integrity": "sha512-N7GBZOTswtB9lkQBZA4+zAXrjEIWAUOB93AvzUiudRzRxhUdLURQ7D/gAIMY1gatT/LTbmbcv8SiYazy3eYB7w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -3667,6 +3648,16 @@ "supports-color": "^2.0.0" } }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, "indent-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", @@ -3711,6 +3702,15 @@ "figures": "^2.0.0" }, "dependencies": { + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -3719,6 +3719,31 @@ "requires": { "escape-string-regexp": "^1.0.5" } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } } } }, @@ -3805,6 +3830,48 @@ "ansi-escapes": "^3.0.0", "cli-cursor": "^2.0.0", "wrap-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + } } }, "lru-cache": { @@ -4514,9 +4581,9 @@ }, "dependencies": { "path-key": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.0.tgz", - "integrity": "sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true } } @@ -5329,30 +5396,13 @@ "dev": true }, "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "requires": { - "onetime": "^2.0.0", + "onetime": "^5.1.0", "signal-exit": "^3.0.2" - }, - "dependencies": { - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - } } }, "ret": { @@ -5377,9 +5427,9 @@ } }, "rollup": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.4.tgz", - "integrity": "sha512-UaGNOIax/Ixfd92CAAanUilx2RSkkwEfC1lCTw1eL5Re6NURWgX66ARZt5+3px4kYnpSwzyOot4r18c2b+QgJQ==", + "version": "1.27.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.8.tgz", + "integrity": "sha512-EVoEV5rAWl+5clnGznt1KY8PeVkzVQh/R0d2s3gHEkN7gfoyC4JmvIVuCtPbYE8NM5Ep/g+nAmvKXBjzaqTsHA==", "dev": true, "requires": { "@types/estree": "*", @@ -5440,23 +5490,25 @@ } }, "rollup-plugin-license": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-0.12.1.tgz", - "integrity": "sha512-zT8UO+Tc+DAVQHM5qeX4jnuHzTtDUYJ/8AHzUgVgqYrx5Wj5kHlvoZNaQqg7hOQbjSuHuJFlQGZmxxSQq2WMqA==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-0.13.0.tgz", + "integrity": "sha512-K1At1InQufYagn1zNTikWG6NorVjdBBoKtJdHqbyV/Z1ksM3wHtWlR/4rqdKxyZjTXNTDzM7mxn7j/HERexLFw==", "dev": true, "requires": { "commenting": "1.1.0", - "glob": "7.1.4", + "glob": "7.1.6", "lodash": "4.17.15", - "magic-string": "0.25.3", + "magic-string": "0.25.4", "mkdirp": "0.5.1", - "moment": "2.24.0" + "moment": "2.24.0", + "spdx-expression-validate": "2.0.0", + "spdx-satisfies": "5.0.0" }, "dependencies": { "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -5472,15 +5524,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true - }, - "magic-string": { - "version": "0.25.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.3.tgz", - "integrity": "sha512-6QK0OpF/phMz0Q2AxILkX2mFhi7m+WMwTRg0LQKq/WBB0cDP4rYH3Wp4/d3OTXlrPLVJT/RFqj8tFeAR4nk8AA==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.4" - } } } }, @@ -5914,6 +5957,17 @@ "which": "^1.3.0" } }, + "spdx-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz", + "integrity": "sha512-C1mDZOX0hnu0ep9dfmuoi03+eOdDoz2yvK79RxbcrVEG1NO1Ph35yW102DHWKN4pk80nwCgeMmSY5L25VE4D9A==", + "dev": true, + "requires": { + "array-find-index": "^1.0.2", + "spdx-expression-parse": "^3.0.0", + "spdx-ranges": "^2.0.0" + } + }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", @@ -5940,12 +5994,38 @@ "spdx-license-ids": "^3.0.0" } }, + "spdx-expression-validate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-validate/-/spdx-expression-validate-2.0.0.tgz", + "integrity": "sha512-b3wydZLM+Tc6CFvaRDBOF9d76oGIHNCLYFeHbftFXUWjnfZWganmDmvtM5sm1cRwJc/VDBMLyGGrsLFd1vOxbg==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0" + } + }, "spdx-license-ids": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", "dev": true }, + "spdx-ranges": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.1.tgz", + "integrity": "sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA==", + "dev": true + }, + "spdx-satisfies": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-5.0.0.tgz", + "integrity": "sha512-/hGhwh20BeGmkA+P/lm06RvXD94JduwNxtx/oX3B5ClPt1/u/m5MCaDNo1tV3Y9laLkQr/NRde63b9lLMhlNfw==", + "dev": true, + "requires": { + "spdx-compare": "^1.0.0", + "spdx-expression-parse": "^3.0.0", + "spdx-ranges": "^2.0.0" + } + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -6067,9 +6147,9 @@ "dev": true }, "systemjs": { - "version": "6.1.5", - "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.1.5.tgz", - "integrity": "sha512-/GKRr2FfyL2zP8ztAe59nmys/cPwgwJlPbylmkKm8cetCe5xWLBPkjw18I04wMomjciZxKXwO8pzgA8VesIflA==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.1.7.tgz", + "integrity": "sha512-v2tDs5HV7Ql8iZd7eBupzTOPIV6OUzNyJ1wNCAlQ7Et73yfQm4dbfQOSNLzcESLY2YEsLbn0K9WAnNsqwK7OFg==", "dev": true }, "table": { @@ -6164,9 +6244,9 @@ } }, "terser": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.4.0.tgz", - "integrity": "sha512-oDG16n2WKm27JO8h4y/w3iqBGAOSCtq7k8dRmrn4Wf9NouL0b2WpMHGChFGZq4nFAQy1FsNJrVQHfurXOSTmOA==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.4.2.tgz", + "integrity": "sha512-Uufrsvhj9O1ikwgITGsZ5EZS6qPokUOkCegS7fYOdGTv+OA90vndUbU6PEjr5ePqHfNUbGyMO7xyIZv2MhsALQ==", "dev": true, "requires": { "commander": "^2.20.0", @@ -6442,9 +6522,9 @@ "dev": true }, "typescript": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz", - "integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz", + "integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==", "dev": true }, "uc.micro": { diff --git a/package.json b/package.json index f5cb9002f9c..b42e242e1c2 100644 --- a/package.json +++ b/package.json @@ -80,19 +80,19 @@ "chokidar": "^2.1.8", "codecov": "^3.6.1", "console-group": "^0.3.3", - "core-js": "^3.4.2", + "core-js": "^3.4.7", "cross-os": "^1.3.0", "date-time": "^3.1.0", "es5-shim": "^4.5.13", "es6-shim": "^0.35.5", - "eslint": "^6.7.1", + "eslint": "^6.7.2", "eslint-plugin-import": "^2.18.2", - "execa": "^3.3.0", + "execa": "^3.4.0", "fixturify": "^1.2.0", "hash.js": "^1.1.7", "husky": "^3.1.0", "is-reference": "^1.1.4", - "lint-staged": "^9.4.3", + "lint-staged": "^9.5.0", "locate-character": "^2.0.5", "magic-string": "^0.25.4", "markdownlint-cli": "^0.19.0", @@ -105,12 +105,12 @@ "pretty-ms": "^5.1.0", "require-relative": "^0.8.7", "requirejs": "^2.3.6", - "rollup": "^1.27.4", + "rollup": "^1.27.8", "rollup-plugin-alias": "^2.2.0", "rollup-plugin-buble": "^0.19.8", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-json": "^4.0.0", - "rollup-plugin-license": "^0.12.1", + "rollup-plugin-license": "^0.13.0", "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-replace": "^2.2.0", "rollup-plugin-string": "^3.0.0", @@ -123,12 +123,12 @@ "source-map": "^0.6.1", "source-map-support": "^0.5.16", "sourcemap-codec": "^1.4.6", - "systemjs": "^6.1.5", - "terser": "^4.4.0", + "systemjs": "^6.1.7", + "terser": "^4.4.2", "tslib": "^1.10.0", "tslint": "^5.20.1", "turbocolor": "^2.6.1", - "typescript": "^3.7.2", + "typescript": "^3.7.3", "url-parse": "^1.4.7" }, "files": [ diff --git a/test/cli/index.js b/test/cli/index.js index 13f496c171d..7b25e47623f 100644 --- a/test/cli/index.js +++ b/test/cli/index.js @@ -26,92 +26,99 @@ runTestSuiteWithSamples( const command = 'node ' + path.resolve(__dirname, '../../dist/bin') + path.sep + config.command; - const childProcess = exec(command, { timeout: 40000 }, (err, code, stderr) => { - if (err && !err.killed) { - if (config.error) { - const shouldContinue = config.error(err); + const childProcess = exec( + command, + { timeout: 40000, env: Object.assign({ FORCE_COLOR: '0' }, process.env, config.env) }, + (err, code, stderr) => { + if (err && !err.killed) { + if (config.error) { + const shouldContinue = config.error(err); + if (!shouldContinue) return done(); + } else { + throw err; + } + } + + if ('stderr' in config) { + const shouldContinue = config.stderr(stderr.trim()); if (!shouldContinue) return done(); - } else { - throw err; + } else if (stderr) { + console.error(stderr); } - } - if ('stderr' in config) { - const shouldContinue = config.stderr(stderr.trim()); - if (!shouldContinue) return done(); - } else if (stderr) { - console.error(stderr); - } + let unintendedError; - let unintendedError; + if (config.execute) { + try { + if (config.buble) { + code = buble.transform(code, { + transforms: { modules: false } + }).code; + } - if (config.execute) { - try { - if (config.buble) { - code = buble.transform(code, { - transforms: { modules: false } - }).code; - } + const fn = new Function('require', 'module', 'exports', 'assert', code); + const module = { + exports: {} + }; + fn(require, module, module.exports, assert); - const fn = new Function('require', 'module', 'exports', 'assert', code); - const module = { - exports: {} - }; - fn(require, module, module.exports, assert); + if (config.error) { + unintendedError = new Error('Expected an error while executing output'); + } - if (config.error) { - unintendedError = new Error('Expected an error while executing output'); + if (config.exports) { + config.exports(module.exports); + } + } catch (err) { + if (config.error) { + config.error(err); + } else { + unintendedError = err; + } } - if (config.exports) { - config.exports(module.exports); - } - } catch (err) { - if (config.error) { - config.error(err); - } else { - unintendedError = err; + if (config.show || unintendedError) { + console.log(code + '\n\n\n'); } - } - - if (config.show || unintendedError) { - console.log(code + '\n\n\n'); - } - if (config.solo) console.groupEnd(); + if (config.solo) console.groupEnd(); - unintendedError ? done(unintendedError) : done(); - } else if (config.result) { - try { - config.result(code); - done(); - } catch (err) { - done(err); - } - } else if (config.test) { - try { - config.test(); - done(); - } catch (err) { - done(err); - } - } else if (sander.existsSync('_expected') && sander.statSync('_expected').isDirectory()) { - try { - assertDirectoriesAreEqual('_actual', '_expected'); - done(); - } catch (err) { - done(err); - } - } else { - const expected = sander.readFileSync('_expected.js').toString(); - try { - assert.equal(normaliseOutput(code), normaliseOutput(expected)); - done(); - } catch (err) { - done(err); + unintendedError ? done(unintendedError) : done(); + } else if (config.result) { + try { + config.result(code); + done(); + } catch (err) { + done(err); + } + } else if (config.test) { + try { + config.test(); + done(); + } catch (err) { + done(err); + } + } else if ( + sander.existsSync('_expected') && + sander.statSync('_expected').isDirectory() + ) { + try { + assertDirectoriesAreEqual('_actual', '_expected'); + done(); + } catch (err) { + done(err); + } + } else { + const expected = sander.readFileSync('_expected.js').toString(); + try { + assert.equal(normaliseOutput(code), normaliseOutput(expected)); + done(); + } catch (err) { + done(err); + } } } - }); + ); childProcess.stderr.on('data', data => { if (config.abortOnStderr && config.abortOnStderr(data)) { diff --git a/test/cli/samples/code-splitting-named-default-inputs/_config.js b/test/cli/samples/code-splitting-named-default-inputs/_config.js index acc79b15858..28ac0795a3f 100644 --- a/test/cli/samples/code-splitting-named-default-inputs/_config.js +++ b/test/cli/samples/code-splitting-named-default-inputs/_config.js @@ -1,29 +1,20 @@ const assert = require('assert'); -const COLOR = '\u001b[36m\u001b[1m'; -const STANDARD = '\u001b[22m\u001b[39m'; - module.exports = { description: 'allows defining names via CLI', command: 'rollup entry1=main1.js "Entry 2"="main 2.js" "main3.js" --entryFileNames [name]-[hash].js -f es', result(code) { - let color = ''; - let standard = ''; - if (code[1] === '\u001b') { - color = COLOR; - standard = STANDARD; - } assert.equal( code, '\n' + - `${color}//→ entry1-b70571c1.js:${standard}\n` + + `//→ entry1-b70571c1.js:\n` + "console.log('main1');\n" + '\n' + - `${color}//→ Entry 2-cc781491.js:${standard}\n` + + `//→ Entry 2-cc781491.js:\n` + "console.log('main2');\n" + '\n' + - `${color}//→ main3-5e259623.js:${standard}\n` + + `//→ main3-5e259623.js:\n` + "console.log('main3');\n" ); } diff --git a/test/cli/samples/code-splitting-named-inputs/_config.js b/test/cli/samples/code-splitting-named-inputs/_config.js index ce0141c3e3d..420bde6475a 100644 --- a/test/cli/samples/code-splitting-named-inputs/_config.js +++ b/test/cli/samples/code-splitting-named-inputs/_config.js @@ -1,29 +1,20 @@ const assert = require('assert'); -const COLOR = '\u001b[36m\u001b[1m'; -const STANDARD = '\u001b[22m\u001b[39m'; - module.exports = { description: 'allows defining names via CLI', command: 'rollup --entryFileNames [name]-[hash].js --input entry1=main1.js -i "Entry 2"="main 2.js" -i "main3.js" -f es', result(code) { - let color = ''; - let standard = ''; - if (code[1] === '\u001b') { - color = COLOR; - standard = STANDARD; - } assert.equal( code, '\n' + - `${color}//→ entry1-b70571c1.js:${standard}\n` + + `//→ entry1-b70571c1.js:\n` + "console.log('main1');\n" + '\n' + - `${color}//→ Entry 2-cc781491.js:${standard}\n` + + `//→ Entry 2-cc781491.js:\n` + "console.log('main2');\n" + '\n' + - `${color}//→ main3-5e259623.js:${standard}\n` + + `//→ main3-5e259623.js:\n` + "console.log('main3');\n" ); } diff --git a/test/cli/samples/no-color/_config.js b/test/cli/samples/no-color/_config.js new file mode 100644 index 00000000000..f9796160d46 --- /dev/null +++ b/test/cli/samples/no-color/_config.js @@ -0,0 +1,18 @@ +const assert = require('assert'); + +module.exports = { + description: 'respects the NO_COLOR environment variable', + command: 'rollup -i main1.js -i main2.js -f es', + env: { FORCE_COLOR: undefined, NO_COLOR: true }, + result(code) { + assert.equal( + code, + '\n' + + '//→ main1.js:\n' + + "console.log('main1');\n" + + '\n' + + '//→ main2.js:\n' + + "console.log('main2');\n" + ); + } +}; diff --git a/test/cli/samples/no-color/main1.js b/test/cli/samples/no-color/main1.js new file mode 100644 index 00000000000..fda34828717 --- /dev/null +++ b/test/cli/samples/no-color/main1.js @@ -0,0 +1 @@ +console.log('main1'); diff --git a/test/cli/samples/no-color/main2.js b/test/cli/samples/no-color/main2.js new file mode 100644 index 00000000000..ac653633351 --- /dev/null +++ b/test/cli/samples/no-color/main2.js @@ -0,0 +1 @@ +console.log('main2'); diff --git a/test/cli/samples/stdout-code-splitting/_config.js b/test/cli/samples/stdout-code-splitting/_config.js index 65e0fa5df21..8b78d9e5424 100644 --- a/test/cli/samples/stdout-code-splitting/_config.js +++ b/test/cli/samples/stdout-code-splitting/_config.js @@ -6,20 +6,15 @@ const STANDARD = '\u001b[22m\u001b[39m'; module.exports = { description: 'bundles multiple files to stdout while adding file names', command: 'rollup -i main1.js -i main2.js -f es', + env: { FORCE_COLOR: '1' }, result(code) { - let color = ''; - let standard = ''; - if (code[1] === '\u001b') { - color = COLOR; - standard = STANDARD; - } assert.equal( code, '\n' + - `${color}//→ main1.js:${standard}\n` + + `${COLOR}//→ main1.js:${STANDARD}\n` + "console.log('main1');\n" + '\n' + - `${color}//→ main2.js:${standard}\n` + + `${COLOR}//→ main2.js:${STANDARD}\n` + "console.log('main2');" + '\n' ); diff --git a/test/cli/samples/warn-circular/_config.js b/test/cli/samples/warn-circular/_config.js index 12af2aad385..12cf9f87e77 100644 --- a/test/cli/samples/warn-circular/_config.js +++ b/test/cli/samples/warn-circular/_config.js @@ -3,6 +3,7 @@ const { assertStderrIncludes } = require('../../../utils.js'); module.exports = { description: 'warns for circular dependencies', command: 'rollup -c', - stderr: stderr => - assertStderrIncludes(stderr, '(!) Circular dependency\n' + 'main.js -> dep.js -> main.js\n') + stderr(stderr) { + assertStderrIncludes(stderr, '(!) Circular dependency\nmain.js -> dep.js -> main.js\n'); + } }; diff --git a/test/form/samples/supports-core-js/_expected.js b/test/form/samples/supports-core-js/_expected.js index dd18d4c3504..8f7e614d827 100644 --- a/test/form/samples/supports-core-js/_expected.js +++ b/test/form/samples/supports-core-js/_expected.js @@ -177,8 +177,6 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) { return object; }; -var isPure = false; - var setGlobal = function (key, value) { try { createNonEnumerableProperty(global_1, key, value); @@ -187,6 +185,8 @@ var setGlobal = function (key, value) { } return value; }; +var isPure = false; + var SHARED = '__core-js_shared__'; var store = global_1[SHARED] || setGlobal(SHARED, {}); @@ -196,17 +196,21 @@ var shared = createCommonjsModule(function (module) { (module.exports = function (key, value) { return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.4.2', + version: '3.4.7', mode: 'global', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); }); -var functionToString = shared('native-function-to-string', Function.toString); +var functionToString = Function.toString; + +var inspectSource = shared('inspectSource', function (it) { + return functionToString.call(it); +}); var WeakMap = global_1.WeakMap; -var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap)); +var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); var id = 0; var postfix = Math.random(); @@ -280,11 +284,7 @@ var internalState = { var redefine = createCommonjsModule(function (module) { var getInternalState = internalState.get; var enforceInternalState = internalState.enforce; -var TEMPLATE = String(functionToString).split('toString'); - -shared('inspectSource', function (it) { - return functionToString.call(it); -}); +var TEMPLATE = String(String).split('String'); (module.exports = function (O, key, value, options) { var unsafe = options ? !!options.unsafe : false; @@ -307,7 +307,7 @@ shared('inspectSource', function (it) { else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, 'toString', function toString() { - return typeof this == 'function' && getInternalState(this).source || functionToString.call(this); + return typeof this == 'function' && getInternalState(this).source || inspectSource(this); }); }); @@ -1141,11 +1141,22 @@ defineWellKnownSymbol('toStringTag'); defineWellKnownSymbol('unscopables'); var nativeAssign = Object.assign; +var defineProperty$3 = Object.defineProperty; // `Object.assign` method // https://tc39.github.io/ecma262/#sec-object.assign -// should work with symbols and should have deterministic property order (V8 bug) var objectAssign = !nativeAssign || fails(function () { + // should have correct order of operations (Edge bug) + if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$3({}, 'a', { + enumerable: true, + get: function () { + defineProperty$3(this, 'b', { + value: 3, + enumerable: false + }); + } + }), { b: 2 })).b !== 1) return true; + // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; // eslint-disable-next-line no-undef @@ -1742,7 +1753,7 @@ _export({ target: 'Function', proto: true }, { bind: functionBind }); -var defineProperty$3 = objectDefineProperty.f; +var defineProperty$4 = objectDefineProperty.f; var FunctionPrototype = Function.prototype; var FunctionPrototypeToString = FunctionPrototype.toString; @@ -1752,7 +1763,7 @@ var NAME = 'name'; // Function instances `.name` property // https://tc39.github.io/ecma262/#sec-function-instances-name if (descriptors && !(NAME in FunctionPrototype)) { - defineProperty$3(FunctionPrototype, NAME, { + defineProperty$4(FunctionPrototype, NAME, { configurable: true, get: function () { try { @@ -2067,10 +2078,17 @@ addToUnscopables('fill'); var $filter = arrayIteration.filter; + +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); +// Edge 14- issue +var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () { + [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; }); +}); + // `Array.prototype.filter` method // https://tc39.github.io/ecma262/#sec-array.prototype.filter // with adding support of @@species -_export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, { +_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, { filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -2260,10 +2278,17 @@ _export({ target: 'Array', proto: true, forced: arrayLastIndexOf !== [].lastInde var $map = arrayIteration.map; + +var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map'); +// FF49- issue +var USES_TO_LENGTH$1 = HAS_SPECIES_SUPPORT$1 && !fails(function () { + [].map.call({ length: -1, 0: 1 }, function (it) { throw it; }); +}); + // `Array.prototype.map` method // https://tc39.github.io/ecma262/#sec-array.prototype.map // with adding support of @@species -_export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, { +_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 || !USES_TO_LENGTH$1 }, { map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -2777,12 +2802,26 @@ var correctIsRegexpLogic = function (METHOD_NAME) { } return false; }; +var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f; + + + + + + var nativeEndsWith = ''.endsWith; var min$5 = Math.min; +var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('endsWith'); +// https://github.com/zloirock/core-js/pull/702 +var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () { + var descriptor = getOwnPropertyDescriptor$4(String.prototype, 'endsWith'); + return descriptor && !descriptor.writable; +}(); + // `String.prototype.endsWith` method // https://tc39.github.io/ecma262/#sec-string.prototype.endswith -_export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('endsWith') }, { +_export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { endsWith: function endsWith(searchString /* , endPosition = @length */) { var that = String(requireObjectCoercible(this)); notARegexp(searchString); @@ -3476,12 +3515,26 @@ fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCal ]; }, !SUPPORTS_Y); +var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f; + + + + + + var nativeStartsWith = ''.startsWith; var min$8 = Math.min; +var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegexpLogic('startsWith'); +// https://github.com/zloirock/core-js/pull/702 +var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () { + var descriptor = getOwnPropertyDescriptor$5(String.prototype, 'startsWith'); + return descriptor && !descriptor.writable; +}(); + // `String.prototype.startsWith` method // https://tc39.github.io/ecma262/#sec-string.prototype.startswith -_export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('startsWith') }, { +_export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, { startsWith: function startsWith(searchString /* , position = 0 */) { var that = String(requireObjectCoercible(this)); notARegexp(searchString); @@ -3744,7 +3797,7 @@ var inheritIfRequired = function ($this, dummy, Wrapper) { return $this; }; -var defineProperty$4 = objectDefineProperty.f; +var defineProperty$5 = objectDefineProperty.f; var getOwnPropertyNames = objectGetOwnPropertyNames.f; @@ -3784,7 +3837,7 @@ if (FORCED$5) { , thisIsRegExp ? this : RegExpPrototype$1, RegExpWrapper); }; var proxy = function (key) { - key in RegExpWrapper || defineProperty$4(RegExpWrapper, key, { + key in RegExpWrapper || defineProperty$5(RegExpWrapper, key, { configurable: true, get: function () { return NativeRegExp[key]; }, set: function (it) { NativeRegExp[key] = it; } @@ -3875,8 +3928,8 @@ _export({ global: true, forced: parseFloat != _parseFloat }, { }); var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f; -var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f; -var defineProperty$5 = objectDefineProperty.f; +var getOwnPropertyDescriptor$6 = objectGetOwnPropertyDescriptor.f; +var defineProperty$6 = objectDefineProperty.f; var trim$2 = stringTrim.trim; var NUMBER = 'Number'; @@ -3934,7 +3987,7 @@ if (isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNu 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' ).split(','), j = 0, key; keys$2.length > j; j++) { if (has(NativeNumber, key = keys$2[j]) && !has(NumberWrapper, key)) { - defineProperty$5(NumberWrapper, key, getOwnPropertyDescriptor$4(NativeNumber, key)); + defineProperty$6(NumberWrapper, key, getOwnPropertyDescriptor$6(NativeNumber, key)); } } NumberWrapper.prototype = NumberPrototype; @@ -4532,6 +4585,35 @@ if (!(TO_PRIMITIVE$1 in DatePrototype$2)) { createNonEnumerableProperty(DatePrototype$2, TO_PRIMITIVE$1, dateToPrimitive); } +var $stringify$1 = getBuiltIn('JSON', 'stringify'); +var re = /[\uD800-\uDFFF]/g; +var low = /^[\uD800-\uDBFF]$/; +var hi = /^[\uDC00-\uDFFF]$/; + +var fix = function (match, offset, string) { + var prev = string.charAt(offset - 1); + var next = string.charAt(offset + 1); + if ((low.test(match) && !hi.test(next)) || (hi.test(match) && !low.test(prev))) { + return '\\u' + match.charCodeAt(0).toString(16); + } return match; +}; + +var FORCED$e = fails(function () { + return $stringify$1('\uDF06\uD834') !== '"\\udf06\\ud834"' + || $stringify$1('\uDEAD') !== '"\\udead"'; +}); + +if ($stringify$1) { + // https://github.com/tc39/proposal-well-formed-stringify + _export({ target: 'JSON', stat: true, forced: FORCED$e }, { + // eslint-disable-next-line no-unused-vars + stringify: function stringify(it, replacer, space) { + var result = $stringify$1.apply(null, arguments); + return typeof result == 'string' ? result.replace(re, fix) : result; + } + }); +} + // JSON[@@toStringTag] property // https://tc39.github.io/ecma262/#sec-json-@@tostringtag setToStringTag(global_1.JSON, 'JSON', true); @@ -4645,7 +4727,7 @@ var task = { clear: clear }; -var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f; +var getOwnPropertyDescriptor$7 = objectGetOwnPropertyDescriptor.f; var macrotask = task.set; @@ -4655,7 +4737,7 @@ var process$2 = global_1.process; var Promise = global_1.Promise; var IS_NODE = classofRaw(process$2) == 'process'; // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` -var queueMicrotaskDescriptor = getOwnPropertyDescriptor$5(global_1, 'queueMicrotask'); +var queueMicrotaskDescriptor = getOwnPropertyDescriptor$7(global_1, 'queueMicrotask'); var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; var flush, head, last, notify, toggle, node, promise, then; @@ -4787,7 +4869,6 @@ var PromiseConstructor = nativePromiseConstructor; var TypeError$1 = global_1.TypeError; var document$2 = global_1.document; var process$3 = global_1.process; -var inspectSource = shared('inspectSource'); var $fetch = getBuiltIn('fetch'); var newPromiseCapability$1 = newPromiseCapability.f; var newGenericPromiseCapability = newPromiseCapability$1; @@ -4802,7 +4883,7 @@ var HANDLED = 1; var UNHANDLED = 2; var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; -var FORCED$e = isForced_1(PROMISE, function () { +var FORCED$f = isForced_1(PROMISE, function () { var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor); if (!GLOBAL_CORE_JS_PROMISE) { // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables @@ -4826,7 +4907,7 @@ var FORCED$e = isForced_1(PROMISE, function () { return !(promise.then(function () { /* empty */ }) instanceof FakePromise); }); -var INCORRECT_ITERATION$1 = FORCED$e || !checkCorrectnessOfIteration(function (iterable) { +var INCORRECT_ITERATION$1 = FORCED$f || !checkCorrectnessOfIteration(function (iterable) { PromiseConstructor.all(iterable)['catch'](function () { /* empty */ }); }); @@ -4972,7 +5053,7 @@ var internalResolve = function (promise, state, value, unwrap) { }; // constructor polyfill -if (FORCED$e) { +if (FORCED$f) { // 25.4.3.1 Promise(executor) PromiseConstructor = function Promise(executor) { anInstance(this, PromiseConstructor, PROMISE); @@ -5053,7 +5134,7 @@ if (FORCED$e) { } } -_export({ global: true, wrap: true, forced: FORCED$e }, { +_export({ global: true, wrap: true, forced: FORCED$f }, { Promise: PromiseConstructor }); @@ -5063,7 +5144,7 @@ setSpecies(PROMISE); PromiseWrapper = getBuiltIn(PROMISE); // statics -_export({ target: PROMISE, stat: true, forced: FORCED$e }, { +_export({ target: PROMISE, stat: true, forced: FORCED$f }, { // `Promise.reject` method // https://tc39.github.io/ecma262/#sec-promise.reject reject: function reject(r) { @@ -5073,7 +5154,7 @@ _export({ target: PROMISE, stat: true, forced: FORCED$e }, { } }); -_export({ target: PROMISE, stat: true, forced: FORCED$e }, { +_export({ target: PROMISE, stat: true, forced: FORCED$f }, { // `Promise.resolve` method // https://tc39.github.io/ecma262/#sec-promise.resolve resolve: function resolve(x) { @@ -5165,9 +5246,14 @@ _export({ target: 'Promise', stat: true }, { } }); +// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829 +var NON_GENERIC = !!nativePromiseConstructor && fails(function () { + nativePromiseConstructor.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ }); +}); + // `Promise.prototype.finally` method // https://tc39.github.io/ecma262/#sec-promise.prototype.finally -_export({ target: 'Promise', proto: true, real: true }, { +_export({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { 'finally': function (onFinally) { var C = speciesConstructor(this, getBuiltIn('Promise')); var isFunction = typeof onFinally == 'function'; @@ -5187,11 +5273,13 @@ if ( typeof nativePromiseConstructor == 'function' && !nativePromiseConstructor. redefine(nativePromiseConstructor.prototype, 'finally', getBuiltIn('Promise').prototype['finally']); } -var collection = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) { +var collection = function (CONSTRUCTOR_NAME, wrapper, common) { + var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; + var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; + var ADDER = IS_MAP ? 'set' : 'add'; var NativeConstructor = global_1[CONSTRUCTOR_NAME]; var NativePrototype = NativeConstructor && NativeConstructor.prototype; var Constructor = NativeConstructor; - var ADDER = IS_MAP ? 'set' : 'add'; var exported = {}; var fixMethod = function (KEY) { @@ -5271,7 +5359,7 @@ var collection = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) { return Constructor; }; -var defineProperty$6 = objectDefineProperty.f; +var defineProperty$7 = objectDefineProperty.f; @@ -5413,7 +5501,7 @@ var collectionStrong = { return define(this, value = value === 0 ? 0 : value, value); } }); - if (descriptors) defineProperty$6(C.prototype, 'size', { + if (descriptors) defineProperty$7(C.prototype, 'size', { get: function () { return getInternalState(this).size; } @@ -5459,14 +5547,14 @@ var collectionStrong = { // `Map` constructor // https://tc39.github.io/ecma262/#sec-map-objects -var es_map = collection('Map', function (get) { - return function Map() { return get(this, arguments.length ? arguments[0] : undefined); }; -}, collectionStrong, true); +var es_map = collection('Map', function (init) { + return function Map() { return init(this, arguments.length ? arguments[0] : undefined); }; +}, collectionStrong); // `Set` constructor // https://tc39.github.io/ecma262/#sec-set-objects -var es_set = collection('Set', function (get) { - return function Set() { return get(this, arguments.length ? arguments[0] : undefined); }; +var es_set = collection('Set', function (init) { + return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); var getWeakData = internalMetadata.getWeakData; @@ -5603,15 +5691,15 @@ var IS_IE11 = !global_1.ActiveXObject && 'ActiveXObject' in global_1; var isExtensible = Object.isExtensible; var InternalWeakMap; -var wrapper = function (get) { +var wrapper = function (init) { return function WeakMap() { - return get(this, arguments.length ? arguments[0] : undefined); + return init(this, arguments.length ? arguments[0] : undefined); }; }; // `WeakMap` constructor // https://tc39.github.io/ecma262/#sec-weakmap-constructor -var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak, true, true); +var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak); // IE11 WeakMap frozen keys fix // We can't use feature detection because it crash some old IE builds @@ -5660,11 +5748,11 @@ if (nativeWeakMap && IS_IE11) { // `WeakSet` constructor // https://tc39.github.io/ecma262/#sec-weakset-constructor -collection('WeakSet', function (get) { - return function WeakSet() { return get(this, arguments.length ? arguments[0] : undefined); }; -}, collectionWeak, false, true); +collection('WeakSet', function (init) { + return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); }; +}, collectionWeak); -var defineProperty$7 = objectDefineProperty.f; +var defineProperty$8 = objectDefineProperty.f; @@ -5726,7 +5814,7 @@ var aTypedArrayConstructor = function (C) { } throw TypeError('Target is not a typed array constructor'); }; -var exportProto = function (KEY, property, forced) { +var exportTypedArrayMethod = function (KEY, property, forced) { if (!descriptors) return; if (forced) for (var ARRAY in TypedArrayConstructorsList) { var TypedArrayConstructor = global_1[ARRAY]; @@ -5740,7 +5828,7 @@ var exportProto = function (KEY, property, forced) { } }; -var exportStatic = function (KEY, property, forced) { +var exportTypedArrayStaticMethod = function (KEY, property, forced) { var ARRAY, TypedArrayConstructor; if (!descriptors) return; if (objectSetPrototypeOf) { @@ -5794,7 +5882,7 @@ if (NATIVE_ARRAY_BUFFER_VIEWS && objectGetPrototypeOf(Uint8ClampedArrayPrototype if (descriptors && !has(TypedArrayPrototype, TO_STRING_TAG$3)) { TYPED_ARRAY_TAG_REQIRED = true; - defineProperty$7(TypedArrayPrototype, TO_STRING_TAG$3, { get: function () { + defineProperty$8(TypedArrayPrototype, TO_STRING_TAG$3, { get: function () { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; } }); for (NAME$1 in TypedArrayConstructorsList) if (global_1[NAME$1]) { @@ -5813,8 +5901,8 @@ var arrayBufferViewCore = { TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, aTypedArray: aTypedArray, aTypedArrayConstructor: aTypedArrayConstructor, - exportProto: exportProto, - exportStatic: exportStatic, + exportTypedArrayMethod: exportTypedArrayMethod, + exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, isView: isView, isTypedArray: isTypedArray, TypedArray: TypedArray, @@ -5930,7 +6018,7 @@ var NATIVE_ARRAY_BUFFER$1 = arrayBufferViewCore.NATIVE_ARRAY_BUFFER; var getOwnPropertyNames$2 = objectGetOwnPropertyNames.f; -var defineProperty$8 = objectDefineProperty.f; +var defineProperty$9 = objectDefineProperty.f; @@ -5975,7 +6063,7 @@ var packFloat64 = function (number) { }; var addGetter = function (Constructor, key) { - defineProperty$8(Constructor[PROTOTYPE$2], key, { get: function () { return getInternalState$5(this)[key]; } }); + defineProperty$9(Constructor[PROTOTYPE$2], key, { get: function () { return getInternalState$5(this)[key]; } }); }; var get$1 = function (view, count, index, isLittleEndian) { @@ -6361,7 +6449,8 @@ if (descriptors) { defineProperty: wrappedDefineProperty }); - module.exports = function (TYPE, BYTES, wrapper, CLAMPED) { + module.exports = function (TYPE, wrapper, CLAMPED) { + var BYTES = TYPE.match(/\d+$/)[0] / 8; var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; var GETTER = 'get' + TYPE; var SETTER = 'set' + TYPE; @@ -6486,7 +6575,7 @@ if (descriptors) { // `Int8Array` constructor // https://tc39.github.io/ecma262/#sec-typedarray-objects -typedArrayConstructor('Int8', 1, function (init) { +typedArrayConstructor('Int8', function (init) { return function Int8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; @@ -6494,7 +6583,7 @@ typedArrayConstructor('Int8', 1, function (init) { // `Uint8Array` constructor // https://tc39.github.io/ecma262/#sec-typedarray-objects -typedArrayConstructor('Uint8', 1, function (init) { +typedArrayConstructor('Uint8', function (init) { return function Uint8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; @@ -6502,7 +6591,7 @@ typedArrayConstructor('Uint8', 1, function (init) { // `Uint8ClampedArray` constructor // https://tc39.github.io/ecma262/#sec-typedarray-objects -typedArrayConstructor('Uint8', 1, function (init) { +typedArrayConstructor('Uint8', function (init) { return function Uint8ClampedArray(data, byteOffset, length) { return init(this, data, byteOffset, length); }; @@ -6510,7 +6599,7 @@ typedArrayConstructor('Uint8', 1, function (init) { // `Int16Array` constructor // https://tc39.github.io/ecma262/#sec-typedarray-objects -typedArrayConstructor('Int16', 2, function (init) { +typedArrayConstructor('Int16', function (init) { return function Int16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; @@ -6518,7 +6607,7 @@ typedArrayConstructor('Int16', 2, function (init) { // `Uint16Array` constructor // https://tc39.github.io/ecma262/#sec-typedarray-objects -typedArrayConstructor('Uint16', 2, function (init) { +typedArrayConstructor('Uint16', function (init) { return function Uint16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; @@ -6526,7 +6615,7 @@ typedArrayConstructor('Uint16', 2, function (init) { // `Int32Array` constructor // https://tc39.github.io/ecma262/#sec-typedarray-objects -typedArrayConstructor('Int32', 4, function (init) { +typedArrayConstructor('Int32', function (init) { return function Int32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; @@ -6534,7 +6623,7 @@ typedArrayConstructor('Int32', 4, function (init) { // `Uint32Array` constructor // https://tc39.github.io/ecma262/#sec-typedarray-objects -typedArrayConstructor('Uint32', 4, function (init) { +typedArrayConstructor('Uint32', function (init) { return function Uint32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; @@ -6542,7 +6631,7 @@ typedArrayConstructor('Uint32', 4, function (init) { // `Float32Array` constructor // https://tc39.github.io/ecma262/#sec-typedarray-objects -typedArrayConstructor('Float32', 4, function (init) { +typedArrayConstructor('Float32', function (init) { return function Float32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; @@ -6550,21 +6639,25 @@ typedArrayConstructor('Float32', 4, function (init) { // `Float64Array` constructor // https://tc39.github.io/ecma262/#sec-typedarray-objects -typedArrayConstructor('Float64', 8, function (init) { +typedArrayConstructor('Float64', function (init) { return function Float64Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); +var exportTypedArrayStaticMethod$1 = arrayBufferViewCore.exportTypedArrayStaticMethod; + + // `%TypedArray%.from` method // https://tc39.github.io/ecma262/#sec-%typedarray%.from -arrayBufferViewCore.exportStatic('from', typedArrayFrom, typedArraysConstructorsRequiresWrappers); +exportTypedArrayStaticMethod$1('from', typedArrayFrom, typedArraysConstructorsRequiresWrappers); var aTypedArrayConstructor$2 = arrayBufferViewCore.aTypedArrayConstructor; +var exportTypedArrayStaticMethod$2 = arrayBufferViewCore.exportTypedArrayStaticMethod; // `%TypedArray%.of` method // https://tc39.github.io/ecma262/#sec-%typedarray%.of -arrayBufferViewCore.exportStatic('of', function of(/* ...items */) { +exportTypedArrayStaticMethod$2('of', function of(/* ...items */) { var index = 0; var length = arguments.length; var result = new (aTypedArrayConstructor$2(this))(length); @@ -6573,29 +6666,32 @@ arrayBufferViewCore.exportStatic('of', function of(/* ...items */) { }, typedArraysConstructorsRequiresWrappers); var aTypedArray$1 = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$1 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.copyWithin` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin -arrayBufferViewCore.exportProto('copyWithin', function copyWithin(target, start /* , end */) { +exportTypedArrayMethod$1('copyWithin', function copyWithin(target, start /* , end */) { return arrayCopyWithin.call(aTypedArray$1(this), target, start, arguments.length > 2 ? arguments[2] : undefined); }); var $every$1 = arrayIteration.every; var aTypedArray$2 = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$2 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.every` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every -arrayBufferViewCore.exportProto('every', function every(callbackfn /* , thisArg */) { +exportTypedArrayMethod$2('every', function every(callbackfn /* , thisArg */) { return $every$1(aTypedArray$2(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); var aTypedArray$3 = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$3 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.fill` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill // eslint-disable-next-line no-unused-vars -arrayBufferViewCore.exportProto('fill', function fill(value /* , start, end */) { +exportTypedArrayMethod$3('fill', function fill(value /* , start, end */) { return arrayFill.apply(aTypedArray$3(this), arguments); }); @@ -6604,10 +6700,11 @@ var $filter$1 = arrayIteration.filter; var aTypedArray$4 = arrayBufferViewCore.aTypedArray; var aTypedArrayConstructor$3 = arrayBufferViewCore.aTypedArrayConstructor; +var exportTypedArrayMethod$4 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.filter` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter -arrayBufferViewCore.exportProto('filter', function filter(callbackfn /* , thisArg */) { +exportTypedArrayMethod$4('filter', function filter(callbackfn /* , thisArg */) { var list = $filter$1(aTypedArray$4(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); var C = speciesConstructor(this, this.constructor); var index = 0; @@ -6620,50 +6717,55 @@ arrayBufferViewCore.exportProto('filter', function filter(callbackfn /* , thisAr var $find$1 = arrayIteration.find; var aTypedArray$5 = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$5 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.find` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find -arrayBufferViewCore.exportProto('find', function find(predicate /* , thisArg */) { +exportTypedArrayMethod$5('find', function find(predicate /* , thisArg */) { return $find$1(aTypedArray$5(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var $findIndex$1 = arrayIteration.findIndex; var aTypedArray$6 = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$6 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.findIndex` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex -arrayBufferViewCore.exportProto('findIndex', function findIndex(predicate /* , thisArg */) { +exportTypedArrayMethod$6('findIndex', function findIndex(predicate /* , thisArg */) { return $findIndex$1(aTypedArray$6(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var $forEach$2 = arrayIteration.forEach; var aTypedArray$7 = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$7 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.forEach` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach -arrayBufferViewCore.exportProto('forEach', function forEach(callbackfn /* , thisArg */) { +exportTypedArrayMethod$7('forEach', function forEach(callbackfn /* , thisArg */) { $forEach$2(aTypedArray$7(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); var $includes$1 = arrayIncludes.includes; var aTypedArray$8 = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$8 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.includes` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes -arrayBufferViewCore.exportProto('includes', function includes(searchElement /* , fromIndex */) { +exportTypedArrayMethod$8('includes', function includes(searchElement /* , fromIndex */) { return $includes$1(aTypedArray$8(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); var $indexOf$1 = arrayIncludes.indexOf; var aTypedArray$9 = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$9 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof -arrayBufferViewCore.exportProto('indexOf', function indexOf(searchElement /* , fromIndex */) { +exportTypedArrayMethod$9('indexOf', function indexOf(searchElement /* , fromIndex */) { return $indexOf$1(aTypedArray$9(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); @@ -6673,7 +6775,7 @@ var arrayValues = es_array_iterator.values; var arrayKeys = es_array_iterator.keys; var arrayEntries = es_array_iterator.entries; var aTypedArray$a = arrayBufferViewCore.aTypedArray; -var exportProto$1 = arrayBufferViewCore.exportProto; +var exportTypedArrayMethod$a = arrayBufferViewCore.exportTypedArrayMethod; var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR$5]; var CORRECT_ITER_NAME = !!nativeTypedArrayIterator @@ -6685,37 +6787,39 @@ var typedArrayValues = function values() { // `%TypedArray%.prototype.entries` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries -exportProto$1('entries', function entries() { +exportTypedArrayMethod$a('entries', function entries() { return arrayEntries.call(aTypedArray$a(this)); }); // `%TypedArray%.prototype.keys` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys -exportProto$1('keys', function keys() { +exportTypedArrayMethod$a('keys', function keys() { return arrayKeys.call(aTypedArray$a(this)); }); // `%TypedArray%.prototype.values` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values -exportProto$1('values', typedArrayValues, !CORRECT_ITER_NAME); +exportTypedArrayMethod$a('values', typedArrayValues, !CORRECT_ITER_NAME); // `%TypedArray%.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator -exportProto$1(ITERATOR$5, typedArrayValues, !CORRECT_ITER_NAME); +exportTypedArrayMethod$a(ITERATOR$5, typedArrayValues, !CORRECT_ITER_NAME); var aTypedArray$b = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$b = arrayBufferViewCore.exportTypedArrayMethod; var $join = [].join; // `%TypedArray%.prototype.join` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join // eslint-disable-next-line no-unused-vars -arrayBufferViewCore.exportProto('join', function join(separator) { +exportTypedArrayMethod$b('join', function join(separator) { return $join.apply(aTypedArray$b(this), arguments); }); var aTypedArray$c = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$c = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.lastIndexOf` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof // eslint-disable-next-line no-unused-vars -arrayBufferViewCore.exportProto('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { +exportTypedArrayMethod$c('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { return arrayLastIndexOf.apply(aTypedArray$c(this), arguments); }); @@ -6724,10 +6828,11 @@ var $map$1 = arrayIteration.map; var aTypedArray$d = arrayBufferViewCore.aTypedArray; var aTypedArrayConstructor$4 = arrayBufferViewCore.aTypedArrayConstructor; +var exportTypedArrayMethod$d = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.map` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map -arrayBufferViewCore.exportProto('map', function map(mapfn /* , thisArg */) { +exportTypedArrayMethod$d('map', function map(mapfn /* , thisArg */) { return $map$1(aTypedArray$d(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { return new (aTypedArrayConstructor$4(speciesConstructor(O, O.constructor)))(length); }); @@ -6736,29 +6841,32 @@ arrayBufferViewCore.exportProto('map', function map(mapfn /* , thisArg */) { var $reduce$1 = arrayReduce.left; var aTypedArray$e = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$e = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.reduce` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce -arrayBufferViewCore.exportProto('reduce', function reduce(callbackfn /* , initialValue */) { +exportTypedArrayMethod$e('reduce', function reduce(callbackfn /* , initialValue */) { return $reduce$1(aTypedArray$e(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); }); var $reduceRight$1 = arrayReduce.right; var aTypedArray$f = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$f = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.reduceRicht` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright -arrayBufferViewCore.exportProto('reduceRight', function reduceRight(callbackfn /* , initialValue */) { +exportTypedArrayMethod$f('reduceRight', function reduceRight(callbackfn /* , initialValue */) { return $reduceRight$1(aTypedArray$f(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); }); var aTypedArray$g = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$g = arrayBufferViewCore.exportTypedArrayMethod; var floor$7 = Math.floor; // `%TypedArray%.prototype.reverse` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse -arrayBufferViewCore.exportProto('reverse', function reverse() { +exportTypedArrayMethod$g('reverse', function reverse() { var that = this; var length = aTypedArray$g(that).length; var middle = floor$7(length / 2); @@ -6772,15 +6880,16 @@ arrayBufferViewCore.exportProto('reverse', function reverse() { }); var aTypedArray$h = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$h = arrayBufferViewCore.exportTypedArrayMethod; -var FORCED$f = fails(function () { +var FORCED$g = fails(function () { // eslint-disable-next-line no-undef new Int8Array(1).set({}); }); // `%TypedArray%.prototype.set` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set -arrayBufferViewCore.exportProto('set', function set(arrayLike /* , offset */) { +exportTypedArrayMethod$h('set', function set(arrayLike /* , offset */) { aTypedArray$h(this); var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); var length = this.length; @@ -6789,20 +6898,21 @@ arrayBufferViewCore.exportProto('set', function set(arrayLike /* , offset */) { var index = 0; if (len + offset > length) throw RangeError('Wrong length'); while (index < len) this[offset + index] = src[index++]; -}, FORCED$f); +}, FORCED$g); var aTypedArray$i = arrayBufferViewCore.aTypedArray; var aTypedArrayConstructor$5 = arrayBufferViewCore.aTypedArrayConstructor; +var exportTypedArrayMethod$i = arrayBufferViewCore.exportTypedArrayMethod; var $slice = [].slice; -var FORCED$g = fails(function () { +var FORCED$h = fails(function () { // eslint-disable-next-line no-undef new Int8Array(1).slice(); }); // `%TypedArray%.prototype.slice` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice -arrayBufferViewCore.exportProto('slice', function slice(start, end) { +exportTypedArrayMethod$i('slice', function slice(start, end) { var list = $slice.call(aTypedArray$i(this), start, end); var C = speciesConstructor(this, this.constructor); var index = 0; @@ -6810,32 +6920,35 @@ arrayBufferViewCore.exportProto('slice', function slice(start, end) { var result = new (aTypedArrayConstructor$5(C))(length); while (length > index) result[index] = list[index++]; return result; -}, FORCED$g); +}, FORCED$h); var $some$1 = arrayIteration.some; var aTypedArray$j = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$j = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.some` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some -arrayBufferViewCore.exportProto('some', function some(callbackfn /* , thisArg */) { +exportTypedArrayMethod$j('some', function some(callbackfn /* , thisArg */) { return $some$1(aTypedArray$j(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); var aTypedArray$k = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$k = arrayBufferViewCore.exportTypedArrayMethod; var $sort = [].sort; // `%TypedArray%.prototype.sort` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort -arrayBufferViewCore.exportProto('sort', function sort(comparefn) { +exportTypedArrayMethod$k('sort', function sort(comparefn) { return $sort.call(aTypedArray$k(this), comparefn); }); var aTypedArray$l = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$l = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.subarray` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray -arrayBufferViewCore.exportProto('subarray', function subarray(begin, end) { +exportTypedArrayMethod$l('subarray', function subarray(begin, end) { var O = aTypedArray$l(this); var length = O.length; var beginIndex = toAbsoluteIndex(begin, length); @@ -6848,6 +6961,7 @@ arrayBufferViewCore.exportProto('subarray', function subarray(begin, end) { var Int8Array$3 = global_1.Int8Array; var aTypedArray$m = arrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod$m = arrayBufferViewCore.exportTypedArrayMethod; var $toLocaleString = [].toLocaleString; var $slice$1 = [].slice; @@ -6856,7 +6970,7 @@ var TO_LOCALE_STRING_BUG = !!Int8Array$3 && fails(function () { $toLocaleString.call(new Int8Array$3(1)); }); -var FORCED$h = fails(function () { +var FORCED$i = fails(function () { return [1, 2].toLocaleString() != new Int8Array$3([1, 2]).toLocaleString(); }) || !fails(function () { Int8Array$3.prototype.toLocaleString.call([1, 2]); @@ -6864,12 +6978,16 @@ var FORCED$h = fails(function () { // `%TypedArray%.prototype.toLocaleString` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring -arrayBufferViewCore.exportProto('toLocaleString', function toLocaleString() { +exportTypedArrayMethod$m('toLocaleString', function toLocaleString() { return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice$1.call(aTypedArray$m(this)) : aTypedArray$m(this), arguments); -}, FORCED$h); +}, FORCED$i); + +var exportTypedArrayMethod$n = arrayBufferViewCore.exportTypedArrayMethod; + + var Uint8Array$1 = global_1.Uint8Array; -var Uint8ArrayPrototype = Uint8Array$1 && Uint8Array$1.prototype; +var Uint8ArrayPrototype = Uint8Array$1 && Uint8Array$1.prototype || {}; var arrayToString = [].toString; var arrayJoin = [].join; @@ -6879,9 +6997,11 @@ if (fails(function () { arrayToString.call({}); })) { }; } +var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; + // `%TypedArray%.prototype.toString` method // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring -arrayBufferViewCore.exportProto('toString', arrayToString, (Uint8ArrayPrototype || {}).toString != arrayToString); +exportTypedArrayMethod$n('toString', arrayToString, IS_NOT_ARRAY_METHOD); var nativeApply = getBuiltIn('Reflect', 'apply'); var functionApply = Function.apply; @@ -6916,9 +7036,9 @@ var NEW_TARGET_BUG = fails(function () { var ARGS_BUG = !fails(function () { nativeConstruct(function () { /* empty */ }); }); -var FORCED$i = NEW_TARGET_BUG || ARGS_BUG; +var FORCED$j = NEW_TARGET_BUG || ARGS_BUG; -_export({ target: 'Reflect', stat: true, forced: FORCED$i, sham: FORCED$i }, { +_export({ target: 'Reflect', stat: true, forced: FORCED$j, sham: FORCED$j }, { construct: function construct(Target, args /* , newTarget */) { aFunction$1(Target); anObject(args); @@ -6968,13 +7088,13 @@ _export({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: ! } }); -var getOwnPropertyDescriptor$6 = objectGetOwnPropertyDescriptor.f; +var getOwnPropertyDescriptor$8 = objectGetOwnPropertyDescriptor.f; // `Reflect.deleteProperty` method // https://tc39.github.io/ecma262/#sec-reflect.deleteproperty _export({ target: 'Reflect', stat: true }, { deleteProperty: function deleteProperty(target, propertyKey) { - var descriptor = getOwnPropertyDescriptor$6(anObject(target), propertyKey); + var descriptor = getOwnPropertyDescriptor$8(anObject(target), propertyKey); return descriptor && !descriptor.configurable ? false : delete target[propertyKey]; } }); @@ -7077,7 +7197,15 @@ function set$3(target, propertyKey, V /* , receiver */) { return ownDescriptor.set === undefined ? false : (ownDescriptor.set.call(receiver, V), true); } -_export({ target: 'Reflect', stat: true }, { +// MS Edge 17-18 Reflect.set allows setting the property to object +// with non-writable property on the prototype +var MS_EDGE_BUG = fails(function () { + var object = objectDefineProperty.f({}, 'a', { configurable: true }); + // eslint-disable-next-line no-undef + return Reflect.set(objectGetPrototypeOf(object), 'a', 1, object) !== false; +}); + +_export({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, { set: set$3 }); @@ -8938,12 +9066,12 @@ _export({ target: 'URL', proto: true, enumerable: true }, { } }); -var defineProperty$9 = objectDefineProperty.f; +var defineProperty$a = objectDefineProperty.f; // `Array.prototype.lastIndex` getter // https://github.com/keithamus/proposal-array-last if (descriptors && !('lastIndex' in [])) { - defineProperty$9(Array.prototype, 'lastIndex', { + defineProperty$a(Array.prototype, 'lastIndex', { configurable: true, get: function lastIndex() { var O = toObject(this); @@ -8955,12 +9083,12 @@ if (descriptors && !('lastIndex' in [])) { addToUnscopables('lastIndex'); } -var defineProperty$a = objectDefineProperty.f; +var defineProperty$b = objectDefineProperty.f; // `Array.prototype.lastIndex` accessor // https://github.com/keithamus/proposal-array-last if (descriptors && !('lastItem' in [])) { - defineProperty$a(Array.prototype, 'lastItem', { + defineProperty$b(Array.prototype, 'lastItem', { configurable: true, get: function lastItem() { var O = toObject(this); @@ -9639,7 +9767,7 @@ _export({ target: 'Number', stat: true }, { -var defineProperty$b = objectDefineProperty.f; +var defineProperty$c = objectDefineProperty.f; @@ -9717,7 +9845,7 @@ Subscription.prototype = redefineAll({}, { } }); -if (descriptors) defineProperty$b(Subscription.prototype, 'closed', { +if (descriptors) defineProperty$c(Subscription.prototype, 'closed', { configurable: true, get: function () { return subscriptionClosed(getInternalState$6(this)); @@ -9773,7 +9901,7 @@ SubscriptionObserver.prototype = redefineAll({}, { } }); -if (descriptors) defineProperty$b(SubscriptionObserver.prototype, 'closed', { +if (descriptors) defineProperty$c(SubscriptionObserver.prototype, 'closed', { configurable: true, get: function () { return subscriptionClosed(getInternalState$6(getInternalState$6(this).subscription)); @@ -10058,9 +10186,36 @@ var createAsyncIteratorProxy = function (nextHandler, IS_ITERATOR) { - var AsyncIteratorProxy = createAsyncIteratorProxy(function (arg, Promise) { var state = this; + var iterator = state.iterator; + + return Promise.resolve(anObject(state.next.call(iterator, arg))).then(function (step) { + if (anObject(step).done) { + state.done = true; + return { done: true, value: undefined }; + } + return { done: false, value: [state.index++, step.value] }; + }); +}); + +_export({ target: 'AsyncIterator', proto: true, real: true }, { + asIndexedPairs: function asIndexedPairs() { + return new AsyncIteratorProxy({ + iterator: anObject(this), + index: 0 + }); + } +}); + +// https://github.com/tc39/proposal-iterator-helpers + + + + + +var AsyncIteratorProxy$1 = createAsyncIteratorProxy(function (arg, Promise) { + var state = this; return new Promise(function (resolve, reject) { var loop = function () { @@ -10087,7 +10242,7 @@ var AsyncIteratorProxy = createAsyncIteratorProxy(function (arg, Promise) { _export({ target: 'AsyncIterator', proto: true, real: true }, { drop: function drop(limit) { - return new AsyncIteratorProxy({ + return new AsyncIteratorProxy$1({ iterator: anObject(this), remaining: toPositiveInteger(limit) }); @@ -10099,8 +10254,79 @@ _export({ target: 'AsyncIterator', proto: true, real: true }, { +var Promise$2 = getBuiltIn('Promise'); +var push$1 = [].push; -var AsyncIteratorProxy$1 = createAsyncIteratorProxy(function (arg, Promise) { +var createMethod$7 = function (TYPE) { + var IS_TO_ARRAY = TYPE == 0; + var IS_FOR_EACH = TYPE == 1; + var IS_EVERY = TYPE == 2; + var IS_SOME = TYPE == 3; + return function (iterator, fn) { + anObject(iterator); + var next = aFunction$1(iterator.next); + var array = IS_TO_ARRAY ? [] : undefined; + if (!IS_TO_ARRAY) aFunction$1(fn); + + return new Promise$2(function (resolve, reject) { + var loop = function () { + try { + Promise$2.resolve(anObject(next.call(iterator))).then(function (step) { + try { + if (anObject(step).done) { + resolve(IS_TO_ARRAY ? array : IS_SOME ? false : IS_EVERY || undefined); + } else { + var value = step.value; + if (IS_TO_ARRAY) { + push$1.call(array, value); + loop(); + } else { + Promise$2.resolve(fn(value)).then(function (result) { + if (IS_FOR_EACH) { + loop(); + } else if (IS_EVERY) { + result ? loop() : resolve(false); + } else { + result ? resolve(IS_SOME || value) : loop(); + } + }, reject); + } + } + } catch (err) { reject(err); } + }, reject); + } catch (error) { reject(error); } + }; + + loop(); + }); + }; +}; + +var asyncIteratorIteration = { + toArray: createMethod$7(0), + forEach: createMethod$7(1), + every: createMethod$7(2), + some: createMethod$7(3), + find: createMethod$7(4) +}; + +// https://github.com/tc39/proposal-iterator-helpers + +var $every$2 = asyncIteratorIteration.every; + +_export({ target: 'AsyncIterator', proto: true, real: true }, { + every: function every(fn) { + return $every$2(this, fn); + } +}); + +// https://github.com/tc39/proposal-iterator-helpers + + + + + +var AsyncIteratorProxy$2 = createAsyncIteratorProxy(function (arg, Promise) { var state = this; var filterer = state.filterer; @@ -10129,13 +10355,23 @@ var AsyncIteratorProxy$1 = createAsyncIteratorProxy(function (arg, Promise) { _export({ target: 'AsyncIterator', proto: true, real: true }, { filter: function filter(filterer) { - return new AsyncIteratorProxy$1({ + return new AsyncIteratorProxy$2({ iterator: anObject(this), filterer: aFunction$1(filterer) }); } }); +// https://github.com/tc39/proposal-iterator-helpers + +var $find$2 = asyncIteratorIteration.find; + +_export({ target: 'AsyncIterator', proto: true, real: true }, { + find: function find(fn) { + return $find$2(this, fn); + } +}); + var ASYNC_ITERATOR$1 = wellKnownSymbol('asyncIterator'); var getAsyncIteratorMethod = function (it) { @@ -10150,11 +10386,88 @@ var getAsyncIteratorMethod = function (it) { +var AsyncIteratorProxy$3 = createAsyncIteratorProxy(function (arg, Promise) { + var state = this; + var mapper = state.mapper; + var innerIterator, iteratorMethod; + + return new Promise(function (resolve, reject) { + var outerLoop = function () { + try { + Promise.resolve(anObject(state.next.call(state.iterator, arg))).then(function (step) { + try { + if (anObject(step).done) { + state.done = true; + resolve({ done: true, value: undefined }); + } else { + Promise.resolve(mapper(step.value)).then(function (mapped) { + try { + iteratorMethod = getAsyncIteratorMethod(mapped); + if (iteratorMethod !== undefined) { + state.innerIterator = innerIterator = anObject(iteratorMethod.call(mapped)); + state.innerNext = aFunction$1(innerIterator.next); + return innerLoop(); + } reject(TypeError('.flatMap callback should return an iterable object')); + } catch (error2) { reject(error2); } + }, reject); + } + } catch (error1) { reject(error1); } + }, reject); + } catch (error) { reject(error); } + }; + + var innerLoop = function () { + if (innerIterator = state.innerIterator) { + try { + Promise.resolve(anObject(state.innerNext.call(innerIterator))).then(function (result) { + try { + if (anObject(result).done) { + state.innerIterator = state.innerNext = null; + outerLoop(); + } else resolve({ done: false, value: result.value }); + } catch (error1) { reject(error1); } + }, reject); + } catch (error) { reject(error); } + } else outerLoop(); + }; + + innerLoop(); + }); +}); + +_export({ target: 'AsyncIterator', proto: true, real: true }, { + flatMap: function flatMap(mapper) { + return new AsyncIteratorProxy$3({ + iterator: anObject(this), + mapper: aFunction$1(mapper), + innerIterator: null, + innerNext: null + }); + } +}); + +// https://github.com/tc39/proposal-iterator-helpers + +var $forEach$3 = asyncIteratorIteration.forEach; + +_export({ target: 'AsyncIterator', proto: true, real: true }, { + forEach: function forEach(fn) { + return $forEach$3(this, fn); + } +}); + +// https://github.com/tc39/proposal-iterator-helpers + + + + + + var AsyncIterator$1 = path.AsyncIterator; -var AsyncIteratorProxy$2 = createAsyncIteratorProxy(function (arg) { +var AsyncIteratorProxy$4 = createAsyncIteratorProxy(function (arg) { return anObject(this.next.call(this.iterator, arg)); }, true); @@ -10168,7 +10481,7 @@ _export({ target: 'AsyncIterator', stat: true }, { if (iterator instanceof AsyncIterator$1) return iterator; } else { iterator = object; - } return new AsyncIteratorProxy$2({ + } return new AsyncIteratorProxy$4({ iterator: iterator }); } @@ -10180,7 +10493,7 @@ _export({ target: 'AsyncIterator', stat: true }, { -var AsyncIteratorProxy$3 = createAsyncIteratorProxy(function (arg, Promise) { +var AsyncIteratorProxy$5 = createAsyncIteratorProxy(function (arg, Promise) { var state = this; var mapper = state.mapper; @@ -10197,7 +10510,7 @@ var AsyncIteratorProxy$3 = createAsyncIteratorProxy(function (arg, Promise) { _export({ target: 'AsyncIterator', proto: true, real: true }, { map: function map(mapper) { - return new AsyncIteratorProxy$3({ + return new AsyncIteratorProxy$5({ iterator: anObject(this), mapper: aFunction$1(mapper) }); @@ -10210,62 +10523,33 @@ _export({ target: 'AsyncIterator', proto: true, real: true }, { -var AsyncIteratorProxy$4 = createAsyncIteratorProxy(function (arg) { - if (!this.remaining--) { - this.done = true; - return { done: true, value: undefined }; - } return this.next.call(this.iterator, arg); -}); +var Promise$3 = getBuiltIn('Promise'); _export({ target: 'AsyncIterator', proto: true, real: true }, { - take: function take(limit) { - return new AsyncIteratorProxy$4({ - iterator: anObject(this), - remaining: toPositiveInteger(limit) - }); - } -}); - -// https://github.com/tc39/proposal-iterator-helpers - - - - -var Promise$2 = getBuiltIn('Promise'); -var push$1 = [].push; - -var createMethod$7 = function (TYPE) { - var IS_TO_ARRAY = TYPE == 0; - var IS_FOR_EACH = TYPE == 1; - var IS_EVERY = TYPE == 2; - var IS_SOME = TYPE == 3; - return function (iterator, fn) { - anObject(iterator); + reduce: function reduce(reducer /* , initialValue */) { + var iterator = anObject(this); var next = aFunction$1(iterator.next); - var array = IS_TO_ARRAY ? [] : undefined; - if (!IS_TO_ARRAY) aFunction$1(fn); + var noInitial = arguments.length < 2; + var accumulator = noInitial ? undefined : arguments[1]; + aFunction$1(reducer); - return new Promise$2(function (resolve, reject) { + return new Promise$3(function (resolve, reject) { var loop = function () { try { - Promise$2.resolve(anObject(next.call(iterator))).then(function (step) { + Promise$3.resolve(anObject(next.call(iterator))).then(function (step) { try { if (anObject(step).done) { - resolve(IS_TO_ARRAY ? array : IS_SOME ? false : IS_EVERY || undefined); + noInitial ? reject(TypeError('Reduce of empty iterator with no initial value')) : resolve(accumulator); } else { var value = step.value; - if (IS_TO_ARRAY) { - push$1.call(array, value); + if (noInitial) { + noInitial = false; + accumulator = value; loop(); } else { - Promise$2.resolve(fn(value)).then(function (result) { - if (IS_FOR_EACH) { - loop(); - } else if (IS_EVERY) { - result ? loop() : resolve(false); - } else { - result ? resolve(IS_SOME || value) : loop(); - } + Promise$3.resolve(reducer(accumulator, value)).then(function (result) { + accumulator = result; + loop(); }, reject); } } @@ -10276,16 +10560,40 @@ var createMethod$7 = function (TYPE) { loop(); }); - }; -}; + } +}); -var asyncIteratorIteration = { - toArray: createMethod$7(0), - forEach: createMethod$7(1), - every: createMethod$7(2), - some: createMethod$7(3), - find: createMethod$7(4) -}; +// https://github.com/tc39/proposal-iterator-helpers + +var $some$2 = asyncIteratorIteration.some; + +_export({ target: 'AsyncIterator', proto: true, real: true }, { + some: function some(fn) { + return $some$2(this, fn); + } +}); + +// https://github.com/tc39/proposal-iterator-helpers + + + + + +var AsyncIteratorProxy$6 = createAsyncIteratorProxy(function (arg) { + if (!this.remaining--) { + this.done = true; + return { done: true, value: undefined }; + } return this.next.call(this.iterator, arg); +}); + +_export({ target: 'AsyncIterator', proto: true, real: true }, { + take: function take(limit) { + return new AsyncIteratorProxy$6({ + iterator: anObject(this), + remaining: toPositiveInteger(limit) + }); + } +}); // https://github.com/tc39/proposal-iterator-helpers @@ -10304,6 +10612,7 @@ _export({ target: 'AsyncIterator', proto: true, real: true }, { + var IteratorPrototype$3 = iteratorsCore.IteratorPrototype; @@ -10313,7 +10622,10 @@ var TO_STRING_TAG$6 = wellKnownSymbol('toStringTag'); var NativeIterator = global_1.Iterator; // FF56- have non-standard global helper `Iterator` -var FORCED$j = typeof NativeIterator != 'function' || NativeIterator.prototype !== IteratorPrototype$3; +var FORCED$k = typeof NativeIterator != 'function' + || NativeIterator.prototype !== IteratorPrototype$3 + // FF44- non-standard `Iterator` passes previous tests + || !fails(function () { NativeIterator({}); }); var IteratorConstructor = function Iterator() { anInstance(this, IteratorConstructor); @@ -10323,13 +10635,13 @@ if (!has(IteratorPrototype$3, TO_STRING_TAG$6)) { createNonEnumerableProperty(IteratorPrototype$3, TO_STRING_TAG$6, 'Iterator'); } -if (!has(IteratorPrototype$3, 'constructor') || IteratorPrototype$3.constructor === Object) { +if (FORCED$k || !has(IteratorPrototype$3, 'constructor') || IteratorPrototype$3.constructor === Object) { createNonEnumerableProperty(IteratorPrototype$3, 'constructor', IteratorConstructor); } IteratorConstructor.prototype = IteratorPrototype$3; -_export({ global: true, forced: FORCED$j }, { +_export({ global: true, forced: FORCED$k }, { Iterator: IteratorConstructor }); @@ -10492,6 +10804,52 @@ _export({ target: 'Iterator', proto: true, real: true }, { + + + +var IteratorProxy$3 = createIteratorProxy(function (arg) { + var iterator = this.iterator; + var result, mapped, iteratorMethod, innerIterator; + + while (true) { + if (innerIterator = this.innerIterator) { + result = anObject(this.innerNext.call(innerIterator)); + if (!result.done) return result.value; + this.innerIterator = this.innerNext = null; + } + + result = anObject(this.next.call(iterator, arg)); + + if (this.done = !!result.done) return; + + mapped = callWithSafeIterationClosing(iterator, this.mapper, result.value); + iteratorMethod = getIteratorMethod(mapped); + + if (iteratorMethod === undefined) { + throw TypeError('.flatMap callback should return an iterable object'); + } + + this.innerIterator = innerIterator = anObject(iteratorMethod.call(mapped)); + this.innerNext = aFunction$1(innerIterator.next); + } +}); + +_export({ target: 'Iterator', proto: true, real: true }, { + flatMap: function flatMap(mapper) { + return new IteratorProxy$3({ + iterator: anObject(this), + mapper: aFunction$1(mapper), + innerIterator: null, + innerNext: null + }); + } +}); + +// https://github.com/tc39/proposal-iterator-helpers + + + + _export({ target: 'Iterator', proto: true, real: true }, { forEach: function forEach(fn) { iterate_1(anObject(this), fn, undefined, false, true); @@ -10509,7 +10867,7 @@ _export({ target: 'Iterator', proto: true, real: true }, { var Iterator = path.Iterator; -var IteratorProxy$3 = createIteratorProxy(function (arg) { +var IteratorProxy$4 = createIteratorProxy(function (arg) { var result = anObject(this.next.call(this.iterator, arg)); var done = this.done = !!result.done; if (!done) return result.value; @@ -10525,7 +10883,7 @@ _export({ target: 'Iterator', stat: true }, { if (iterator instanceof Iterator) return iterator; } else { iterator = object; - } return new IteratorProxy$3({ + } return new IteratorProxy$4({ iterator: iterator }); } @@ -10538,7 +10896,7 @@ _export({ target: 'Iterator', stat: true }, { -var IteratorProxy$4 = createIteratorProxy(function (arg) { +var IteratorProxy$5 = createIteratorProxy(function (arg) { var iterator = this.iterator; var result = anObject(this.next.call(iterator, arg)); var done = this.done = !!result.done; @@ -10547,7 +10905,7 @@ var IteratorProxy$4 = createIteratorProxy(function (arg) { _export({ target: 'Iterator', proto: true, real: true }, { map: function map(mapper) { - return new IteratorProxy$4({ + return new IteratorProxy$5({ iterator: anObject(this), mapper: aFunction$1(mapper) }); @@ -10601,7 +10959,7 @@ _export({ target: 'Iterator', proto: true, real: true }, { -var IteratorProxy$5 = createIteratorProxy(function (arg) { +var IteratorProxy$6 = createIteratorProxy(function (arg) { if (!this.remaining--) { this.done = true; return; @@ -10613,7 +10971,7 @@ var IteratorProxy$5 = createIteratorProxy(function (arg) { _export({ target: 'Iterator', proto: true, real: true }, { take: function take(limit) { - return new IteratorProxy$5({ + return new IteratorProxy$6({ iterator: anObject(this), remaining: toPositiveInteger(limit) }); @@ -10977,10 +11335,10 @@ for (var COLLECTION_NAME$1 in domIterables) { } } -var FORCED$k = !global_1.setImmediate || !global_1.clearImmediate; +var FORCED$l = !global_1.setImmediate || !global_1.clearImmediate; // http://w3c.github.io/setImmediate/ -_export({ global: true, bind: true, enumerable: true, forced: FORCED$k }, { +_export({ global: true, bind: true, enumerable: true, forced: FORCED$l }, { // `setImmediate` method // http://w3c.github.io/setImmediate/#si-setImmediate setImmediate: task.set, diff --git a/test/utils.js b/test/utils.js index 57791247fdb..9c0458d290f 100644 --- a/test/utils.js +++ b/test/utils.js @@ -227,10 +227,14 @@ function assertFilesAreEqual(actualFiles, expectedFiles, dirs = []) { } function assertStderrIncludes(stderr, expected) { - // eslint-disable-next-line no-control-regex - const output = stderr.replace(/\x1b\[[^m]*m/g, ''); - assert.ok( - output.includes(expected), - `Could not find ${JSON.stringify(expected)} in ${JSON.stringify(output)}` - ); + try { + assert.ok( + stderr.includes(expected), + `Could not find ${JSON.stringify(expected)} in ${JSON.stringify(stderr)}` + ); + } catch (err) { + err.actual = stderr; + err.expected = expected; + throw err; + } }