diff --git a/LICENSE.md b/LICENSE.md
index e653e14c7..04dbb3588 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -84,33 +84,6 @@ Repository: https://github.com/acornjs/acorn-class-fields
---------------------------------------
-## acorn-numeric-separator
-License: MIT
-By: Adrian Heine
-Repository: https://github.com/acornjs/acorn-numeric-separator
-
-> Copyright (C) 2017-2018 by Adrian Heine
->
-> Permission is hereby granted, free of charge, to any person obtaining a copy
-> of this software and associated documentation files (the "Software"), to deal
-> in the Software without restriction, including without limitation the rights
-> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-> copies of the Software, and to permit persons to whom the Software is
-> furnished to do so, subject to the following conditions:
->
-> The above copyright notice and this permission notice shall be included in
-> all copies or substantial portions of the Software.
->
-> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-> THE SOFTWARE.
-
----------------------------------------
-
## acorn-private-class-elements
License: MIT
By: Adrian Heine
@@ -172,7 +145,7 @@ Repository: https://github.com/acornjs/acorn.git
> MIT License
>
-> Copyright (C) 2012-2018 by various contributors (see AUTHORS)
+> Copyright (C) 2012-2020 by various contributors (see AUTHORS)
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
diff --git a/docs/999-big-list-of-options.md b/docs/999-big-list-of-options.md
index c91fe4758..c8edd7274 100755
--- a/docs/999-big-list-of-options.md
+++ b/docs/999-big-list-of-options.md
@@ -402,7 +402,7 @@ Default: `"[name]-[hash].js"`
The pattern to use for naming shared chunks created when code-splitting, or a function that is called per chunk to return such a pattern. Patterns support the following placeholders:
* `[format]`: The rendering format defined in the output options, e.g. `es` or `cjs`.
* `[hash]`: A hash based on the content of the chunk and the content of all its dependencies.
- * `[name]`: The name of the chunk. This can be explicitly set via the [`output.manualChunks`](guide/en/#outputmanualchunks) option or when the chunk is created by a plugin via [`this.emitFile`](guide/en/#thisemitfileemittedfile-emittedchunk--emittedasset--string). Otherwise it will be derived from the chunk contents.
+ * `[name]`: The name of the chunk. This can be explicitly set via the [`output.manualChunks`](guide/en/#outputmanualchunks) option or when the chunk is created by a plugin via [`this.emitFile`](guide/en/#thisemitfileemittedfile-emittedchunk--emittedasset--string). Otherwise, it will be derived from the chunk contents.
Forward slashes `/` can be used to place files in sub-directories. When using a function, `chunkInfo` is a reduced version of the one in [`generateBundle`](guide/en/#generatebundle) without properties that depend on file names. See also [`output.assetFileNames`](guide/en/#outputassetfilenames), [`output.entryFileNames`](guide/en/#outputentryfilenames).
@@ -469,7 +469,7 @@ import('external2').then(console.log);
Keep in mind that for Rollup, `import * as ext_namespace from 'external'; console.log(ext_namespace.bar);` is completely equivalent to `import {bar} from 'external'; console.log(bar);` and will produce the same code. In the example above however, the namespace object itself is passed to a global function as well, which means we need it as a properly formed object.
-- `"esModule"` assumes that required modules are transpiled ES modules where the required value corresponds to the module namespace and the default export is the `.default` property of the exported object:
+- `"esModule"` assumes that required modules are transpiled ES modules where the required value corresponds to the module namespace, and the default export is the `.default` property of the exported object:
```js
var external = require('external1');
@@ -562,7 +562,7 @@ Keep in mind that for Rollup, `import * as ext_namespace from 'external'; consol
```
- `"defaultOnly"` is similar to `"default"` except for the following:
- * Named imports are forbidden. If such an import is encountered, Rollup throws an error even in `es` and `system` formats. That way it is ensure that the `es` version of the code is able to import non-builtin CommonJS modules in Node correctly.
+ * Named imports are forbidden. If such an import is encountered, Rollup throws an error even in `es` and `system` formats. That way it is ensures that the `es` version of the code is able to import non-builtin CommonJS modules in Node correctly.
* While namespace reexports `export * from 'external';` are not prohibited, they are ignored and will cause Rollup to display a warning because they would not have an effect if there are no named exports.
* When a namespace object is generated, Rollup uses a much simpler helper.
@@ -639,7 +639,7 @@ Type: `{ [chunkAlias: string]: string[] } | ((id: string, {getModuleInfo, getMod
Allows the creation of custom shared common chunks. When using the object form, each property represents a chunk that contains the listed modules and all their dependencies if they are part of the module graph unless they are already in another manual chunk. The name of the chunk will be determined by the property key.
-Note that it is not necessary for the listed modules themselves to be be part of the module graph, which is useful if you are working with `@rollup/plugin-node-resolve` and use deep imports from packages. For instance
+Note that it is not necessary for the listed modules themselves to be part of the module graph, which is useful if you are working with `@rollup/plugin-node-resolve` and use deep imports from packages. For instance
```
manualChunks: {
@@ -659,7 +659,7 @@ manualChunks(id) {
}
```
-Be aware that manual chunks can change the behaviour of the application if side-effects are triggered before the corresponding modules are actually used.
+Be aware that manual chunks can change the behaviour of the application if side effects are triggered before the corresponding modules are actually used.
When using the function form, `manualChunks` will be passed an object as second parameter containing the functions `getModuleInfo` and `getModuleIds` that work the same way as [`this.getModuleInfo`](guide/en/#thisgetmoduleinfomoduleid-string--moduleinfo--null) and [`this.getModuleIds`](guide/en/#thisgetmoduleids--iterableiteratorstring) on the plugin context.
@@ -814,7 +814,7 @@ Type: `boolean`
CLI: `--preserveModules`/`--no-preserveModules`
Default: `false`
-Instead of creating as few chunks as possible, this mode will create separate chunks for all modules using the original module names as file names. Requires the [`output.dir`](guide/en/#outputdir) option. Tree-shaking will still be applied, suppressing files that are not used by the provided entry points or do not have side-effects when executed. This mode can be used to transform a file structure to a different module format.
+Instead of creating as few chunks as possible, this mode will create separate chunks for all modules using the original module names as file names. Requires the [`output.dir`](guide/en/#outputdir) option. Tree-shaking will still be applied, suppressing files that are not used by the provided entry points or do not have side effects when executed. This mode can be used to transform a file structure to a different module format.
Note that when transforming to `cjs` or `amd` format, each file will by default be treated as an entry point with [`output.exports`](guide/en/#outputexports) set to `auto`. This means that e.g. for `cjs`, a file that only contains a default export will be rendered as
@@ -1156,7 +1156,7 @@ What export mode to use. Defaults to `auto`, which guesses your intentions based
* `named` – if you are using named exports
* `none` – if you are not exporting anything (e.g. you are building an app, not a library)
-As this is only an output transformation, you can only choose `default` if there a default export is the only export for all entry chunks. Likewise, you can only choose `none` if there are no exports, otherwise Rollup will error.
+As this is only an output transformation, you can only choose `default` if a default export is the only export for all entry chunks. Likewise, you can only choose `none` if there are no exports, otherwise Rollup will throw an error.
The difference between `default` and `named` affects how other people can consume your bundle. If you use `default`, a CommonJS user could do this, for example:
@@ -1356,7 +1356,7 @@ Type: `boolean`
CLI: `--treeshake.annotations`/`--no-treeshake.annotations`
Default: `true`
-If `false`, ignore hints from pure annotations, i.e. comments containing `@__PURE__` or `#__PURE__`, when determining side-effects of function calls and constructor invocations. These annotations need to immediately precede the call invocation to take effect. The following code will be completely removed unless this option is set to `false`, in which case it will remain unchanged.
+If `false`, ignore hints from pure annotations, i.e. comments containing `@__PURE__` or `#__PURE__`, when determining side effects of function calls and constructor invocations. These annotations need to immediately precede the call invocation to take effect. The following code will be completely removed unless this option is set to `false`, in which case it will remain unchanged.
```javascript
/*@__PURE__*/console.log('side-effect');
@@ -1375,7 +1375,7 @@ Type: `boolean | "no-external" | string[] | (id: string, external: boolean) => b
CLI: `--treeshake.moduleSideEffects`/`--no-treeshake.moduleSideEffects`/`--treeshake.moduleSideEffects no-external`
Default: `true`
-If `false`, assume modules and external dependencies from which nothing is imported do not have other side-effects like mutating global variables or logging without checking. For external dependencies, this will suppress empty imports:
+If `false`, assume modules and external dependencies from which nothing is imported do not have other side effects like mutating global variables or logging without checking. For external dependencies, this will suppress empty imports:
```javascript
// input file
@@ -1405,6 +1405,7 @@ console.log(42);
// input file b.js
console.log('side-effect');
+const ignored = 'will still be removed';
```
```javascript
@@ -1419,14 +1420,49 @@ console.log(42);
console.log(42);
```
-You can also supply a list of modules with side-effects or a function to determine it for each module individually. The value `"no-external"` will only remove external imports if possible and is equivalent to the function `(id, external) => !external`;
+You can also supply a list of modules with side effects or a function to determine it for each module individually. The value `"no-external"` will only remove external imports if possible and is equivalent to the function `(id, external) => !external`;
+
+If a module that has this flag set to `false` reexports a variable from another module and this variable is used, the question if the reexporting module is scanned for side effects depends on how the variable is reexported:
+
+```javascript
+// input file a.js
+import {foo} from './b.js';
+console.log(foo);
+
+// input file b.js
+// direct reexports will ignore side effects
+export {foo} from './c.js';
+console.log('this side-effect is ignored');
+
+// input file c.js
+// indirect reexports will include side effects
+import {foo} from './d.js';
+foo.mutated = true;
+console.log('this side-effect and the mutation are retained');
+export {foo};
+
+// input file d.js
+export const foo = 42;
+```
+
+```javascript
+// output with treeshake.moduleSideEffects === false
+const foo = 42;
+
+foo.mutated = true;
+console.log('this side-effect and the mutation are retained');
+
+console.log(foo);
+```
+
+Note that despite the name, this option does not "add" side effects to modules that do not have side effects. If it is important that e.g. an empty module is "included" in the bundle because you need this for dependency tracking, the plugin interface allows you to designate modules as being excluded from tree-shaking via the [`resolveId`](guide/en/#resolveid), [`load`](guide/en/#load) or [`transform`](guide/en/#transform) hook.
**treeshake.propertyReadSideEffects**
Type: `boolean`
CLI: `--treeshake.propertyReadSideEffects`/`--no-treeshake.propertyReadSideEffects`
Default: `true`
-If `false`, assume reading a property of an object never has side-effects. Depending on your code, disabling this option can significantly reduce bundle size but can potentially break functionality if you rely on getters or errors from illegal property access.
+If `false`, assume reading a property of an object never has side effects. Depending on your code, disabling this option can significantly reduce bundle size but can potentially break functionality if you rely on getters or errors from illegal property access.
```javascript
// Will be removed if treeshake.propertyReadSideEffects === false
@@ -1532,7 +1568,7 @@ Whether to collect performance timings. When used from the command line or a con
}
```
-For each key, the first number represents the elapsed time while the second represents the change in memory consumption and the third represents the total memory consumption after this step. The order of these steps is the order used by `Object.keys`. Top level keys start with `#` and contain the timings of nested steps, i.e. in the example above, the 698ms of the `# BUILD` step include the 538ms of the `## parse modules` step.
+For each key, the first number represents the elapsed time while the second represents the change in memory consumption, and the third represents the total memory consumption after this step. The order of these steps is the order used by `Object.keys`. Top level keys start with `#` and contain the timings of nested steps, i.e. in the example above, the 698ms of the `# BUILD` step include the 538ms of the `## parse modules` step.
### Watch options
@@ -1563,7 +1599,7 @@ Type: `number`
CLI: `--watch.buildDelay `
Default: `0`
-Configures how long Rollup will wait for further changes until it triggers a rebuild in milliseconds. By default, Rollup does not wait but there is a small debounce timeout configured in the chokidar instance. Setting this to a value greater than `0` will mean that Rollup will only triger a rebuild if there was no change for the configured number of milliseconds. If several configurations are watched, Rollup will use the largest configured build delay.
+Configures how long Rollup will wait for further changes until it triggers a rebuild in milliseconds. By default, Rollup does not wait but there is a small debounce timeout configured in the chokidar instance. Setting this to a value greater than `0` will mean that Rollup will only trigger a rebuild if there was no change for the configured number of milliseconds. If several configurations are watched, Rollup will use the largest configured build delay.
#### watch.chokidar
Type: `ChokidarOptions`
@@ -1597,7 +1633,7 @@ export default {
Type: `string | RegExp | (string | RegExp)[]`
CLI: `--watch.include `
-Limit the file-watching to certain files. Note that this only filters the module graph but does not allow to add additional watch files:
+Limit the file-watching to certain files. Note that this only filters the module graph but does not allow adding additional watch files:
```js
// rollup.config.js
@@ -1643,7 +1679,7 @@ Type: `boolean | string[] | (id: string) => boolean | null`
CLI: `--treeshake.pureExternalModules`/`--no-treeshake.pureExternalModules`
Default: `false`
-If `true`, assume external dependencies from which nothing is imported do not have other side-effects like mutating global variables or logging.
+If `true`, assume external dependencies from which nothing is imported do not have other side effects like mutating global variables or logging.
```javascript
// input file
diff --git a/package-lock.json b/package-lock.json
index 68f03c46c..ed91dc468 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"@babel/code-frame": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
- "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
+ "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
"dev": true,
"requires": {
"@babel/highlight": "^7.10.4"
@@ -60,12 +60,12 @@
}
},
"@babel/generator": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.10.tgz",
- "integrity": "sha512-6mCdfhWgmqLdtTkhXjnIz0LcdVCd26wS2JXRtj2XY0u5klDsXBREA/pG5NVOuVnF2LUrBGNFtQkIqqTbblg0ww==",
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz",
+ "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==",
"dev": true,
"requires": {
- "@babel/types": "^7.12.10",
+ "@babel/types": "^7.12.11",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
},
@@ -85,14 +85,14 @@
}
},
"@babel/helper-function-name": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz",
- "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==",
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz",
+ "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==",
"dev": true,
"requires": {
- "@babel/helper-get-function-arity": "^7.10.4",
- "@babel/template": "^7.10.4",
- "@babel/types": "^7.10.4"
+ "@babel/helper-get-function-arity": "^7.12.10",
+ "@babel/template": "^7.12.7",
+ "@babel/types": "^7.12.11"
}
},
"@babel/helper-get-function-arity": {
@@ -149,15 +149,15 @@
}
},
"@babel/helper-replace-supers": {
- "version": "7.12.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz",
- "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==",
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz",
+ "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==",
"dev": true,
"requires": {
- "@babel/helper-member-expression-to-functions": "^7.12.1",
- "@babel/helper-optimise-call-expression": "^7.10.4",
- "@babel/traverse": "^7.12.5",
- "@babel/types": "^7.12.5"
+ "@babel/helper-member-expression-to-functions": "^7.12.7",
+ "@babel/helper-optimise-call-expression": "^7.12.10",
+ "@babel/traverse": "^7.12.10",
+ "@babel/types": "^7.12.11"
}
},
"@babel/helper-simple-access": {
@@ -170,18 +170,18 @@
}
},
"@babel/helper-split-export-declaration": {
- "version": "7.11.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz",
- "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==",
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz",
+ "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==",
"dev": true,
"requires": {
- "@babel/types": "^7.11.0"
+ "@babel/types": "^7.12.11"
}
},
"@babel/helper-validator-identifier": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz",
- "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==",
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz",
+ "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==",
"dev": true
},
"@babel/helpers": {
@@ -207,9 +207,9 @@
}
},
"@babel/parser": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.10.tgz",
- "integrity": "sha512-PJdRPwyoOqFAWfLytxrWwGrAxghCgh/yTNCYciOz8QgjflA7aZhECPZAa2VUedKg2+QMWkI0L9lynh2SNmNEgA==",
+ "version": "7.12.11",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz",
+ "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==",
"dev": true
},
"@babel/template": {
@@ -224,17 +224,17 @@
}
},
"@babel/traverse": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.10.tgz",
- "integrity": "sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg==",
+ "version": "7.12.12",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.12.tgz",
+ "integrity": "sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w==",
"dev": true,
"requires": {
- "@babel/code-frame": "^7.10.4",
- "@babel/generator": "^7.12.10",
- "@babel/helper-function-name": "^7.10.4",
- "@babel/helper-split-export-declaration": "^7.11.0",
- "@babel/parser": "^7.12.10",
- "@babel/types": "^7.12.10",
+ "@babel/code-frame": "^7.12.11",
+ "@babel/generator": "^7.12.11",
+ "@babel/helper-function-name": "^7.12.11",
+ "@babel/helper-split-export-declaration": "^7.12.11",
+ "@babel/parser": "^7.12.11",
+ "@babel/types": "^7.12.12",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.19"
@@ -249,20 +249,20 @@
}
},
"@babel/types": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.10.tgz",
- "integrity": "sha512-sf6wboJV5mGyip2hIpDSKsr80RszPinEFjsHTalMxZAZkoQ2/2yQzxlcFN52SJqsyPfLtPmenL4g2KB3KJXPDw==",
+ "version": "7.12.12",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.12.tgz",
+ "integrity": "sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ==",
"dev": true,
"requires": {
- "@babel/helper-validator-identifier": "^7.10.4",
+ "@babel/helper-validator-identifier": "^7.12.11",
"lodash": "^4.17.19",
"to-fast-properties": "^2.0.0"
}
},
"@eslint/eslintrc": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz",
- "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==",
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz",
+ "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==",
"dev": true,
"requires": {
"ajv": "^6.12.4",
@@ -272,7 +272,7 @@
"ignore": "^4.0.6",
"import-fresh": "^3.2.1",
"js-yaml": "^3.13.1",
- "lodash": "^4.17.19",
+ "lodash": "^4.17.20",
"minimatch": "^3.0.4",
"strip-json-comments": "^3.1.1"
}
@@ -406,9 +406,9 @@
}
},
"@rollup/plugin-node-resolve": {
- "version": "10.0.0",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-10.0.0.tgz",
- "integrity": "sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A==",
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.1.0.tgz",
+ "integrity": "sha512-ouBBppRdWJKCllDXGzJ7ZIkYbaq+5TmyP0smt1vdJCFfoZhLi31vhpmjLhyo8lreHf4RoeSNllaWrvSqHpHRog==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^3.1.0",
@@ -416,7 +416,7 @@
"builtin-modules": "^3.1.0",
"deepmerge": "^4.2.2",
"is-module": "^1.0.0",
- "resolve": "^1.17.0"
+ "resolve": "^1.19.0"
}
},
"@rollup/plugin-replace": {
@@ -508,9 +508,9 @@
"dev": true
},
"@types/node": {
- "version": "10.17.49",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.49.tgz",
- "integrity": "sha512-PGaJNs5IZz5XgzwJvL/1zRfZB7iaJ5BydZ8/Picm+lUNYoNO9iVTQkVy5eUh0dZDrx3rBOIs3GCbCRmMuYyqwg==",
+ "version": "10.17.51",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.51.tgz",
+ "integrity": "sha512-KANw+MkL626tq90l++hGelbl67irOJzGhUJk6a1Bt8QHOeh9tztJx+L0AqttraWKinmZn7Qi5lJZJzx45Gq0dg==",
"dev": true
},
"@types/parse-json": {
@@ -551,9 +551,9 @@
"dev": true
},
"@types/yargs-parser": {
- "version": "15.0.0",
- "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz",
- "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==",
+ "version": "20.2.0",
+ "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz",
+ "integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==",
"dev": true
},
"@ungap/promise-all-settled": {
@@ -589,12 +589,6 @@
"integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
"dev": true
},
- "acorn-numeric-separator": {
- "version": "0.3.6",
- "resolved": "https://registry.npmjs.org/acorn-numeric-separator/-/acorn-numeric-separator-0.3.6.tgz",
- "integrity": "sha512-jUr5esgChu4k7VzesH/Nww3EysuyGJJcTEEiXqILUFKpO96PNyEXmK21M6nE0TSqGA1PeEg1MzgqJaoFsn9JMw==",
- "dev": true
- },
"acorn-private-class-elements": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/acorn-private-class-elements/-/acorn-private-class-elements-0.2.7.tgz",
@@ -611,9 +605,9 @@
}
},
"acorn-walk": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.0.0.tgz",
- "integrity": "sha512-oZRad/3SMOI/pxbbmqyurIx7jHw1wZDcR9G44L8pUVFEomX/0dH89SrM1KaDXuv1NpzAXz6Op/Xu/Qd5XXzdEA==",
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.0.1.tgz",
+ "integrity": "sha512-zn/7dYtoTVkG4EoMU55QlQU4F+m+T7Kren6Vj3C2DapWPnakG/DL9Ns5aPAPW5Ixd3uxXrV/BoMKKVFIazPcdg==",
"dev": true
},
"agent-base": {
@@ -756,9 +750,9 @@
}
},
"astral-regex": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz",
- "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
"dev": true
},
"balanced-match": {
@@ -768,9 +762,9 @@
"dev": true
},
"binary-extensions": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz",
- "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
+ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
"dev": true
},
"brace-expansion": {
@@ -828,9 +822,9 @@
"dev": true
},
"builtin-modules": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz",
- "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==",
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz",
+ "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==",
"dev": true
},
"caching-transform": {
@@ -846,13 +840,13 @@
}
},
"call-bind": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz",
- "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
+ "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.0"
+ "get-intrinsic": "^1.0.2"
}
},
"callsites": {
@@ -934,12 +928,6 @@
"color-convert": "^2.0.1"
}
},
- "astral-regex": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
- "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
- "dev": true
- },
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@@ -955,18 +943,6 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
- "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
- },
- "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",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "dev": true
- },
"slice-ansi": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz",
@@ -977,17 +953,6 @@
"astral-regex": "^2.0.0",
"is-fullwidth-code-point": "^3.0.0"
}
- },
- "string-width": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
- "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
- "dev": true,
- "requires": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.0"
- }
}
}
},
@@ -1008,6 +973,29 @@
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
},
+ "emoji-regex": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
+ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+ "dev": true
+ },
+ "string-width": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+ "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^7.0.1",
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^5.1.0"
+ }
+ },
"strip-ansi": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
@@ -1118,9 +1106,9 @@
}
},
"core-js": {
- "version": "3.8.1",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.1.tgz",
- "integrity": "sha512-9Id2xHY1W7m8hCl8NkhQn5CufmF/WuR30BTRewvCXc1aZd3kMECwNZ69ndLbekKfakw9Rf2Xyc+QR6E7Gg+obg==",
+ "version": "3.8.2",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.2.tgz",
+ "integrity": "sha512-FfApuSRgrR6G5s58casCBd9M2k+4ikuu4wbW6pJyYU7bd9zvFc9qf7vr5xmrZOhT9nn+8uwlH1oRR9jTnFoA3A==",
"dev": true
},
"cosmiconfig": {
@@ -1137,9 +1125,9 @@
},
"dependencies": {
"parse-json": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz",
- "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
+ "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
@@ -1257,9 +1245,9 @@
}
},
"emoji-regex": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
- "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
+ "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
},
"end-of-stream": {
@@ -1302,23 +1290,25 @@
}
},
"es-abstract": {
- "version": "1.18.0-next.1",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
- "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
+ "version": "1.18.0-next.2",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz",
+ "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==",
"dev": true,
"requires": {
+ "call-bind": "^1.0.2",
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
+ "get-intrinsic": "^1.0.2",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.2.2",
- "is-negative-zero": "^2.0.0",
+ "is-negative-zero": "^2.0.1",
"is-regex": "^1.1.1",
- "object-inspect": "^1.8.0",
+ "object-inspect": "^1.9.0",
"object-keys": "^1.1.1",
- "object.assign": "^4.1.1",
- "string.prototype.trimend": "^1.0.1",
- "string.prototype.trimstart": "^1.0.1"
+ "object.assign": "^4.1.2",
+ "string.prototype.trimend": "^1.0.3",
+ "string.prototype.trimstart": "^1.0.3"
}
},
"es-to-primitive": {
@@ -1333,9 +1323,9 @@
}
},
"es5-shim": {
- "version": "4.5.14",
- "resolved": "https://registry.npmjs.org/es5-shim/-/es5-shim-4.5.14.tgz",
- "integrity": "sha512-7SwlpL+2JpymWTt8sNLuC2zdhhc+wrfe5cMPI2j0o6WsPdfAiPwmFy2f0AocPB4RQVBOZ9kNTgi5YF7TdhkvEg==",
+ "version": "4.5.15",
+ "resolved": "https://registry.npmjs.org/es5-shim/-/es5-shim-4.5.15.tgz",
+ "integrity": "sha512-FYpuxEjMeDvU4rulKqFdukQyZSTpzhg4ScQHrAosrlVpR6GFyaw14f74yn2+4BugniIS0Frpg7TvwZocU4ZMTw==",
"dev": true
},
"es6-error": {
@@ -1357,13 +1347,13 @@
"dev": true
},
"eslint": {
- "version": "7.15.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.15.0.tgz",
- "integrity": "sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA==",
+ "version": "7.18.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz",
+ "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
- "@eslint/eslintrc": "^0.2.2",
+ "@eslint/eslintrc": "^0.3.0",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
"cross-spawn": "^7.0.2",
@@ -1387,7 +1377,7 @@
"js-yaml": "^3.13.1",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.4.1",
- "lodash": "^4.17.19",
+ "lodash": "^4.17.20",
"minimatch": "^3.0.4",
"natural-compare": "^1.4.0",
"optionator": "^0.9.1",
@@ -1396,7 +1386,7 @@
"semver": "^7.2.1",
"strip-ansi": "^6.0.0",
"strip-json-comments": "^3.1.0",
- "table": "^5.2.3",
+ "table": "^6.0.4",
"text-table": "^0.2.0",
"v8-compile-cache": "^2.0.3"
},
@@ -1813,12 +1803,12 @@
}
},
"find-versions": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz",
- "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz",
+ "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==",
"dev": true,
"requires": {
- "semver-regex": "^2.0.0"
+ "semver-regex": "^3.1.2"
}
},
"fixturify": {
@@ -1921,9 +1911,9 @@
"dev": true
},
"get-intrinsic": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz",
- "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz",
+ "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
@@ -2109,18 +2099,18 @@
"dev": true
},
"husky": {
- "version": "4.3.6",
- "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.6.tgz",
- "integrity": "sha512-o6UjVI8xtlWRL5395iWq9LKDyp/9TE7XMOTvIpEVzW638UcGxTmV5cfel6fsk/jbZSTlvfGVJf2svFtybcIZag==",
+ "version": "4.3.8",
+ "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz",
+ "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"ci-info": "^2.0.0",
"compare-versions": "^3.6.0",
"cosmiconfig": "^7.0.0",
- "find-versions": "^3.2.0",
+ "find-versions": "^4.0.0",
"opencollective-postinstall": "^2.0.2",
- "pkg-dir": "^4.2.0",
+ "pkg-dir": "^5.0.0",
"please-upgrade-node": "^3.2.0",
"slash": "^3.0.0",
"which-pm-runs": "^1.0.0"
@@ -2161,12 +2151,12 @@
"dev": true
},
"find-up": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
- "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
"dev": true,
"requires": {
- "locate-path": "^5.0.0",
+ "locate-path": "^6.0.0",
"path-exists": "^4.0.0"
}
},
@@ -2177,38 +2167,32 @@
"dev": true
},
"locate-path": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
- "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
"dev": true,
"requires": {
- "p-locate": "^4.1.0"
+ "p-locate": "^5.0.0"
}
},
"p-limit": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
- "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
"dev": true,
"requires": {
- "p-try": "^2.0.0"
+ "yocto-queue": "^0.1.0"
}
},
"p-locate": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
- "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
"dev": true,
"requires": {
- "p-limit": "^2.2.0"
+ "p-limit": "^3.0.2"
}
},
- "p-try": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
- "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
- "dev": true
- },
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
@@ -2216,12 +2200,12 @@
"dev": true
},
"pkg-dir": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
- "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz",
+ "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==",
"dev": true,
"requires": {
- "find-up": "^4.0.0"
+ "find-up": "^5.0.0"
}
},
"supports-color": {
@@ -2251,9 +2235,9 @@
}
},
"import-fresh": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz",
- "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"dev": true,
"requires": {
"parent-module": "^1.0.0",
@@ -2343,9 +2327,9 @@
"dev": true
},
"is-fullwidth-code-point": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
- "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"is-glob": {
@@ -2652,9 +2636,9 @@
}
},
"jsonc-parser": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz",
- "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz",
+ "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==",
"dev": true
},
"jsonfile": {
@@ -2986,55 +2970,6 @@
"cli-cursor": "^3.1.0",
"slice-ansi": "^4.0.0",
"wrap-ansi": "^6.2.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
- "requires": {
- "color-convert": "^2.0.1"
- }
- },
- "astral-regex": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
- "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
- "dev": true
- },
- "color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
- "requires": {
- "color-name": "~1.1.4"
- }
- },
- "color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true
- },
- "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",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "dev": true
- },
- "slice-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
- "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^4.0.0",
- "astral-regex": "^2.0.0",
- "is-fullwidth-code-point": "^3.0.0"
- }
- }
}
},
"lru-cache": {
@@ -3073,44 +3008,52 @@
}
},
"markdown-it": {
- "version": "11.0.0",
- "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-11.0.0.tgz",
- "integrity": "sha512-+CvOnmbSubmQFSA9dKz1BRiaSMV7rhexl3sngKqFyXSagoA3fBdJQ8oZWtRy2knXdpDXaBw44euz37DeJQ9asg==",
+ "version": "12.0.2",
+ "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.0.2.tgz",
+ "integrity": "sha512-4Lkvjbv2kK+moL9TbeV+6/NHx+1Q+R/NIdUlFlkqkkzUcTod4uiyTJRiBidKR9qXSdkNFkgv+AELY8KN9vSgVA==",
"dev": true,
"requires": {
- "argparse": "^1.0.7",
+ "argparse": "^2.0.1",
"entities": "~2.0.0",
"linkify-it": "^3.0.1",
"mdurl": "^1.0.1",
"uc.micro": "^1.0.5"
+ },
+ "dependencies": {
+ "argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true
+ }
}
},
"markdownlint": {
- "version": "0.21.1",
- "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.21.1.tgz",
- "integrity": "sha512-8kc88w5dyEzlmOWIElp8J17qBgzouOQfJ0LhCcpBFrwgyYK6JTKvILsk4FCEkiNqHkTxwxopT2RS2DYb/10qqg==",
+ "version": "0.22.0",
+ "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.22.0.tgz",
+ "integrity": "sha512-J4B+iMc12pOdp/wfYi03W2qfAfEyiZzq3qvQh/8vOMNU8vXYY6Jg440EY7dWTBCqROhb1i4nAn3BTByJ5kdx1w==",
"dev": true,
"requires": {
- "markdown-it": "11.0.0"
+ "markdown-it": "12.0.2"
}
},
"markdownlint-cli": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.25.0.tgz",
- "integrity": "sha512-pmiXJgPQtAx6YOMXPCCO3AudMWv8Gnhfrprn0raqevofOhO95nJZ6bTEXkUVbzEwvYhvGxE0Yl888aZwuRGMGw==",
+ "version": "0.26.0",
+ "resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.26.0.tgz",
+ "integrity": "sha512-biLfeGNZG9nw0yJbtFBzRlew2/P5w7JSseKwolSox3zejs7dLpGvPgqbC+iqJnqqGWcWLtXaXh8bBEKWmfl10A==",
"dev": true,
"requires": {
- "commander": "~6.2.0",
+ "commander": "~6.2.1",
"deep-extend": "~0.6.0",
"get-stdin": "~8.0.0",
"glob": "~7.1.6",
"ignore": "~5.1.8",
- "js-yaml": "~3.14.0",
- "jsonc-parser": "~2.3.1",
+ "js-yaml": "~3.14.1",
+ "jsonc-parser": "~3.0.0",
"lodash.differencewith": "~4.5.0",
"lodash.flatten": "~4.4.0",
- "markdownlint": "~0.21.1",
- "markdownlint-rule-helpers": "~0.12.0",
+ "markdownlint": "~0.22.0",
+ "markdownlint-rule-helpers": "~0.13.0",
"minimatch": "~3.0.4",
"minimist": "~1.2.5",
"rc": "~1.2.8"
@@ -3121,13 +3064,23 @@
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true
+ },
+ "js-yaml": {
+ "version": "3.14.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
+ "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
+ "dev": true,
+ "requires": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ }
}
}
},
"markdownlint-rule-helpers": {
- "version": "0.12.0",
- "resolved": "https://registry.npmjs.org/markdownlint-rule-helpers/-/markdownlint-rule-helpers-0.12.0.tgz",
- "integrity": "sha512-Q7qfAk+AJvx82ZY52OByC4yjoQYryOZt6D8TKrZJIwCfhZvcj8vCQNuwDqILushtDBTvGFmUPq+uhOb1KIMi6A==",
+ "version": "0.13.0",
+ "resolved": "https://registry.npmjs.org/markdownlint-rule-helpers/-/markdownlint-rule-helpers-0.13.0.tgz",
+ "integrity": "sha512-rRY0itbcHG4e+ntz0bbY3AIceSJMKS0TafEMgEtKVHRZ54/JUSy6/4ypCL618RlJvYRej+xMLxX5nkJqIeTZaQ==",
"dev": true
},
"matcher-collection": {
@@ -3228,6 +3181,22 @@
"yargs-unparser": "2.0.0"
},
"dependencies": {
+ "chokidar": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz",
+ "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==",
+ "dev": true,
+ "requires": {
+ "anymatch": "~3.1.1",
+ "braces": "~3.0.2",
+ "fsevents": "~2.1.2",
+ "glob-parent": "~5.1.0",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.5.0"
+ }
+ },
"debug": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
@@ -3338,9 +3307,9 @@
"dev": true
},
"node-addon-api": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.0.2.tgz",
- "integrity": "sha512-+D4s2HCnxPd5PjjI0STKwncjXTUKKqm74MDMz9OPXavjsGmjkvwgLtA5yoxJUdmpj52+2u+RrXgPipahKczMKg==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.1.0.tgz",
+ "integrity": "sha512-flmrDNB06LIl5lywUz7YlNGZH/5p0M7W28k8hzd9Lshtdh1wshD2Y+U4h9LD6KObOy1f+fEVdgprPrEymjM5uw==",
"dev": true
},
"node-fetch": {
@@ -3445,12 +3414,6 @@
"wrap-ansi": "^6.2.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
- },
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
@@ -3461,12 +3424,6 @@
"path-exists": "^4.0.0"
}
},
- "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",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "dev": true
- },
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@@ -3521,17 +3478,6 @@
"integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
"dev": true
},
- "string-width": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
- "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
- "dev": true,
- "requires": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.0"
- }
- },
"yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
@@ -3788,9 +3734,9 @@
"dev": true
},
"pretty-bytes": {
- "version": "5.4.1",
- "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.4.1.tgz",
- "integrity": "sha512-s1Iam6Gwz3JI5Hweaz4GoCD1WUNUIyzePFy5+Js2hjwGVt2Z79wNN+ZKOZ2vB6C+Xs6njyB84Z1IthQg8d9LxA==",
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.5.0.tgz",
+ "integrity": "sha512-p+T744ZyjjiaFlMUZZv6YPC5JrkNj8maRmPaQCWFJFplUAzpIUTRaTcS+7wmZtUoFXHtESJb23ISliaWyz3SHA==",
"dev": true
},
"pretty-ms": {
@@ -3949,9 +3895,9 @@
"dev": true
},
"regjsparser": {
- "version": "0.6.4",
- "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz",
- "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==",
+ "version": "0.6.6",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.6.tgz",
+ "integrity": "sha512-jjyuCp+IEMIm3N1H1LLTJW1EISEJV9+5oHdEyrt43Pg9cDSb6rrLZei2cVWpl0xTjmmlpec/lEQGYgM7xfpGCQ==",
"dev": true,
"requires": {
"jsesc": "~0.5.0"
@@ -3972,6 +3918,12 @@
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
"dev": true
},
+ "require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+ "dev": true
+ },
"require-main-filename": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
@@ -4032,9 +3984,9 @@
}
},
"rollup": {
- "version": "2.34.2",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.34.2.tgz",
- "integrity": "sha512-mvtQLqu3cNeoctS+kZ09iOPxrc1P1/Bt1z15enuQ5feyKOdM3MJAVFjjsygurDpSWn530xB4AlA83TWIzRstXA==",
+ "version": "2.36.2",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.36.2.tgz",
+ "integrity": "sha512-qjjiuJKb+/8n0EZyQYVW+gFU4bNRBcZaXVzUgSVrGw0HlQBlK2aWyaOMMs1Ufic1jV69b9kW3u3i9B+hISDm3A==",
"dev": true,
"requires": {
"fsevents": "~2.1.2"
@@ -4200,9 +4152,9 @@
"dev": true
},
"semver-regex": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz",
- "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==",
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.2.tgz",
+ "integrity": "sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==",
"dev": true
},
"serialize-javascript": {
@@ -4279,14 +4231,40 @@
"dev": true
},
"slice-ansi": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz",
- "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
"dev": true,
"requires": {
- "ansi-styles": "^3.2.0",
- "astral-regex": "^1.0.0",
- "is-fullwidth-code-point": "^2.0.0"
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ }
}
},
"source-map": {
@@ -4424,31 +4402,14 @@
"dev": true
},
"string-width": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
- "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
+ "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
"dev": true,
"requires": {
- "emoji-regex": "^7.0.1",
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^5.1.0"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
- "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
- "dev": true
- },
- "strip-ansi": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
- "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
- "dev": true,
- "requires": {
- "ansi-regex": "^4.1.0"
- }
- }
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.0"
}
},
"string.prototype.trimend": {
@@ -4525,21 +4486,41 @@
}
},
"systemjs": {
- "version": "6.8.1",
- "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.8.1.tgz",
- "integrity": "sha512-HjxELHbx2LpfHfrsrYFMvkK1Hfh3IpUxPUNUzClxThW0POUlv53qb8N0FZ48+hlfIC4OANFwzxwRp4fTXSfYKw==",
+ "version": "6.8.3",
+ "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.8.3.tgz",
+ "integrity": "sha512-UcTY+FEA1B7e+bpJk1TI+a9Na6LG7wFEqW7ED16cLqLuQfI/9Ri0rsXm3tKlIgNoHyLHZycjdAOijzNbzelgwA==",
"dev": true
},
"table": {
- "version": "5.4.6",
- "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz",
- "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==",
+ "version": "6.0.7",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz",
+ "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==",
"dev": true,
"requires": {
- "ajv": "^6.10.2",
- "lodash": "^4.17.14",
- "slice-ansi": "^2.1.0",
- "string-width": "^3.0.0"
+ "ajv": "^7.0.2",
+ "lodash": "^4.17.20",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.0"
+ },
+ "dependencies": {
+ "ajv": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz",
+ "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==",
+ "dev": true,
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+ "dev": true
+ }
}
},
"teeny-request": {
@@ -4631,9 +4612,9 @@
}
},
"tslib": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
- "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz",
+ "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==",
"dev": true
},
"tslint": {
@@ -4780,9 +4761,9 @@
"dev": true
},
"uri-js": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
- "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==",
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
"dev": true,
"requires": {
"punycode": "^2.1.0"
@@ -4885,6 +4866,12 @@
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
+ "is-fullwidth-code-point": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+ "dev": true
+ },
"string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
@@ -4952,29 +4939,6 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
- },
- "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
- },
- "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",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "dev": true
- },
- "string-width": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
- "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
- "dev": true,
- "requires": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.0"
- }
}
}
},
@@ -5032,6 +4996,18 @@
"yargs-parser": "^13.1.2"
},
"dependencies": {
+ "ansi-regex": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
+ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
+ "dev": true
+ },
"find-up": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
@@ -5041,6 +5017,12 @@
"locate-path": "^3.0.0"
}
},
+ "is-fullwidth-code-point": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+ "dev": true
+ },
"locate-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
@@ -5075,6 +5057,26 @@
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
+ "string-width": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+ "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^7.0.1",
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^5.1.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^4.1.0"
+ }
+ },
"yargs-parser": {
"version": "13.1.2",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz",
diff --git a/package.json b/package.json
index 0d872f574..838b46221 100644
--- a/package.json
+++ b/package.json
@@ -62,48 +62,47 @@
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
- "@rollup/plugin-node-resolve": "^10.0.0",
+ "@rollup/plugin-node-resolve": "^11.1.0",
"@rollup/plugin-replace": "^2.3.4",
"@types/micromatch": "^4.0.1",
- "@types/node": "^10.17.49",
+ "@types/node": "^10.17.51",
"@types/require-relative": "^0.8.0",
"@types/signal-exit": "^3.0.0",
- "@types/yargs-parser": "^15.0.0",
+ "@types/yargs-parser": "^20.2.0",
"acorn": "^8.0.4",
"acorn-class-fields": "^0.3.7",
"acorn-jsx": "^5.3.1",
- "acorn-numeric-separator": "^0.3.6",
"acorn-static-class-features": "^0.2.4",
- "acorn-walk": "^8.0.0",
+ "acorn-walk": "^8.0.1",
"buble": "^0.20.0",
"chokidar": "^3.4.3",
"codecov": "^3.8.1",
"colorette": "^1.2.1",
- "core-js": "^3.8.1",
+ "core-js": "^3.8.2",
"date-time": "^3.1.0",
- "es5-shim": "^4.5.14",
+ "es5-shim": "^4.5.15",
"es6-shim": "^0.35.6",
- "eslint": "^7.15.0",
+ "eslint": "^7.18.0",
"eslint-plugin-import": "^2.22.1",
"execa": "^5.0.0",
"fixturify": "^2.1.0",
"hash.js": "^1.1.7",
- "husky": "^4.3.6",
+ "husky": "^4.3.8",
"is-reference": "^1.2.1",
"lint-staged": "^10.5.3",
"locate-character": "^2.0.5",
"magic-string": "^0.25.7",
- "markdownlint-cli": "^0.25.0",
+ "markdownlint-cli": "^0.26.0",
"micromatch": "^4.0.2",
"mocha": "^8.2.1",
"node-fetch": "^2.6.1",
"nyc": "^15.1.0",
"prettier": "^2.2.1",
- "pretty-bytes": "^5.4.1",
+ "pretty-bytes": "^5.5.0",
"pretty-ms": "^7.0.1",
"require-relative": "^0.8.7",
"requirejs": "^2.3.6",
- "rollup": "^2.34.2",
+ "rollup": "^2.36.2",
"rollup-plugin-license": "^2.2.0",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
@@ -116,9 +115,9 @@
"source-map": "^0.7.3",
"source-map-support": "^0.5.19",
"sourcemap-codec": "^1.4.8",
- "systemjs": "^6.8.1",
+ "systemjs": "^6.8.3",
"terser": "^5.5.1",
- "tslib": "^2.0.3",
+ "tslib": "^2.1.0",
"tslint": "^6.1.3",
"typescript": "^4.1.3",
"url-parse": "^1.4.7",
@@ -142,8 +141,5 @@
"default": "./dist/es/rollup.browser.js"
},
"./dist/": "./dist/"
- },
- "dependencies": {
- "fsevents": "~2.1.2"
}
}
diff --git a/rollup.config.js b/rollup.config.js
index 54504fa7f..68a4d365b 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -49,14 +49,7 @@ const moduleAliases = {
resolve: ['.js', '.json', '.md'],
entries: [
{ find: 'help.md', replacement: path.resolve('cli/help.md') },
- { find: 'package.json', replacement: path.resolve('package.json') },
- {
- find: 'acorn-numeric-separator',
- replacement: path.join(
- __dirname,
- 'node_modules/acorn-numeric-separator/dist/acorn-numeric-separator.js'
- )
- }
+ { find: 'package.json', replacement: path.resolve('package.json') }
]
};
diff --git a/src/Chunk.ts b/src/Chunk.ts
index 808c0dd91..50585dd1e 100644
--- a/src/Chunk.ts
+++ b/src/Chunk.ts
@@ -30,18 +30,19 @@ import { collapseSourcemaps } from './utils/collapseSourcemaps';
import { createHash } from './utils/crypto';
import { deconflictChunk, DependenciesToBeDeconflicted } from './utils/deconflictChunk';
import {
+ errCyclicCrossChunkReexport,
errFailedValidation,
error,
errUnexpectedNamedImport,
errUnexpectedNamespaceReexport
} from './utils/error';
import { escapeId } from './utils/escapeId';
-import { sortByExecutionOrder } from './utils/executionOrder';
import { assignExportsToMangledNames, assignExportsToNames } from './utils/exportNames';
import getExportMode from './utils/getExportMode';
import { getId } from './utils/getId';
import getIndentString from './utils/getIndentString';
import { getOrCreate } from './utils/getOrCreate';
+import { getStaticDependencies } from './utils/getStaticDependencies';
import { makeLegal } from './utils/identifierHelpers';
import {
defaultInteropHelpersByInteropType,
@@ -355,7 +356,6 @@ export default class Chunk {
this.facadeChunkByModule.set(module, this);
if (module.preserveSignature) {
this.strictFacade = needsStrictFacade;
- this.ensureReexportsAreAvailableForModule(module);
}
this.assignFacadeName(requiredFacades.shift()!, module);
}
@@ -546,8 +546,8 @@ export default class Chunk {
}
link() {
+ this.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule);
for (const module of this.orderedModules) {
- this.addDependenciesToChunk(module.getDependenciesToBeIncluded(), this.dependencies);
this.addDependenciesToChunk(module.dynamicDependencies, this.dynamicDependencies);
this.addDependenciesToChunk(module.implicitlyLoadedBefore, this.implicitlyLoadedBefore);
this.setUpChunkImportsAndExportsForModule(module);
@@ -585,9 +585,6 @@ export default class Chunk {
if (dep instanceof Chunk) this.inlineChunkDependencies(dep);
}
}
- const sortedDependencies = [...this.dependencies];
- sortByExecutionOrder(sortedDependencies);
- this.dependencies = new Set(sortedDependencies);
this.prepareDynamicImportsAndImportMetas();
this.setIdentifierRenderResolutions(options);
@@ -820,6 +817,31 @@ export default class Chunk {
}
}
+ private checkCircularDependencyImport(variable: Variable, importingModule: Module) {
+ const variableModule = variable.module;
+ if (variableModule instanceof Module) {
+ const exportChunk = this.chunkByModule.get(variableModule);
+ let alternativeReexportModule;
+ do {
+ alternativeReexportModule = importingModule.alternativeReexportModules.get(variable);
+ if (alternativeReexportModule) {
+ const exportingChunk = this.chunkByModule.get(alternativeReexportModule);
+ if (exportingChunk && exportingChunk !== exportChunk) {
+ this.inputOptions.onwarn(
+ errCyclicCrossChunkReexport(
+ variableModule.getExportNamesByVariable().get(variable)![0],
+ variableModule.id,
+ alternativeReexportModule.id,
+ importingModule.id
+ )
+ );
+ }
+ importingModule = alternativeReexportModule;
+ }
+ } while (alternativeReexportModule);
+ }
+ }
+
private computeContentHashWithDependencies(
addons: Addons,
options: NormalizedOutputOptions,
@@ -854,6 +876,7 @@ export default class Chunk {
? (exportedVariable as SyntheticNamedExportVariable).getBaseVariable()
: exportedVariable;
if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
+ this.checkCircularDependencyImport(importedVariable, module);
const exportingModule = importedVariable.module;
if (exportingModule instanceof Module) {
const chunk = this.chunkByModule.get(exportingModule);
@@ -1312,6 +1335,7 @@ export default class Chunk {
variable.module instanceof Module
) {
chunk!.exports.add(variable);
+ this.checkCircularDependencyImport(variable, module);
}
}
}
diff --git a/src/Module.ts b/src/Module.ts
index 0509a209a..fa498192d 100644
--- a/src/Module.ts
+++ b/src/Module.ts
@@ -45,8 +45,16 @@ import {
RollupWarning,
TransformModuleJSON
} from './rollup/types';
-import { augmentCodeLocation, errNamespaceConflict, error, Errors } from './utils/error';
+import {
+ augmentCodeLocation,
+ errCircularReexport,
+ errMissingExport,
+ errNamespaceConflict,
+ error,
+ errSyntheticNamedExportsNeedNamespaceExport
+} from './utils/error';
import { getId } from './utils/getId';
+import { getOrCreate } from './utils/getOrCreate';
import { getOriginalLocation } from './utils/getOriginalLocation';
import { makeLegal } from './utils/identifierHelpers';
import { basename, extname } from './utils/path';
@@ -102,13 +110,13 @@ export interface AstContext {
importDescriptions: { [name: string]: ImportDescription };
includeAllExports: () => void;
includeDynamicImport: (node: ImportExpression) => void;
- includeVariable: (variable: Variable) => void;
+ includeVariableInModule: (variable: Variable) => void;
magicString: MagicString;
module: Module; // not to be used for tree-shaking
moduleContext: string;
nodeConstructors: { [name: string]: typeof NodeBase };
options: NormalizedInputOptions;
- traceExport: (name: string) => Variable;
+ traceExport: (name: string) => Variable | null;
traceVariable: (name: string) => Variable | null;
usesTopLevelAwait: boolean;
warn: (warning: RollupWarning, pos: number) => void;
@@ -143,24 +151,6 @@ function tryParse(
}
}
-function handleMissingExport(
- exportName: string,
- importingModule: Module,
- importedModule: string,
- importerStart?: number
-): never {
- return importingModule.error(
- {
- code: 'MISSING_EXPORT',
- message: `'${exportName}' is not exported by ${relativeId(
- importedModule
- )}, imported by ${relativeId(importingModule.id)}`,
- url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`
- },
- importerStart!
- );
-}
-
const MISSING_EXPORT_SHIM_DESCRIPTION: ExportDescription = {
identifier: null,
localName: MISSING_EXPORT_SHIM_VARIABLE
@@ -169,26 +159,67 @@ const MISSING_EXPORT_SHIM_DESCRIPTION: ExportDescription = {
function getVariableForExportNameRecursive(
target: Module | ExternalModule,
name: string,
+ importerForSideEffects: Module | undefined,
isExportAllSearch: boolean,
searchedNamesAndModules = new Map>()
): Variable | null {
const searchedModules = searchedNamesAndModules.get(name);
if (searchedModules) {
if (searchedModules.has(target)) {
- return null;
+ return isExportAllSearch ? null : error(errCircularReexport(name, target.id));
}
searchedModules.add(target);
} else {
searchedNamesAndModules.set(name, new Set([target]));
}
- return target.getVariableForExportName(name, isExportAllSearch, searchedNamesAndModules);
+ return target.getVariableForExportName(
+ name,
+ importerForSideEffects,
+ isExportAllSearch,
+ searchedNamesAndModules
+ );
+}
+
+function getAndExtendSideEffectModules(variable: Variable, module: Module): Set {
+ const sideEffectModules = getOrCreate(
+ module.sideEffectDependenciesByVariable,
+ variable,
+ () => new Set()
+ );
+ let currentVariable: Variable | null = variable;
+ const referencedVariables = new Set([currentVariable]);
+ while (true) {
+ const importingModule = currentVariable.module! as Module;
+ currentVariable =
+ currentVariable instanceof ExportDefaultVariable
+ ? currentVariable.getDirectOriginalVariable()
+ : currentVariable instanceof SyntheticNamedExportVariable
+ ? currentVariable.syntheticNamespace
+ : null;
+ if (!currentVariable || referencedVariables.has(currentVariable)) {
+ break;
+ }
+ referencedVariables.add(variable);
+ sideEffectModules.add(importingModule);
+ const originalSideEffects = importingModule.sideEffectDependenciesByVariable.get(
+ currentVariable
+ );
+ if (originalSideEffects) {
+ for (const module of originalSideEffects) {
+ sideEffectModules.add(module);
+ }
+ }
+ }
+ return sideEffectModules;
}
export default class Module {
+ alternativeReexportModules = new Map();
ast: Program | null = null;
chunkFileNames = new Set();
chunkName: string | null = null;
comments: CommentDescription[] = [];
+ cycles = new Set();
dependencies = new Set();
dynamicDependencies = new Set();
dynamicImporters: string[] = [];
@@ -219,6 +250,7 @@ export default class Module {
reexportDescriptions: { [name: string]: ReexportDescription } = Object.create(null);
resolvedIds!: ResolvedIdMap;
scope!: ModuleScope;
+ sideEffectDependenciesByVariable = new Map>();
sourcemapChain!: DecodedSourceMapOrMissing[];
sources = new Set();
transformFiles?: EmittedFile[];
@@ -333,9 +365,10 @@ export default class Module {
getDependenciesToBeIncluded(): Set {
if (this.relevantDependencies) return this.relevantDependencies;
const relevantDependencies = new Set();
- const additionalSideEffectModules = new Set();
- const possibleDependencies = new Set(this.dependencies);
- let dependencyVariables = this.imports;
+ const necessaryDependencies = new Set();
+ const alwaysCheckedDependencies = new Set();
+
+ let dependencyVariables: Set | IterableIterator = this.imports.keys();
if (
this.info.isEntry ||
this.includedDynamicImporters.length > 0 ||
@@ -344,46 +377,37 @@ export default class Module {
) {
dependencyVariables = new Set(dependencyVariables);
for (const exportName of [...this.getReexports(), ...this.getExports()]) {
- dependencyVariables.add(this.getVariableForExportName(exportName));
+ dependencyVariables.add(this.getVariableForExportName(exportName)!);
}
}
for (let variable of dependencyVariables) {
+ const sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable);
+ if (sideEffectDependencies) {
+ for (const module of sideEffectDependencies) {
+ alwaysCheckedDependencies.add(module);
+ }
+ }
if (variable instanceof SyntheticNamedExportVariable) {
variable = variable.getBaseVariable();
} else if (variable instanceof ExportDefaultVariable) {
- const { modules, original } = variable.getOriginalVariableAndDeclarationModules();
- variable = original;
- for (const module of modules) {
- additionalSideEffectModules.add(module);
- possibleDependencies.add(module);
- }
+ variable = variable.getOriginalVariable();
}
- relevantDependencies.add(variable.module!);
+ necessaryDependencies.add(variable.module!);
}
if (this.options.treeshake && this.info.hasModuleSideEffects !== 'no-treeshake') {
- for (const dependency of possibleDependencies) {
- if (
- !(
- dependency.info.hasModuleSideEffects ||
- additionalSideEffectModules.has(dependency as Module)
- ) ||
- relevantDependencies.has(dependency)
- ) {
- continue;
- }
- if (dependency instanceof ExternalModule || dependency.hasEffects()) {
- relevantDependencies.add(dependency);
- } else {
- for (const transitiveDependency of dependency.dependencies) {
- possibleDependencies.add(transitiveDependency);
- }
- }
- }
+ this.addRelevantSideEffectDependencies(
+ relevantDependencies,
+ necessaryDependencies,
+ alwaysCheckedDependencies
+ );
} else {
for (const dependency of this.dependencies) {
relevantDependencies.add(dependency);
}
}
+ for (const dependency of necessaryDependencies) {
+ relevantDependencies.add(dependency);
+ }
return (this.relevantDependencies = relevantDependencies);
}
@@ -462,31 +486,22 @@ export default class Module {
);
}
if (!this.syntheticNamespace) {
- return error({
- code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,
- id: this.id,
- message: `Module "${relativeId(
- this.id
- )}" that is marked with 'syntheticNamedExports: ${JSON.stringify(
- this.info.syntheticNamedExports
- )}' needs ${
- typeof this.info.syntheticNamedExports === 'string' &&
- this.info.syntheticNamedExports !== 'default'
- ? `an export named "${this.info.syntheticNamedExports}"`
- : 'a default export'
- }.`
- });
+ return error(
+ errSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports)
+ );
}
return this.syntheticNamespace;
}
getVariableForExportName(
name: string,
+ importerForSideEffects?: Module,
isExportAllSearch?: boolean,
searchedNamesAndModules?: Map>
- ): Variable {
+ ): Variable | null {
if (name[0] === '*') {
if (name.length === 1) {
+ // export * from './other'
return this.namespace;
} else {
// export * from 'external'
@@ -498,23 +513,24 @@ export default class Module {
// export { foo } from './other'
const reexportDeclaration = this.reexportDescriptions[name];
if (reexportDeclaration) {
- const declaration = getVariableForExportNameRecursive(
+ const variable = getVariableForExportNameRecursive(
reexportDeclaration.module,
reexportDeclaration.localName,
+ importerForSideEffects,
false,
searchedNamesAndModules
);
- if (!declaration) {
- return handleMissingExport(
- reexportDeclaration.localName,
- this,
- reexportDeclaration.module.id,
+ if (!variable) {
+ return this.error(
+ errMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id),
reexportDeclaration.start
);
}
-
- return declaration;
+ if (importerForSideEffects) {
+ setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
+ }
+ return variable;
}
const exportDeclaration = this.exports[name];
@@ -523,7 +539,16 @@ export default class Module {
return this.exportShimVariable;
}
const name = exportDeclaration.localName;
- return this.traceVariable(name)!;
+ const variable = this.traceVariable(name, importerForSideEffects)!;
+ if (importerForSideEffects) {
+ getOrCreate(
+ importerForSideEffects.sideEffectDependenciesByVariable,
+ variable,
+ () => new Set()
+ ).add(this);
+ setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
+ }
+ return variable;
}
if (name !== 'default') {
@@ -532,6 +557,7 @@ export default class Module {
const declaration = getVariableForExportNameRecursive(
module,
name,
+ importerForSideEffects,
true,
searchedNamesAndModules
);
@@ -573,7 +599,7 @@ export default class Module {
return this.exportShimVariable;
}
}
- return null as any;
+ return null;
}
hasEffects() {
@@ -596,21 +622,19 @@ export default class Module {
for (const exportName of this.getExports()) {
if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) {
- const variable = this.getVariableForExportName(exportName);
+ const variable = this.getVariableForExportName(exportName)!;
variable.deoptimizePath(UNKNOWN_PATH);
if (!variable.included) {
- variable.include();
- this.graph.needsTreeshakingPass = true;
+ this.includeVariable(variable);
}
}
}
for (const name of this.getReexports()) {
- const variable = this.getVariableForExportName(name);
+ const variable = this.getVariableForExportName(name)!;
variable.deoptimizePath(UNKNOWN_PATH);
if (!variable.included) {
- variable.include();
- this.graph.needsTreeshakingPass = true;
+ this.includeVariable(variable);
}
if (variable instanceof ExternalVariable) {
variable.module.reexported = true;
@@ -738,7 +762,7 @@ export default class Module {
importDescriptions: this.importDescriptions,
includeAllExports: () => this.includeAllExports(true),
includeDynamicImport: this.includeDynamicImport.bind(this),
- includeVariable: this.includeVariable.bind(this),
+ includeVariableInModule: this.includeVariableInModule.bind(this),
magicString: this.magicString,
module: this,
moduleContext: this.context,
@@ -778,7 +802,7 @@ export default class Module {
};
}
- traceVariable(name: string): Variable | null {
+ traceVariable(name: string, importerForSideEffects?: Module): Variable | null {
const localVariable = this.scope.variables.get(name);
if (localVariable) {
return localVariable;
@@ -792,13 +816,14 @@ export default class Module {
return otherModule.namespace;
}
- const declaration = otherModule.getVariableForExportName(importDeclaration.name);
+ const declaration = otherModule.getVariableForExportName(
+ importDeclaration.name,
+ importerForSideEffects || this
+ );
if (!declaration) {
- return handleMissingExport(
- importDeclaration.name,
- this,
- otherModule.id,
+ return this.error(
+ errMissingExport(importDeclaration.name, this.id, otherModule.id),
importDeclaration.start
);
}
@@ -971,6 +996,38 @@ export default class Module {
}
}
+ private addRelevantSideEffectDependencies(
+ relevantDependencies: Set,
+ necessaryDependencies: Set,
+ alwaysCheckedDependencies: Set
+ ) {
+ const handledDependencies = new Set();
+
+ const addSideEffectDependencies = (possibleDependencies: Set) => {
+ for (const dependency of possibleDependencies) {
+ if (handledDependencies.has(dependency)) {
+ continue;
+ }
+ handledDependencies.add(dependency);
+ if (necessaryDependencies.has(dependency)) {
+ relevantDependencies.add(dependency);
+ continue;
+ }
+ if (!(dependency.info.hasModuleSideEffects || alwaysCheckedDependencies.has(dependency))) {
+ continue;
+ }
+ if (dependency instanceof ExternalModule || dependency.hasEffects()) {
+ relevantDependencies.add(dependency);
+ continue;
+ }
+ addSideEffectDependencies(dependency.dependencies);
+ }
+ };
+
+ addSideEffectDependencies(this.dependencies);
+ addSideEffectDependencies(alwaysCheckedDependencies);
+ }
+
private includeAndGetAdditionalMergedNamespaces(): Variable[] {
const mergedNamespaces: Variable[] = [];
for (const module of this.exportAllModules) {
@@ -1000,11 +1057,27 @@ export default class Module {
}
private includeVariable(variable: Variable) {
- const variableModule = variable.module;
if (!variable.included) {
variable.include();
this.graph.needsTreeshakingPass = true;
+ const variableModule = variable.module;
+ if (variableModule && variableModule !== this && variableModule instanceof Module) {
+ if (!variableModule.isExecuted) {
+ markModuleAndImpureDependenciesAsExecuted(variableModule);
+ }
+ const sideEffectModules = getAndExtendSideEffectModules(variable, this);
+ for (const module of sideEffectModules) {
+ if (!module.isExecuted) {
+ markModuleAndImpureDependenciesAsExecuted(module);
+ }
+ }
+ }
}
+ }
+
+ private includeVariableInModule(variable: Variable) {
+ this.includeVariable(variable);
+ const variableModule = variable.module;
if (variableModule && variableModule !== this) {
this.imports.add(variable);
}
@@ -1020,3 +1093,21 @@ export default class Module {
this.exports[name] = MISSING_EXPORT_SHIM_DESCRIPTION;
}
}
+
+// if there is a cyclic import in the reexport chain, we should not
+// import from the original module but from the cyclic module to not
+// mess up execution order.
+function setAlternativeExporterIfCyclic(variable: Variable, importer: Module, reexporter: Module) {
+ if (variable.module instanceof Module && variable.module !== reexporter) {
+ const exporterCycles = variable.module.cycles;
+ if (exporterCycles.size > 0) {
+ const importerCycles = reexporter.cycles;
+ for (const cycleSymbol of importerCycles) {
+ if (exporterCycles.has(cycleSymbol)) {
+ importer.alternativeReexportModules.set(variable, reexporter);
+ break;
+ }
+ }
+ }
+ }
+}
diff --git a/src/ast/nodes/ExportDefaultDeclaration.ts b/src/ast/nodes/ExportDefaultDeclaration.ts
index 4055d7388..a2e365848 100644
--- a/src/ast/nodes/ExportDefaultDeclaration.ts
+++ b/src/ast/nodes/ExportDefaultDeclaration.ts
@@ -52,7 +52,7 @@ export default class ExportDefaultDeclaration extends NodeBase {
include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) {
super.include(context, includeChildrenRecursively);
if (includeChildrenRecursively) {
- this.context.includeVariable(this.variable);
+ this.context.includeVariableInModule(this.variable);
}
}
diff --git a/src/ast/nodes/Identifier.ts b/src/ast/nodes/Identifier.ts
index c2a8caa94..59ef41f2e 100644
--- a/src/ast/nodes/Identifier.ts
+++ b/src/ast/nodes/Identifier.ts
@@ -132,7 +132,7 @@ export default class Identifier extends NodeBase implements PatternNode {
if (!this.included) {
this.included = true;
if (this.variable !== null) {
- this.context.includeVariable(this.variable);
+ this.context.includeVariableInModule(this.variable);
}
}
}
diff --git a/src/ast/nodes/MemberExpression.ts b/src/ast/nodes/MemberExpression.ts
index 7377394a3..ba0235f55 100644
--- a/src/ast/nodes/MemberExpression.ts
+++ b/src/ast/nodes/MemberExpression.ts
@@ -216,7 +216,7 @@ export default class MemberExpression extends NodeBase implements DeoptimizableE
if (!this.included) {
this.included = true;
if (this.variable !== null) {
- this.context.includeVariable(this.variable);
+ this.context.includeVariableInModule(this.variable);
}
}
this.object.include(context, includeChildrenRecursively);
@@ -262,7 +262,7 @@ export default class MemberExpression extends NodeBase implements DeoptimizableE
const variable = this.scope.findVariable(this.object.name);
if (variable.isNamespace) {
if (this.variable) {
- this.context.includeVariable(this.variable);
+ this.context.includeVariableInModule(this.variable);
}
this.context.warn(
{
diff --git a/src/ast/variables/ExportDefaultVariable.ts b/src/ast/variables/ExportDefaultVariable.ts
index 30d3a24b5..3a9fbcbfd 100644
--- a/src/ast/variables/ExportDefaultVariable.ts
+++ b/src/ast/variables/ExportDefaultVariable.ts
@@ -1,4 +1,4 @@
-import Module, { AstContext } from '../../Module';
+import { AstContext } from '../../Module';
import ClassDeclaration from '../nodes/ClassDeclaration';
import ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration';
import FunctionDeclaration from '../nodes/FunctionDeclaration';
@@ -10,12 +10,8 @@ import Variable from './Variable';
export default class ExportDefaultVariable extends LocalVariable {
hasId = false;
- // Not initialised during construction
private originalId: IdentifierWithVariable | null = null;
- private originalVariableAndDeclarationModules: {
- modules: Module[];
- original: Variable;
- } | null = null;
+ private originalVariable: Variable | null = null;
constructor(
name: string,
@@ -54,6 +50,17 @@ export default class ExportDefaultVariable extends LocalVariable {
}
}
+ getDirectOriginalVariable(): Variable | null {
+ return this.originalId &&
+ (this.hasId ||
+ !(
+ this.originalId.variable.isReassigned ||
+ this.originalId.variable instanceof UndefinedVariable
+ ))
+ ? this.originalId.variable
+ : null;
+ }
+
getName() {
const original = this.getOriginalVariable();
if (original === this) {
@@ -64,34 +71,15 @@ export default class ExportDefaultVariable extends LocalVariable {
}
getOriginalVariable(): Variable {
- return this.getOriginalVariableAndDeclarationModules().original;
- }
-
- getOriginalVariableAndDeclarationModules(): { modules: Module[]; original: Variable } {
- if (this.originalVariableAndDeclarationModules === null) {
- if (
- !this.originalId ||
- (!this.hasId &&
- (this.originalId.variable.isReassigned ||
- this.originalId.variable instanceof UndefinedVariable))
- ) {
- this.originalVariableAndDeclarationModules = { modules: [], original: this };
- } else {
- const assignedOriginal = this.originalId.variable;
- if (assignedOriginal instanceof ExportDefaultVariable) {
- const { modules, original } = assignedOriginal.getOriginalVariableAndDeclarationModules();
- this.originalVariableAndDeclarationModules = {
- modules: modules.concat(this.module),
- original
- };
- } else {
- this.originalVariableAndDeclarationModules = {
- modules: [this.module],
- original: assignedOriginal
- };
- }
- }
- }
- return this.originalVariableAndDeclarationModules;
+ if (this.originalVariable) return this.originalVariable;
+ let original: Variable | null = this;
+ let currentVariable: Variable;
+ const checkedVariables = new Set();
+ do {
+ checkedVariables.add(original);
+ currentVariable = original;
+ original = (currentVariable as ExportDefaultVariable).getDirectOriginalVariable();
+ } while (original instanceof ExportDefaultVariable && !checkedVariables.has(original));
+ return (this.originalVariable = original || currentVariable);
}
}
diff --git a/src/ast/variables/LocalVariable.ts b/src/ast/variables/LocalVariable.ts
index af25592ce..3dd5502af 100644
--- a/src/ast/variables/LocalVariable.ts
+++ b/src/ast/variables/LocalVariable.ts
@@ -1,5 +1,4 @@
import Module, { AstContext } from '../../Module';
-import { markModuleAndImpureDependenciesAsExecuted } from '../../utils/traverseStaticDependencies';
import { CallOptions } from '../CallOptions';
import { DeoptimizableEntity } from '../DeoptimizableEntity';
import { createInclusionContext, HasEffectsContext, InclusionContext } from '../ExecutionContext';
@@ -159,9 +158,6 @@ export default class LocalVariable extends Variable {
include() {
if (!this.included) {
this.included = true;
- if (!this.module.isExecuted) {
- markModuleAndImpureDependenciesAsExecuted(this.module);
- }
for (const declaration of this.declarations) {
// If node is a default export, it can save a tree-shaking run to include the full declaration now
if (!declaration.included) declaration.include(createInclusionContext(), false);
diff --git a/src/ast/variables/SyntheticNamedExportVariable.ts b/src/ast/variables/SyntheticNamedExportVariable.ts
index 2eb29c747..898f9219c 100644
--- a/src/ast/variables/SyntheticNamedExportVariable.ts
+++ b/src/ast/variables/SyntheticNamedExportVariable.ts
@@ -1,4 +1,5 @@
import Module, { AstContext } from '../../Module';
+import { error, errSyntheticNamedExportsNeedNamespaceExport } from '../../utils/error';
import { RESERVED_NAMES } from '../../utils/reservedNames';
import ExportDefaultVariable from './ExportDefaultVariable';
import Variable from './Variable';
@@ -8,6 +9,8 @@ export default class SyntheticNamedExportVariable extends Variable {
module: Module;
syntheticNamespace: Variable;
+ private baseVariable: Variable | null = null;
+
constructor(context: AstContext, name: string, syntheticNamespace: Variable) {
super(name);
this.context = context;
@@ -16,14 +19,32 @@ export default class SyntheticNamedExportVariable extends Variable {
}
getBaseVariable(): Variable {
+ if (this.baseVariable) return this.baseVariable;
let baseVariable = this.syntheticNamespace;
- if (baseVariable instanceof ExportDefaultVariable) {
- baseVariable = baseVariable.getOriginalVariable();
- }
- if (baseVariable instanceof SyntheticNamedExportVariable) {
- baseVariable = baseVariable.getBaseVariable();
+ const checkedVariables = new Set();
+ while (
+ baseVariable instanceof ExportDefaultVariable ||
+ baseVariable instanceof SyntheticNamedExportVariable
+ ) {
+ checkedVariables.add(baseVariable);
+ if (baseVariable instanceof ExportDefaultVariable) {
+ const original = baseVariable.getOriginalVariable();
+ if (original === baseVariable) break;
+ baseVariable = original;
+ }
+ if (baseVariable instanceof SyntheticNamedExportVariable) {
+ baseVariable = baseVariable.syntheticNamespace;
+ }
+ if (checkedVariables.has(baseVariable)) {
+ return error(
+ errSyntheticNamedExportsNeedNamespaceExport(
+ this.module.id,
+ this.module.info.syntheticNamedExports
+ )
+ );
+ }
}
- return baseVariable;
+ return (this.baseVariable = baseVariable);
}
getBaseVariableName(): string {
@@ -38,7 +59,7 @@ export default class SyntheticNamedExportVariable extends Variable {
include() {
if (!this.included) {
this.included = true;
- this.context.includeVariable(this.syntheticNamespace);
+ this.context.includeVariableInModule(this.syntheticNamespace);
}
}
diff --git a/src/utils/error.ts b/src/utils/error.ts
index 714771591..f4066823a 100644
--- a/src/utils/error.ts
+++ b/src/utils/error.ts
@@ -36,7 +36,7 @@ export function augmentCodeLocation(
}
}
-export enum Errors {
+export const enum Errors {
ALREADY_CLOSED = 'ALREADY_CLOSED',
ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED',
ASSET_NOT_FOUND = 'ASSET_NOT_FOUND',
@@ -45,6 +45,8 @@ export enum Errors {
BAD_LOADER = 'BAD_LOADER',
CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK',
CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED',
+ CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT',
+ CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT',
DEPRECATED_FEATURE = 'DEPRECATED_FEATURE',
EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS',
FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT',
@@ -56,6 +58,7 @@ export enum Errors {
INVALID_OPTION = 'INVALID_OPTION',
INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK',
INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE',
+ MISSING_EXPORT = 'MISSING_EXPORT',
MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT',
MIXED_EXPORTS = 'MIXED_EXPORTS',
NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT',
@@ -90,6 +93,37 @@ export function errChunkNotGeneratedForFileName(name: string) {
};
}
+export function errCircularReexport(exportName: string, importedModule: string) {
+ return {
+ code: Errors.CIRCULAR_REEXPORT,
+ id: importedModule,
+ message: `"${exportName}" cannot be exported from ${relativeId(
+ importedModule
+ )} as it is a reexport that references itself.`
+ };
+}
+
+export function errCyclicCrossChunkReexport(
+ exportName: string,
+ exporter: string,
+ reexporter: string,
+ importer: string
+): RollupWarning {
+ return {
+ code: Errors.CYCLIC_CROSS_CHUNK_REEXPORT,
+ exporter,
+ importer,
+ message: `Export "${exportName}" of module ${relativeId(
+ exporter
+ )} was reexported through module ${relativeId(
+ reexporter
+ )} while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in ${relativeId(
+ importer
+ )} to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.`,
+ reexporter
+ };
+}
+
export function errAssetReferenceIdNotFoundForSetSource(assetReferenceId: string) {
return {
code: Errors.ASSET_NOT_FOUND,
@@ -212,6 +246,20 @@ export function errInvalidRollupPhaseForChunkEmission() {
};
}
+export function errMissingExport(
+ exportName: string,
+ importingModule: string,
+ importedModule: string
+) {
+ return {
+ code: Errors.MISSING_EXPORT,
+ message: `'${exportName}' is not exported by ${relativeId(
+ importedModule
+ )}, imported by ${relativeId(importingModule)}`,
+ url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`
+ };
+}
+
export function errImplicitDependantCannotBeExternal(
unresolvedId: string,
implicitlyLoadedBefore: string
@@ -306,6 +354,25 @@ export function errPreferNamedExports(facadeModuleId: string) {
};
}
+export function errSyntheticNamedExportsNeedNamespaceExport(
+ id: string,
+ syntheticNamedExportsOption: boolean | string
+) {
+ return {
+ code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,
+ id,
+ message: `Module "${relativeId(
+ id
+ )}" that is marked with 'syntheticNamedExports: ${JSON.stringify(
+ syntheticNamedExportsOption
+ )}' needs ${
+ typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'
+ ? `an export named "${syntheticNamedExportsOption}"`
+ : 'a default export'
+ } that does not reexport an unresolved named export of the same module.`
+ };
+}
+
export function errUnexpectedNamedImport(id: string, imported: string, isReexport: boolean) {
const importType = isReexport ? 'reexport' : 'import';
return {
diff --git a/src/utils/executionOrder.ts b/src/utils/executionOrder.ts
index a86993d2c..638971a61 100644
--- a/src/utils/executionOrder.ts
+++ b/src/utils/executionOrder.ts
@@ -26,7 +26,7 @@ export function analyseModuleExecution(entryModules: Module[]) {
for (const dependency of module.dependencies) {
if (parents.has(dependency)) {
if (!analysedModules.has(dependency)) {
- cyclePaths.push(getCyclePath(dependency, module, parents));
+ cyclePaths.push(getCyclePath(dependency as Module, module, parents));
}
continue;
}
@@ -66,13 +66,16 @@ export function analyseModuleExecution(entryModules: Module[]) {
}
function getCyclePath(
- module: Module | ExternalModule,
+ module: Module,
parent: Module,
parents: Map
) {
+ const cycleSymbol = Symbol(module.id);
const path = [relativeId(module.id)];
let nextModule = parent;
+ module.cycles.add(cycleSymbol);
while (nextModule !== module) {
+ nextModule.cycles.add(cycleSymbol);
path.push(relativeId(nextModule.id));
nextModule = parents.get(nextModule)!;
}
diff --git a/src/utils/getStaticDependencies.ts b/src/utils/getStaticDependencies.ts
new file mode 100644
index 000000000..5d3a447c9
--- /dev/null
+++ b/src/utils/getStaticDependencies.ts
@@ -0,0 +1,52 @@
+import Chunk from '../Chunk';
+import ExternalModule from '../ExternalModule';
+import Module from '../Module';
+
+export function getStaticDependencies(
+ chunk: Chunk,
+ orderedModules: Module[],
+ chunkByModule: Map
+): Set {
+ const staticDependencyBlocks: (Chunk | ExternalModule)[][] = [];
+ const handledDependencies = new Set();
+ for (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) {
+ const module = orderedModules[modulePos];
+ if (!handledDependencies.has(module)) {
+ const staticDependencies: (Chunk | ExternalModule)[] = [];
+ addStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule);
+ staticDependencyBlocks.unshift(staticDependencies);
+ }
+ }
+ const dependencies = new Set();
+ for (const block of staticDependencyBlocks) {
+ for (const dependency of block) {
+ dependencies.add(dependency);
+ }
+ }
+ return dependencies;
+}
+
+function addStaticDependencies(
+ module: Module,
+ staticDependencies: (Chunk | ExternalModule)[],
+ handledModules: Set,
+ chunk: Chunk,
+ chunkByModule: Map
+): void {
+ const dependencies = module.getDependenciesToBeIncluded();
+ for (const dependency of dependencies) {
+ if (dependency instanceof ExternalModule) {
+ staticDependencies.push(dependency);
+ continue;
+ }
+ const dependencyChunk = chunkByModule.get(dependency)!;
+ if (dependencyChunk !== chunk) {
+ staticDependencies.push(dependencyChunk);
+ continue;
+ }
+ if (!handledModules.has(dependency)) {
+ handledModules.add(dependency);
+ addStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule);
+ }
+ }
+}
diff --git a/src/utils/options/normalizeInputOptions.ts b/src/utils/options/normalizeInputOptions.ts
index 8ed07c0ca..25526d58b 100644
--- a/src/utils/options/normalizeInputOptions.ts
+++ b/src/utils/options/normalizeInputOptions.ts
@@ -1,5 +1,4 @@
import injectClassFields from 'acorn-class-fields';
-import injectNumericSeparator from 'acorn-numeric-separator';
import injectStaticClassFeatures from 'acorn-static-class-features';
import {
ExternalOption,
@@ -101,7 +100,6 @@ const getAcorn = (config: GenericConfigObject): acorn.Options => ({
const getAcornInjectPlugins = (config: GenericConfigObject): Function[] => [
injectClassFields,
injectStaticClassFeatures,
- injectNumericSeparator,
...(ensureArray(config.acornInjectPlugins) as any)
];
diff --git a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main1.js b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main1.js
index 6db24f20d..5569e16d8 100644
--- a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main1.js
+++ b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main1.js
@@ -1,4 +1,4 @@
-define(['./generated-dep1', './generated-shared2', './generated-dep2'], function (dep1, shared2, dep2) { 'use strict';
+define(['./generated-shared2', './generated-dep1', './generated-dep2'], function (shared2, dep1, dep2) { 'use strict';
console.log(shared2.x + shared2.y);
diff --git a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main2.js b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main2.js
index 2d15ef40f..6820cdc52 100644
--- a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main2.js
+++ b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main2.js
@@ -1,4 +1,4 @@
-define(['./generated-dep1', './generated-shared2', './generated-dep2'], function (dep1, shared2, dep2) { 'use strict';
+define(['./generated-shared2', './generated-dep1', './generated-dep2'], function (shared2, dep1, dep2) { 'use strict';
diff --git a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main1.js b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main1.js
index e1b073c3c..e7c819ca8 100644
--- a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main1.js
+++ b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main1.js
@@ -1,7 +1,7 @@
'use strict';
-require('./generated-dep1.js');
var shared2 = require('./generated-shared2.js');
+require('./generated-dep1.js');
require('./generated-dep2.js');
console.log(shared2.x + shared2.y);
diff --git a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main2.js b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main2.js
index 291f1954f..3a2eedeb3 100644
--- a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main2.js
+++ b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main2.js
@@ -1,6 +1,6 @@
'use strict';
-require('./generated-dep1.js');
require('./generated-shared2.js');
+require('./generated-dep1.js');
require('./generated-dep2.js');
diff --git a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main1.js b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main1.js
index df90cab25..4ecb37937 100644
--- a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main1.js
+++ b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main1.js
@@ -1,5 +1,5 @@
-import './generated-dep1.js';
import { x, y } from './generated-shared2.js';
+import './generated-dep1.js';
import './generated-dep2.js';
console.log(x + y);
diff --git a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main2.js b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main2.js
index 09d607653..ad419134b 100644
--- a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main2.js
+++ b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main2.js
@@ -1,3 +1,3 @@
-import './generated-dep1.js';
import './generated-shared2.js';
+import './generated-dep1.js';
import './generated-dep2.js';
diff --git a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main1.js b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main1.js
index e1227b604..e0735768b 100644
--- a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main1.js
+++ b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main1.js
@@ -1,11 +1,11 @@
-System.register(['./generated-dep1.js', './generated-shared2.js', './generated-dep2.js'], function () {
+System.register(['./generated-shared2.js', './generated-dep1.js', './generated-dep2.js'], function () {
'use strict';
var x, y;
return {
- setters: [function () {}, function (module) {
+ setters: [function (module) {
x = module.x;
y = module.y;
- }, function () {}],
+ }, function () {}, function () {}],
execute: function () {
console.log(x + y);
diff --git a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main2.js b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main2.js
index 4b34c3377..b37f5d5a8 100644
--- a/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main2.js
+++ b/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main2.js
@@ -1,4 +1,4 @@
-System.register(['./generated-dep1.js', './generated-shared2.js', './generated-dep2.js'], function () {
+System.register(['./generated-shared2.js', './generated-dep1.js', './generated-dep2.js'], function () {
'use strict';
return {
setters: [function () {}, function () {}, function () {}],
diff --git a/test/chunking-form/samples/chunk-execution-order/_expected/amd/main1.js b/test/chunking-form/samples/chunk-execution-order/_expected/amd/main1.js
index 111e385a3..ae3cc192d 100644
--- a/test/chunking-form/samples/chunk-execution-order/_expected/amd/main1.js
+++ b/test/chunking-form/samples/chunk-execution-order/_expected/amd/main1.js
@@ -1,4 +1,4 @@
-define(['./generated-dep111', './generated-dep112', './generated-dep11'], function (dep111, dep112, dep11) { 'use strict';
+define(['./generated-dep11', './generated-dep112', './generated-dep111'], function (dep11, dep112, dep111) { 'use strict';
console.log('1');
diff --git a/test/chunking-form/samples/chunk-execution-order/_expected/amd/main2.js b/test/chunking-form/samples/chunk-execution-order/_expected/amd/main2.js
index b4448a037..39a25a820 100644
--- a/test/chunking-form/samples/chunk-execution-order/_expected/amd/main2.js
+++ b/test/chunking-form/samples/chunk-execution-order/_expected/amd/main2.js
@@ -1,4 +1,4 @@
-define(['./generated-dep111', './generated-dep112', './generated-dep11'], function (dep111, dep112, dep11) { 'use strict';
+define(['./generated-dep11', './generated-dep111', './generated-dep112'], function (dep11, dep111, dep112) { 'use strict';
diff --git a/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main1.js b/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main1.js
index 5cb69cbe4..e61cfc76e 100644
--- a/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main1.js
+++ b/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main1.js
@@ -1,8 +1,8 @@
'use strict';
-require('./generated-dep111.js');
-var dep112 = require('./generated-dep112.js');
require('./generated-dep11.js');
+var dep112 = require('./generated-dep112.js');
+require('./generated-dep111.js');
console.log('1');
diff --git a/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main2.js b/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main2.js
index d68bb5324..7bcc0f1f5 100644
--- a/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main2.js
+++ b/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main2.js
@@ -1,6 +1,6 @@
'use strict';
+require('./generated-dep11.js');
require('./generated-dep111.js');
require('./generated-dep112.js');
-require('./generated-dep11.js');
diff --git a/test/chunking-form/samples/chunk-execution-order/_expected/es/main1.js b/test/chunking-form/samples/chunk-execution-order/_expected/es/main1.js
index fec6c0083..8ccac0f4e 100644
--- a/test/chunking-form/samples/chunk-execution-order/_expected/es/main1.js
+++ b/test/chunking-form/samples/chunk-execution-order/_expected/es/main1.js
@@ -1,6 +1,6 @@
-import './generated-dep111.js';
-import { x } from './generated-dep112.js';
import './generated-dep11.js';
+import { x } from './generated-dep112.js';
+import './generated-dep111.js';
console.log('1');
diff --git a/test/chunking-form/samples/chunk-execution-order/_expected/es/main2.js b/test/chunking-form/samples/chunk-execution-order/_expected/es/main2.js
index f7b18be42..85ab1d519 100644
--- a/test/chunking-form/samples/chunk-execution-order/_expected/es/main2.js
+++ b/test/chunking-form/samples/chunk-execution-order/_expected/es/main2.js
@@ -1,3 +1,3 @@
+import './generated-dep11.js';
import './generated-dep111.js';
import './generated-dep112.js';
-import './generated-dep11.js';
diff --git a/test/chunking-form/samples/chunk-execution-order/_expected/system/main1.js b/test/chunking-form/samples/chunk-execution-order/_expected/system/main1.js
index 8987e5bcd..faf8082f0 100644
--- a/test/chunking-form/samples/chunk-execution-order/_expected/system/main1.js
+++ b/test/chunking-form/samples/chunk-execution-order/_expected/system/main1.js
@@ -1,4 +1,4 @@
-System.register(['./generated-dep111.js', './generated-dep112.js', './generated-dep11.js'], function () {
+System.register(['./generated-dep11.js', './generated-dep112.js', './generated-dep111.js'], function () {
'use strict';
var x;
return {
diff --git a/test/chunking-form/samples/chunk-execution-order/_expected/system/main2.js b/test/chunking-form/samples/chunk-execution-order/_expected/system/main2.js
index 58cd5cb31..ce4453cda 100644
--- a/test/chunking-form/samples/chunk-execution-order/_expected/system/main2.js
+++ b/test/chunking-form/samples/chunk-execution-order/_expected/system/main2.js
@@ -1,4 +1,4 @@
-System.register(['./generated-dep111.js', './generated-dep112.js', './generated-dep11.js'], function () {
+System.register(['./generated-dep11.js', './generated-dep111.js', './generated-dep112.js'], function () {
'use strict';
return {
setters: [function () {}, function () {}, function () {}],
diff --git a/test/chunking-form/samples/chunk-execution-order/dep11.js b/test/chunking-form/samples/chunk-execution-order/dep11.js
index 97363e726..73087a34a 100644
--- a/test/chunking-form/samples/chunk-execution-order/dep11.js
+++ b/test/chunking-form/samples/chunk-execution-order/dep11.js
@@ -1,3 +1,3 @@
-import './dep111';
+import './dep111.js';
export { x } from './dep112.js';
console.log('11');
diff --git a/test/chunking-form/samples/chunking-reexport/_expected/amd/main1.js b/test/chunking-form/samples/chunking-reexport/_expected/amd/main1.js
index b6fd81282..01e41b3d0 100644
--- a/test/chunking-form/samples/chunking-reexport/_expected/amd/main1.js
+++ b/test/chunking-form/samples/chunking-reexport/_expected/amd/main1.js
@@ -1,4 +1,4 @@
-define(['exports', 'external', './generated-dep'], function (exports, external, dep) { 'use strict';
+define(['exports', './generated-dep', 'external'], function (exports, dep, external) { 'use strict';
diff --git a/test/chunking-form/samples/chunking-reexport/_expected/amd/main2.js b/test/chunking-form/samples/chunking-reexport/_expected/amd/main2.js
index b6fd81282..01e41b3d0 100644
--- a/test/chunking-form/samples/chunking-reexport/_expected/amd/main2.js
+++ b/test/chunking-form/samples/chunking-reexport/_expected/amd/main2.js
@@ -1,4 +1,4 @@
-define(['exports', 'external', './generated-dep'], function (exports, external, dep) { 'use strict';
+define(['exports', './generated-dep', 'external'], function (exports, dep, external) { 'use strict';
diff --git a/test/chunking-form/samples/chunking-reexport/_expected/cjs/main1.js b/test/chunking-form/samples/chunking-reexport/_expected/cjs/main1.js
index 62208a321..c12bad537 100644
--- a/test/chunking-form/samples/chunking-reexport/_expected/cjs/main1.js
+++ b/test/chunking-form/samples/chunking-reexport/_expected/cjs/main1.js
@@ -2,8 +2,8 @@
Object.defineProperty(exports, '__esModule', { value: true });
-var external = require('external');
require('./generated-dep.js');
+var external = require('external');
diff --git a/test/chunking-form/samples/chunking-reexport/_expected/cjs/main2.js b/test/chunking-form/samples/chunking-reexport/_expected/cjs/main2.js
index 62208a321..c12bad537 100644
--- a/test/chunking-form/samples/chunking-reexport/_expected/cjs/main2.js
+++ b/test/chunking-form/samples/chunking-reexport/_expected/cjs/main2.js
@@ -2,8 +2,8 @@
Object.defineProperty(exports, '__esModule', { value: true });
-var external = require('external');
require('./generated-dep.js');
+var external = require('external');
diff --git a/test/chunking-form/samples/chunking-reexport/_expected/es/main1.js b/test/chunking-form/samples/chunking-reexport/_expected/es/main1.js
index 1fed25e31..d751b5a17 100644
--- a/test/chunking-form/samples/chunking-reexport/_expected/es/main1.js
+++ b/test/chunking-form/samples/chunking-reexport/_expected/es/main1.js
@@ -1,2 +1,2 @@
-export { asdf as dep } from 'external';
import './generated-dep.js';
+export { asdf as dep } from 'external';
diff --git a/test/chunking-form/samples/chunking-reexport/_expected/es/main2.js b/test/chunking-form/samples/chunking-reexport/_expected/es/main2.js
index 1fed25e31..d751b5a17 100644
--- a/test/chunking-form/samples/chunking-reexport/_expected/es/main2.js
+++ b/test/chunking-form/samples/chunking-reexport/_expected/es/main2.js
@@ -1,2 +1,2 @@
-export { asdf as dep } from 'external';
import './generated-dep.js';
+export { asdf as dep } from 'external';
diff --git a/test/chunking-form/samples/chunking-reexport/_expected/system/main1.js b/test/chunking-form/samples/chunking-reexport/_expected/system/main1.js
index 06b06689d..91fd83990 100644
--- a/test/chunking-form/samples/chunking-reexport/_expected/system/main1.js
+++ b/test/chunking-form/samples/chunking-reexport/_expected/system/main1.js
@@ -1,9 +1,9 @@
-System.register(['external', './generated-dep.js'], function (exports) {
+System.register(['./generated-dep.js', 'external'], function (exports) {
'use strict';
return {
- setters: [function (module) {
+ setters: [function () {}, function (module) {
exports('dep', module.asdf);
- }, function () {}],
+ }],
execute: function () {
diff --git a/test/chunking-form/samples/chunking-reexport/_expected/system/main2.js b/test/chunking-form/samples/chunking-reexport/_expected/system/main2.js
index 06b06689d..91fd83990 100644
--- a/test/chunking-form/samples/chunking-reexport/_expected/system/main2.js
+++ b/test/chunking-form/samples/chunking-reexport/_expected/system/main2.js
@@ -1,9 +1,9 @@
-System.register(['external', './generated-dep.js'], function (exports) {
+System.register(['./generated-dep.js', 'external'], function (exports) {
'use strict';
return {
- setters: [function (module) {
+ setters: [function () {}, function (module) {
exports('dep', module.asdf);
- }, function () {}],
+ }],
execute: function () {
diff --git a/test/chunking-form/samples/chunking-star-external/_expected/amd/main1.js b/test/chunking-form/samples/chunking-star-external/_expected/amd/main1.js
index 1422f08ba..2c2790882 100644
--- a/test/chunking-form/samples/chunking-star-external/_expected/amd/main1.js
+++ b/test/chunking-form/samples/chunking-star-external/_expected/amd/main1.js
@@ -1,4 +1,4 @@
-define(['exports', 'starexternal1', 'external1', 'starexternal2', 'external2', './generated-dep'], function (exports, starexternal1, external1, starexternal2, external2, dep) { 'use strict';
+define(['exports', 'starexternal1', 'external1', './generated-dep', 'starexternal2', 'external2'], function (exports, starexternal1, external1, dep, starexternal2, external2) { 'use strict';
var main = '1';
diff --git a/test/chunking-form/samples/chunking-star-external/_expected/amd/main2.js b/test/chunking-form/samples/chunking-star-external/_expected/amd/main2.js
index acee5c294..95cba85b8 100644
--- a/test/chunking-form/samples/chunking-star-external/_expected/amd/main2.js
+++ b/test/chunking-form/samples/chunking-star-external/_expected/amd/main2.js
@@ -1,4 +1,4 @@
-define(['exports', 'starexternal2', 'external2', './generated-dep'], function (exports, starexternal2, external2, dep) { 'use strict';
+define(['exports', './generated-dep', 'external2', 'starexternal2'], function (exports, dep, external2, starexternal2) { 'use strict';
var main = '2';
@@ -10,13 +10,13 @@ define(['exports', 'starexternal2', 'external2', './generated-dep'], function (e
}
});
});
+ exports.dep = dep.dep;
Object.defineProperty(exports, 'e', {
enumerable: true,
get: function () {
return external2.e;
}
});
- exports.dep = dep.dep;
exports.main = main;
Object.defineProperty(exports, '__esModule', { value: true });
diff --git a/test/chunking-form/samples/chunking-star-external/_expected/cjs/main1.js b/test/chunking-form/samples/chunking-star-external/_expected/cjs/main1.js
index 762a44d3e..ef847f28b 100644
--- a/test/chunking-form/samples/chunking-star-external/_expected/cjs/main1.js
+++ b/test/chunking-form/samples/chunking-star-external/_expected/cjs/main1.js
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
var starexternal1 = require('starexternal1');
var external1 = require('external1');
+var dep = require('./generated-dep.js');
require('starexternal2');
require('external2');
-var dep = require('./generated-dep.js');
var main = '1';
diff --git a/test/chunking-form/samples/chunking-star-external/_expected/cjs/main2.js b/test/chunking-form/samples/chunking-star-external/_expected/cjs/main2.js
index d3309a999..5da3f44cc 100644
--- a/test/chunking-form/samples/chunking-star-external/_expected/cjs/main2.js
+++ b/test/chunking-form/samples/chunking-star-external/_expected/cjs/main2.js
@@ -2,9 +2,9 @@
Object.defineProperty(exports, '__esModule', { value: true });
-var starexternal2 = require('starexternal2');
-var external2 = require('external2');
var dep = require('./generated-dep.js');
+var external2 = require('external2');
+var starexternal2 = require('starexternal2');
var main = '2';
@@ -16,11 +16,11 @@ Object.keys(starexternal2).forEach(function (k) {
}
});
});
+exports.dep = dep.dep;
Object.defineProperty(exports, 'e', {
enumerable: true,
get: function () {
return external2.e;
}
});
-exports.dep = dep.dep;
exports.main = main;
diff --git a/test/chunking-form/samples/chunking-star-external/_expected/es/main1.js b/test/chunking-form/samples/chunking-star-external/_expected/es/main1.js
index 9f996c199..eee6367bb 100644
--- a/test/chunking-form/samples/chunking-star-external/_expected/es/main1.js
+++ b/test/chunking-form/samples/chunking-star-external/_expected/es/main1.js
@@ -1,8 +1,8 @@
export * from 'starexternal1';
export { e } from 'external1';
+export { d as dep } from './generated-dep.js';
import 'starexternal2';
import 'external2';
-export { d as dep } from './generated-dep.js';
var main = '1';
diff --git a/test/chunking-form/samples/chunking-star-external/_expected/es/main2.js b/test/chunking-form/samples/chunking-star-external/_expected/es/main2.js
index 20781a113..50f4537ad 100644
--- a/test/chunking-form/samples/chunking-star-external/_expected/es/main2.js
+++ b/test/chunking-form/samples/chunking-star-external/_expected/es/main2.js
@@ -1,6 +1,6 @@
-export * from 'starexternal2';
-export { e } from 'external2';
export { d as dep } from './generated-dep.js';
+export { e } from 'external2';
+export * from 'starexternal2';
var main = '2';
diff --git a/test/chunking-form/samples/chunking-star-external/_expected/system/main1.js b/test/chunking-form/samples/chunking-star-external/_expected/system/main1.js
index ae0521bfa..bad9531bb 100644
--- a/test/chunking-form/samples/chunking-star-external/_expected/system/main1.js
+++ b/test/chunking-form/samples/chunking-star-external/_expected/system/main1.js
@@ -1,4 +1,4 @@
-System.register(['starexternal1', 'external1', 'starexternal2', 'external2', './generated-dep.js'], function (exports) {
+System.register(['starexternal1', 'external1', './generated-dep.js', 'starexternal2', 'external2'], function (exports) {
'use strict';
var _starExcludes = { main: 1, default: 1, e: 1, dep: 1 };
return {
@@ -10,9 +10,9 @@ System.register(['starexternal1', 'external1', 'starexternal2', 'external2', './
exports(_setter);
}, function (module) {
exports('e', module.e);
- }, function () {}, function () {}, function (module) {
+ }, function (module) {
exports('dep', module.d);
- }],
+ }, function () {}, function () {}],
execute: function () {
var main = exports('main', '1');
diff --git a/test/chunking-form/samples/chunking-star-external/_expected/system/main2.js b/test/chunking-form/samples/chunking-star-external/_expected/system/main2.js
index b98ca0ce7..91b5984d5 100644
--- a/test/chunking-form/samples/chunking-star-external/_expected/system/main2.js
+++ b/test/chunking-form/samples/chunking-star-external/_expected/system/main2.js
@@ -1,17 +1,17 @@
-System.register(['starexternal2', 'external2', './generated-dep.js'], function (exports) {
+System.register(['./generated-dep.js', 'external2', 'starexternal2'], function (exports) {
'use strict';
- var _starExcludes = { main: 1, default: 1, e: 1, dep: 1 };
+ var _starExcludes = { main: 1, default: 1, dep: 1, e: 1 };
return {
setters: [function (module) {
+ exports('dep', module.d);
+ }, function (module) {
+ exports('e', module.e);
+ }, function (module) {
var _setter = {};
for (var _$p in module) {
if (!_starExcludes[_$p]) _setter[_$p] = module[_$p];
}
exports(_setter);
- }, function (module) {
- exports('e', module.e);
- }, function (module) {
- exports('dep', module.d);
}],
execute: function () {
diff --git a/test/chunking-form/samples/circular-manual-chunks/_expected/amd/main.js b/test/chunking-form/samples/circular-manual-chunks/_expected/amd/main.js
index 7c53593aa..bb9152d6a 100644
--- a/test/chunking-form/samples/circular-manual-chunks/_expected/amd/main.js
+++ b/test/chunking-form/samples/circular-manual-chunks/_expected/amd/main.js
@@ -1,4 +1,4 @@
-define(['exports', './generated-lib2', './generated-lib1'], function (exports, lib2, lib1) { 'use strict';
+define(['exports', './generated-lib1', './generated-lib2'], function (exports, lib1, lib2) { 'use strict';
diff --git a/test/chunking-form/samples/circular-manual-chunks/_expected/cjs/main.js b/test/chunking-form/samples/circular-manual-chunks/_expected/cjs/main.js
index 7a6f3d231..8ca369a5e 100644
--- a/test/chunking-form/samples/circular-manual-chunks/_expected/cjs/main.js
+++ b/test/chunking-form/samples/circular-manual-chunks/_expected/cjs/main.js
@@ -2,8 +2,8 @@
Object.defineProperty(exports, '__esModule', { value: true });
-require('./generated-lib2.js');
var lib1 = require('./generated-lib1.js');
+require('./generated-lib2.js');
diff --git a/test/chunking-form/samples/circular-manual-chunks/_expected/es/main.js b/test/chunking-form/samples/circular-manual-chunks/_expected/es/main.js
index 160cdb23d..93f53841e 100644
--- a/test/chunking-form/samples/circular-manual-chunks/_expected/es/main.js
+++ b/test/chunking-form/samples/circular-manual-chunks/_expected/es/main.js
@@ -1,2 +1,2 @@
-import './generated-lib2.js';
export { l as lib1 } from './generated-lib1.js';
+import './generated-lib2.js';
diff --git a/test/chunking-form/samples/circular-manual-chunks/_expected/system/main.js b/test/chunking-form/samples/circular-manual-chunks/_expected/system/main.js
index cfb378bc4..2bbc4fab8 100644
--- a/test/chunking-form/samples/circular-manual-chunks/_expected/system/main.js
+++ b/test/chunking-form/samples/circular-manual-chunks/_expected/system/main.js
@@ -1,9 +1,9 @@
-System.register(['./generated-lib2.js', './generated-lib1.js'], function (exports) {
+System.register(['./generated-lib1.js', './generated-lib2.js'], function (exports) {
'use strict';
return {
- setters: [function () {}, function (module) {
+ setters: [function (module) {
exports('lib1', module.l);
- }],
+ }, function () {}],
execute: function () {
diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/main.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/main.js
index 7c53593aa..bb9152d6a 100644
--- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/main.js
+++ b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/main.js
@@ -1,4 +1,4 @@
-define(['exports', './generated-lib2', './generated-lib1'], function (exports, lib2, lib1) { 'use strict';
+define(['exports', './generated-lib1', './generated-lib2'], function (exports, lib1, lib2) { 'use strict';
diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/main.js
index 7a6f3d231..8ca369a5e 100644
--- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/main.js
+++ b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/main.js
@@ -2,8 +2,8 @@
Object.defineProperty(exports, '__esModule', { value: true });
-require('./generated-lib2.js');
var lib1 = require('./generated-lib1.js');
+require('./generated-lib2.js');
diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/main.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/main.js
index 160cdb23d..93f53841e 100644
--- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/main.js
+++ b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/main.js
@@ -1,2 +1,2 @@
-import './generated-lib2.js';
export { l as lib1 } from './generated-lib1.js';
+import './generated-lib2.js';
diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/main.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/main.js
index cfb378bc4..2bbc4fab8 100644
--- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/main.js
+++ b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/main.js
@@ -1,9 +1,9 @@
-System.register(['./generated-lib2.js', './generated-lib1.js'], function (exports) {
+System.register(['./generated-lib1.js', './generated-lib2.js'], function (exports) {
'use strict';
return {
- setters: [function () {}, function (module) {
+ setters: [function (module) {
exports('lib1', module.l);
- }],
+ }, function () {}],
execute: function () {
diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/main.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/main.js
index 38be52d66..9e02e78d2 100644
--- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/main.js
+++ b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/main.js
@@ -1,9 +1,9 @@
-define(['exports', './components/sub/index', './components/index'], function (exports, index$1, index) { 'use strict';
+define(['exports', './components/index', './components/sub/index'], function (exports, index, index$1) { 'use strict';
- exports.foo = index$1.foo;
exports.baz = index.baz;
+ exports.foo = index$1.foo;
Object.defineProperty(exports, '__esModule', { value: true });
diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/main.js
index 088354d51..e8c88da65 100644
--- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/main.js
+++ b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/main.js
@@ -2,10 +2,10 @@
Object.defineProperty(exports, '__esModule', { value: true });
-var index$1 = require('./components/sub/index.js');
var index = require('./components/index.js');
+var index$1 = require('./components/sub/index.js');
-exports.foo = index$1.foo;
exports.baz = index.baz;
+exports.foo = index$1.foo;
diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/main.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/main.js
index 4b8f56eba..d3455118d 100644
--- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/main.js
+++ b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/main.js
@@ -1,2 +1,2 @@
-export { foo } from './components/sub/index.js';
export { baz } from './components/index.js';
+export { foo } from './components/sub/index.js';
diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/main.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/main.js
index a5e92b9bf..8aafd8ee3 100644
--- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/main.js
+++ b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/main.js
@@ -1,10 +1,10 @@
-System.register('bundle', ['./components/sub/index.js', './components/index.js'], function (exports) {
+System.register('bundle', ['./components/index.js', './components/sub/index.js'], function (exports) {
'use strict';
return {
setters: [function (module) {
- exports('foo', module.foo);
- }, function (module) {
exports('baz', module.baz);
+ }, function (module) {
+ exports('foo', module.foo);
}],
execute: function () {
diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/main.js
index 5ec5a9952..28fbd1e66 100644
--- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/main.js
+++ b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/main.js
@@ -1,4 +1,4 @@
-define(['./generated-manual-inner', './generated-manual-middle', './generated-manual-outer'], function (manualInner, manualMiddle, manualOuter) { 'use strict';
+define(['./generated-manual-outer', './generated-manual-middle', './generated-manual-inner'], function (manualOuter, manualMiddle, manualInner) { 'use strict';
console.log('main');
diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/main.js
index 7b5cf110c..70f464747 100644
--- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/main.js
+++ b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/main.js
@@ -1,7 +1,7 @@
'use strict';
-require('./generated-manual-inner.js');
-require('./generated-manual-middle.js');
require('./generated-manual-outer.js');
+require('./generated-manual-middle.js');
+require('./generated-manual-inner.js');
console.log('main');
diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/main.js
index de3b67e66..10b9ca2eb 100644
--- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/main.js
+++ b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/main.js
@@ -1,5 +1,5 @@
-import './generated-manual-inner.js';
-import './generated-manual-middle.js';
import './generated-manual-outer.js';
+import './generated-manual-middle.js';
+import './generated-manual-inner.js';
console.log('main');
diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/main.js
index 07ba8910b..9719fd497 100644
--- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/main.js
+++ b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/main.js
@@ -1,4 +1,4 @@
-System.register(['./generated-manual-inner.js', './generated-manual-middle.js', './generated-manual-outer.js'], function () {
+System.register(['./generated-manual-outer.js', './generated-manual-middle.js', './generated-manual-inner.js'], function () {
'use strict';
return {
setters: [function () {}, function () {}, function () {}],
diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js
index 939b5e414..35ee425f7 100644
--- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js
+++ b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js
@@ -1,4 +1,4 @@
-define(['./generated-chunk-b', './generated-chunk-c'], function (chunkB, chunkC) { 'use strict';
+define(['./generated-chunk-c', './generated-chunk-b'], function (chunkC, chunkB) { 'use strict';
console.log('dep1');
diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js
index d65da8d78..2d8f820fd 100644
--- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js
+++ b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js
@@ -1,7 +1,7 @@
'use strict';
-require('./generated-chunk-b.js');
require('./generated-chunk-c.js');
+require('./generated-chunk-b.js');
console.log('dep1');
diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js
index ae2fdbf85..d3864b714 100644
--- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js
+++ b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js
@@ -1,5 +1,5 @@
-import './generated-chunk-b.js';
import './generated-chunk-c.js';
+import './generated-chunk-b.js';
console.log('dep1');
diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/main-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/main-a.js
index 69e6ce429..c897b0643 100644
--- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/main-a.js
+++ b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/main-a.js
@@ -1,4 +1,4 @@
-System.register(['./generated-chunk-b.js', './generated-chunk-c.js'], function () {
+System.register(['./generated-chunk-c.js', './generated-chunk-b.js'], function () {
'use strict';
return {
setters: [function () {}, function () {}],
diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js
index 7f84fe836..ee86eabf5 100644
--- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js
+++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js
@@ -1,4 +1,4 @@
-define(['external', './commonjs'], function (external, commonjs) { 'use strict';
+define(['./commonjs', 'external'], function (commonjs, external) { 'use strict';
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js
index ecc2cb7ff..4d7f52a73 100644
--- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js
+++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js
@@ -1,7 +1,7 @@
'use strict';
-var external = require('external');
var commonjs = require('./commonjs.js');
+var external = require('external');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js
index 6d5496583..8b62c6965 100644
--- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js
+++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js
@@ -1,4 +1,4 @@
-import external from 'external';
import commonjs from './commonjs.js';
+import external from 'external';
console.log(commonjs, external);
diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/main.js
index 8ff0da14a..c6fe1949d 100644
--- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/main.js
+++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/main.js
@@ -1,11 +1,11 @@
-System.register(['external', './commonjs.js'], function () {
+System.register(['./commonjs.js', 'external'], function () {
'use strict';
- var external, commonjs;
+ var commonjs, external;
return {
setters: [function (module) {
- external = module.default;
- }, function (module) {
commonjs = module.default;
+ }, function (module) {
+ external = module.default;
}],
execute: function () {
diff --git a/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/main.js b/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/main.js
index fd4897a74..2a34eca48 100644
--- a/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/main.js
+++ b/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/main.js
@@ -1,4 +1,4 @@
-define(['./m2', './generated-m1'], function (m2, m1) { 'use strict';
+define(['./generated-m1', './m2'], function (m1, m2) { 'use strict';
console.log(m1.ms);
diff --git a/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/main.js b/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/main.js
index a7ba4a72c..7cbfccf1a 100644
--- a/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/main.js
+++ b/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/main.js
@@ -1,6 +1,6 @@
'use strict';
-require('./m2.js');
var m1 = require('./generated-m1.js');
+require('./m2.js');
console.log(m1.ms);
diff --git a/test/chunking-form/samples/entry-point-without-own-code/_expected/es/main.js b/test/chunking-form/samples/entry-point-without-own-code/_expected/es/main.js
index 161f7abae..4ac52211f 100644
--- a/test/chunking-form/samples/entry-point-without-own-code/_expected/es/main.js
+++ b/test/chunking-form/samples/entry-point-without-own-code/_expected/es/main.js
@@ -1,4 +1,4 @@
-import './m2.js';
import { m as ms } from './generated-m1.js';
+import './m2.js';
console.log(ms);
diff --git a/test/chunking-form/samples/entry-point-without-own-code/_expected/system/main.js b/test/chunking-form/samples/entry-point-without-own-code/_expected/system/main.js
index a210bd11c..c2269622e 100644
--- a/test/chunking-form/samples/entry-point-without-own-code/_expected/system/main.js
+++ b/test/chunking-form/samples/entry-point-without-own-code/_expected/system/main.js
@@ -1,10 +1,10 @@
-System.register(['./m2.js', './generated-m1.js'], function () {
+System.register(['./generated-m1.js', './m2.js'], function () {
'use strict';
var ms;
return {
- setters: [function () {}, function (module) {
+ setters: [function (module) {
ms = module.m;
- }],
+ }, function () {}],
execute: function () {
console.log(ms);
diff --git a/test/chunking-form/samples/external-imports/_expected/amd/main-named.js b/test/chunking-form/samples/external-imports/_expected/amd/main-named.js
index def8563c1..f5a7f6572 100644
--- a/test/chunking-form/samples/external-imports/_expected/amd/main-named.js
+++ b/test/chunking-form/samples/external-imports/_expected/amd/main-named.js
@@ -1,4 +1,4 @@
-define(['external-all', 'external-default-named', 'external-named', 'external-named-namespace'], function (foo, baz, externalNamed, quux) { 'use strict';
+define(['external-all', 'external-named', 'external-default-named', 'external-named-namespace'], function (foo, externalNamed, baz, quux) { 'use strict';
console.log(foo.foo, externalNamed.bar, baz.baz, quux.quux);
diff --git a/test/chunking-form/samples/external-imports/_expected/amd/main-namespace.js b/test/chunking-form/samples/external-imports/_expected/amd/main-namespace.js
index da233d39c..e038a7abe 100644
--- a/test/chunking-form/samples/external-imports/_expected/amd/main-namespace.js
+++ b/test/chunking-form/samples/external-imports/_expected/amd/main-namespace.js
@@ -1,4 +1,4 @@
-define(['external-all', 'external-default-namespace', 'external-named-namespace', 'external-namespace'], function (foo, quux, quux$1, bar) { 'use strict';
+define(['external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], function (foo, bar, quux, quux$1) { 'use strict';
function _interopNamespace(e) {
if (e && e.__esModule) return e;
@@ -21,9 +21,9 @@ define(['external-all', 'external-default-namespace', 'external-named-namespace'
}
var foo__namespace = /*#__PURE__*/_interopNamespace(foo);
+ var bar__namespace = /*#__PURE__*/_interopNamespace(bar);
var quux__namespace = /*#__PURE__*/_interopNamespace(quux);
var quux__namespace$1 = /*#__PURE__*/_interopNamespace(quux$1);
- var bar__namespace = /*#__PURE__*/_interopNamespace(bar);
console.log(foo__namespace, bar__namespace, quux__namespace, quux__namespace$1);
diff --git a/test/chunking-form/samples/external-imports/_expected/cjs/main-named.js b/test/chunking-form/samples/external-imports/_expected/cjs/main-named.js
index 2150e1085..58214f8ba 100644
--- a/test/chunking-form/samples/external-imports/_expected/cjs/main-named.js
+++ b/test/chunking-form/samples/external-imports/_expected/cjs/main-named.js
@@ -1,8 +1,8 @@
'use strict';
var foo = require('external-all');
-var baz = require('external-default-named');
var externalNamed = require('external-named');
+var baz = require('external-default-named');
var quux = require('external-named-namespace');
console.log(foo.foo, externalNamed.bar, baz.baz, quux.quux);
diff --git a/test/chunking-form/samples/external-imports/_expected/cjs/main-namespace.js b/test/chunking-form/samples/external-imports/_expected/cjs/main-namespace.js
index ad9ee36c8..0417d88a1 100644
--- a/test/chunking-form/samples/external-imports/_expected/cjs/main-namespace.js
+++ b/test/chunking-form/samples/external-imports/_expected/cjs/main-namespace.js
@@ -1,9 +1,9 @@
'use strict';
var foo = require('external-all');
+var bar = require('external-namespace');
var quux = require('external-default-namespace');
var quux$1 = require('external-named-namespace');
-var bar = require('external-namespace');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
@@ -26,8 +26,8 @@ function _interopNamespace(e) {
}
var foo__namespace = /*#__PURE__*/_interopNamespace(foo);
+var bar__namespace = /*#__PURE__*/_interopNamespace(bar);
var quux__namespace = /*#__PURE__*/_interopNamespace(quux);
var quux__namespace$1 = /*#__PURE__*/_interopNamespace(quux$1);
-var bar__namespace = /*#__PURE__*/_interopNamespace(bar);
console.log(foo__namespace, bar__namespace, quux__namespace, quux__namespace$1);
diff --git a/test/chunking-form/samples/external-imports/_expected/es/main-named.js b/test/chunking-form/samples/external-imports/_expected/es/main-named.js
index 65552b6e0..8e9cc37e4 100644
--- a/test/chunking-form/samples/external-imports/_expected/es/main-named.js
+++ b/test/chunking-form/samples/external-imports/_expected/es/main-named.js
@@ -1,6 +1,6 @@
import { foo } from 'external-all';
-import { baz } from 'external-default-named';
import { bar } from 'external-named';
+import { baz } from 'external-default-named';
import { quux } from 'external-named-namespace';
console.log(foo, bar, baz, quux);
diff --git a/test/chunking-form/samples/external-imports/_expected/es/main-namespace.js b/test/chunking-form/samples/external-imports/_expected/es/main-namespace.js
index 3aeb52841..740f4ddee 100644
--- a/test/chunking-form/samples/external-imports/_expected/es/main-namespace.js
+++ b/test/chunking-form/samples/external-imports/_expected/es/main-namespace.js
@@ -1,6 +1,6 @@
import * as foo from 'external-all';
+import * as bar from 'external-namespace';
import * as quux from 'external-default-namespace';
import * as quux$1 from 'external-named-namespace';
-import * as bar from 'external-namespace';
console.log(foo, bar, quux, quux$1);
diff --git a/test/chunking-form/samples/external-imports/_expected/system/main-named.js b/test/chunking-form/samples/external-imports/_expected/system/main-named.js
index 29d1bba75..ae0b81897 100644
--- a/test/chunking-form/samples/external-imports/_expected/system/main-named.js
+++ b/test/chunking-form/samples/external-imports/_expected/system/main-named.js
@@ -1,13 +1,13 @@
-System.register(['external-all', 'external-default-named', 'external-named', 'external-named-namespace'], function () {
+System.register(['external-all', 'external-named', 'external-default-named', 'external-named-namespace'], function () {
'use strict';
- var foo, baz, bar, quux;
+ var foo, bar, baz, quux;
return {
setters: [function (module) {
foo = module.foo;
- }, function (module) {
- baz = module.baz;
}, function (module) {
bar = module.bar;
+ }, function (module) {
+ baz = module.baz;
}, function (module) {
quux = module.quux;
}],
diff --git a/test/chunking-form/samples/external-imports/_expected/system/main-namespace.js b/test/chunking-form/samples/external-imports/_expected/system/main-namespace.js
index 4e4582bb4..efb58b888 100644
--- a/test/chunking-form/samples/external-imports/_expected/system/main-namespace.js
+++ b/test/chunking-form/samples/external-imports/_expected/system/main-namespace.js
@@ -1,15 +1,15 @@
-System.register(['external-all', 'external-default-namespace', 'external-named-namespace', 'external-namespace'], function () {
+System.register(['external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], function () {
'use strict';
- var foo, quux, quux$1, bar;
+ var foo, bar, quux, quux$1;
return {
setters: [function (module) {
foo = module;
+ }, function (module) {
+ bar = module;
}, function (module) {
quux = module;
}, function (module) {
quux$1 = module;
- }, function (module) {
- bar = module;
}],
execute: function () {
diff --git a/test/chunking-form/samples/external-reexports/_expected/amd/main-named.js b/test/chunking-form/samples/external-reexports/_expected/amd/main-named.js
index 41436a440..28207c22d 100644
--- a/test/chunking-form/samples/external-reexports/_expected/amd/main-named.js
+++ b/test/chunking-form/samples/external-reexports/_expected/amd/main-named.js
@@ -1,4 +1,4 @@
-define(['exports', 'external-all', 'external-default-named', 'external-named', 'external-named-namespace'], function (exports, externalAll, externalDefaultNamed, externalNamed, externalNamedNamespace) { 'use strict';
+define(['exports', 'external-all', 'external-named', 'external-default-named', 'external-named-namespace'], function (exports, externalAll, externalNamed, externalDefaultNamed, externalNamedNamespace) { 'use strict';
@@ -8,16 +8,16 @@ define(['exports', 'external-all', 'external-default-named', 'external-named', '
return externalAll.foo;
}
});
- Object.defineProperty(exports, 'baz', {
+ Object.defineProperty(exports, 'bar', {
enumerable: true,
get: function () {
- return externalDefaultNamed.baz;
+ return externalNamed.bar;
}
});
- Object.defineProperty(exports, 'bar', {
+ Object.defineProperty(exports, 'baz', {
enumerable: true,
get: function () {
- return externalNamed.bar;
+ return externalDefaultNamed.baz;
}
});
Object.defineProperty(exports, 'quux', {
diff --git a/test/chunking-form/samples/external-reexports/_expected/amd/main-namespace.js b/test/chunking-form/samples/external-reexports/_expected/amd/main-namespace.js
index faf4f3e4a..255a9264b 100644
--- a/test/chunking-form/samples/external-reexports/_expected/amd/main-namespace.js
+++ b/test/chunking-form/samples/external-reexports/_expected/amd/main-namespace.js
@@ -1,4 +1,4 @@
-define(['exports', 'external-all', 'external-default-namespace', 'external-named-namespace', 'external-namespace'], function (exports, externalAll, externalDefaultNamespace, externalNamedNamespace, externalNamespace$1) { 'use strict';
+define(['exports', 'external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], function (exports, externalAll, externalNamespace$1, externalDefaultNamespace, externalNamedNamespace) { 'use strict';
function _interopNamespace(e) {
if (e && e.__esModule) return e;
@@ -21,18 +21,18 @@ define(['exports', 'external-all', 'external-default-namespace', 'external-named
}
var externalAll__namespace = /*#__PURE__*/_interopNamespace(externalAll);
+ var externalNamespace__namespace = /*#__PURE__*/_interopNamespace(externalNamespace$1);
var externalDefaultNamespace__namespace = /*#__PURE__*/_interopNamespace(externalDefaultNamespace);
var externalNamedNamespace__namespace = /*#__PURE__*/_interopNamespace(externalNamedNamespace);
- var externalNamespace__namespace = /*#__PURE__*/_interopNamespace(externalNamespace$1);
const externalNamespace = 1;
const externalNamespace__ns = 1;
console.log(externalNamespace, externalNamespace__ns);
exports.foo = externalAll__namespace;
+ exports.bar = externalNamespace__namespace;
exports.baz = externalDefaultNamespace__namespace;
exports.quux = externalNamedNamespace__namespace;
- exports.bar = externalNamespace__namespace;
Object.defineProperty(exports, '__esModule', { value: true });
diff --git a/test/chunking-form/samples/external-reexports/_expected/cjs/main-named.js b/test/chunking-form/samples/external-reexports/_expected/cjs/main-named.js
index 0178de78b..15dc96d6d 100644
--- a/test/chunking-form/samples/external-reexports/_expected/cjs/main-named.js
+++ b/test/chunking-form/samples/external-reexports/_expected/cjs/main-named.js
@@ -3,8 +3,8 @@
Object.defineProperty(exports, '__esModule', { value: true });
var externalAll = require('external-all');
-var externalDefaultNamed = require('external-default-named');
var externalNamed = require('external-named');
+var externalDefaultNamed = require('external-default-named');
var externalNamedNamespace = require('external-named-namespace');
@@ -15,16 +15,16 @@ Object.defineProperty(exports, 'foo', {
return externalAll.foo;
}
});
-Object.defineProperty(exports, 'baz', {
+Object.defineProperty(exports, 'bar', {
enumerable: true,
get: function () {
- return externalDefaultNamed.baz;
+ return externalNamed.bar;
}
});
-Object.defineProperty(exports, 'bar', {
+Object.defineProperty(exports, 'baz', {
enumerable: true,
get: function () {
- return externalNamed.bar;
+ return externalDefaultNamed.baz;
}
});
Object.defineProperty(exports, 'quux', {
diff --git a/test/chunking-form/samples/external-reexports/_expected/cjs/main-namespace.js b/test/chunking-form/samples/external-reexports/_expected/cjs/main-namespace.js
index eef14c330..8d3df6ca7 100644
--- a/test/chunking-form/samples/external-reexports/_expected/cjs/main-namespace.js
+++ b/test/chunking-form/samples/external-reexports/_expected/cjs/main-namespace.js
@@ -3,9 +3,9 @@
Object.defineProperty(exports, '__esModule', { value: true });
var externalAll = require('external-all');
+var externalNamespace$1 = require('external-namespace');
var externalDefaultNamespace = require('external-default-namespace');
var externalNamedNamespace = require('external-named-namespace');
-var externalNamespace$1 = require('external-namespace');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
@@ -28,15 +28,15 @@ function _interopNamespace(e) {
}
var externalAll__namespace = /*#__PURE__*/_interopNamespace(externalAll);
+var externalNamespace__namespace = /*#__PURE__*/_interopNamespace(externalNamespace$1);
var externalDefaultNamespace__namespace = /*#__PURE__*/_interopNamespace(externalDefaultNamespace);
var externalNamedNamespace__namespace = /*#__PURE__*/_interopNamespace(externalNamedNamespace);
-var externalNamespace__namespace = /*#__PURE__*/_interopNamespace(externalNamespace$1);
const externalNamespace = 1;
const externalNamespace__ns = 1;
console.log(externalNamespace, externalNamespace__ns);
exports.foo = externalAll__namespace;
+exports.bar = externalNamespace__namespace;
exports.baz = externalDefaultNamespace__namespace;
exports.quux = externalNamedNamespace__namespace;
-exports.bar = externalNamespace__namespace;
diff --git a/test/chunking-form/samples/external-reexports/_expected/es/main-named.js b/test/chunking-form/samples/external-reexports/_expected/es/main-named.js
index 00c24ef7e..14249608c 100644
--- a/test/chunking-form/samples/external-reexports/_expected/es/main-named.js
+++ b/test/chunking-form/samples/external-reexports/_expected/es/main-named.js
@@ -1,4 +1,4 @@
export { foo } from 'external-all';
-export { baz } from 'external-default-named';
export { bar } from 'external-named';
+export { baz } from 'external-default-named';
export { quux } from 'external-named-namespace';
diff --git a/test/chunking-form/samples/external-reexports/_expected/es/main-namespace.js b/test/chunking-form/samples/external-reexports/_expected/es/main-namespace.js
index db1a9c7a3..c14a1672f 100644
--- a/test/chunking-form/samples/external-reexports/_expected/es/main-namespace.js
+++ b/test/chunking-form/samples/external-reexports/_expected/es/main-namespace.js
@@ -1,11 +1,11 @@
import * as externalAll from 'external-all';
export { externalAll as foo };
+import * as externalNamespace$1 from 'external-namespace';
+export { externalNamespace$1 as bar };
import * as externalDefaultNamespace from 'external-default-namespace';
export { externalDefaultNamespace as baz };
import * as externalNamedNamespace from 'external-named-namespace';
export { externalNamedNamespace as quux };
-import * as externalNamespace$1 from 'external-namespace';
-export { externalNamespace$1 as bar };
const externalNamespace = 1;
const externalNamespace__ns = 1;
diff --git a/test/chunking-form/samples/external-reexports/_expected/system/main-named.js b/test/chunking-form/samples/external-reexports/_expected/system/main-named.js
index fc6c31dd1..c0d4f81aa 100644
--- a/test/chunking-form/samples/external-reexports/_expected/system/main-named.js
+++ b/test/chunking-form/samples/external-reexports/_expected/system/main-named.js
@@ -1,12 +1,12 @@
-System.register(['external-all', 'external-default-named', 'external-named', 'external-named-namespace'], function (exports) {
+System.register(['external-all', 'external-named', 'external-default-named', 'external-named-namespace'], function (exports) {
'use strict';
return {
setters: [function (module) {
exports('foo', module.foo);
- }, function (module) {
- exports('baz', module.baz);
}, function (module) {
exports('bar', module.bar);
+ }, function (module) {
+ exports('baz', module.baz);
}, function (module) {
exports('quux', module.quux);
}],
diff --git a/test/chunking-form/samples/external-reexports/_expected/system/main-namespace.js b/test/chunking-form/samples/external-reexports/_expected/system/main-namespace.js
index 5964a07ad..0116bef7a 100644
--- a/test/chunking-form/samples/external-reexports/_expected/system/main-namespace.js
+++ b/test/chunking-form/samples/external-reexports/_expected/system/main-namespace.js
@@ -1,14 +1,14 @@
-System.register(['external-all', 'external-default-namespace', 'external-named-namespace', 'external-namespace'], function (exports) {
+System.register(['external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], function (exports) {
'use strict';
return {
setters: [function (module) {
exports('foo', module);
+ }, function (module) {
+ exports('bar', module);
}, function (module) {
exports('baz', module);
}, function (module) {
exports('quux', module);
- }, function (module) {
- exports('bar', module);
}],
execute: function () {
diff --git a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amd/main1.js b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amd/main1.js
index a5cf98522..b8530d391 100644
--- a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amd/main1.js
+++ b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amd/main1.js
@@ -1,4 +1,4 @@
-define(['./generated-dep', './generated-shared'], function (dep, shared) { 'use strict';
+define(['./generated-shared', './generated-dep'], function (shared, dep) { 'use strict';
console.log('main1');
diff --git a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amd/main2.js b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amd/main2.js
index 307016a42..be30778a3 100644
--- a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amd/main2.js
+++ b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amd/main2.js
@@ -1,4 +1,4 @@
-define(['./generated-dep', './generated-shared'], function (dep, shared) { 'use strict';
+define(['./generated-shared', './generated-dep'], function (shared, dep) { 'use strict';
console.log('main2');
diff --git a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs/main1.js b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs/main1.js
index e793a1956..41bfb383f 100644
--- a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs/main1.js
+++ b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs/main1.js
@@ -1,6 +1,6 @@
'use strict';
-require('./generated-dep.js');
require('./generated-shared.js');
+require('./generated-dep.js');
console.log('main1');
diff --git a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs/main2.js b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs/main2.js
index 9baf0ec21..eec49d427 100644
--- a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs/main2.js
+++ b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs/main2.js
@@ -1,6 +1,6 @@
'use strict';
-require('./generated-dep.js');
require('./generated-shared.js');
+require('./generated-dep.js');
console.log('main2');
diff --git a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/main1.js b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/main1.js
index 16fe8ba26..c56d4b0fb 100644
--- a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/main1.js
+++ b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/main1.js
@@ -1,4 +1,4 @@
-import './generated-dep.js';
import './generated-shared.js';
+import './generated-dep.js';
console.log('main1');
diff --git a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/main2.js b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/main2.js
index 728f3a05e..a9581da4b 100644
--- a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/main2.js
+++ b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/main2.js
@@ -1,4 +1,4 @@
-import './generated-dep.js';
import './generated-shared.js';
+import './generated-dep.js';
console.log('main2');
diff --git a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/system/main1.js b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/system/main1.js
index bc48044fd..2e44d944d 100644
--- a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/system/main1.js
+++ b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/system/main1.js
@@ -1,4 +1,4 @@
-System.register(['./generated-dep.js', './generated-shared.js'], function () {
+System.register(['./generated-shared.js', './generated-dep.js'], function () {
'use strict';
return {
setters: [function () {}, function () {}],
diff --git a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/system/main2.js b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/system/main2.js
index fe9fd0500..569ffa4f1 100644
--- a/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/system/main2.js
+++ b/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/system/main2.js
@@ -1,4 +1,4 @@
-System.register(['./generated-dep.js', './generated-shared.js'], function () {
+System.register(['./generated-shared.js', './generated-dep.js'], function () {
'use strict';
return {
setters: [function () {}, function () {}],
diff --git a/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/main.js b/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/main.js
index 38be52d66..9e02e78d2 100644
--- a/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/main.js
+++ b/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/main.js
@@ -1,9 +1,9 @@
-define(['exports', './components/sub/index', './components/index'], function (exports, index$1, index) { 'use strict';
+define(['exports', './components/index', './components/sub/index'], function (exports, index, index$1) { 'use strict';
- exports.foo = index$1.foo;
exports.baz = index.baz;
+ exports.foo = index$1.foo;
Object.defineProperty(exports, '__esModule', { value: true });
diff --git a/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/main.js b/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/main.js
index 088354d51..e8c88da65 100644
--- a/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/main.js
+++ b/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/main.js
@@ -2,10 +2,10 @@
Object.defineProperty(exports, '__esModule', { value: true });
-var index$1 = require('./components/sub/index.js');
var index = require('./components/index.js');
+var index$1 = require('./components/sub/index.js');
-exports.foo = index$1.foo;
exports.baz = index.baz;
+exports.foo = index$1.foo;
diff --git a/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/main.js b/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/main.js
index 4b8f56eba..d3455118d 100644
--- a/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/main.js
+++ b/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/main.js
@@ -1,2 +1,2 @@
-export { foo } from './components/sub/index.js';
export { baz } from './components/index.js';
+export { foo } from './components/sub/index.js';
diff --git a/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/main.js b/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/main.js
index a5e92b9bf..8aafd8ee3 100644
--- a/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/main.js
+++ b/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/main.js
@@ -1,10 +1,10 @@
-System.register('bundle', ['./components/sub/index.js', './components/index.js'], function (exports) {
+System.register('bundle', ['./components/index.js', './components/sub/index.js'], function (exports) {
'use strict';
return {
setters: [function (module) {
- exports('foo', module.foo);
- }, function (module) {
exports('baz', module.baz);
+ }, function (module) {
+ exports('foo', module.foo);
}],
execute: function () {
diff --git a/test/chunking-form/samples/manual-chunks-different-nested/_expected/amd/main.js b/test/chunking-form/samples/manual-chunks-different-nested/_expected/amd/main.js
index 5ec5a9952..28fbd1e66 100644
--- a/test/chunking-form/samples/manual-chunks-different-nested/_expected/amd/main.js
+++ b/test/chunking-form/samples/manual-chunks-different-nested/_expected/amd/main.js
@@ -1,4 +1,4 @@
-define(['./generated-manual-inner', './generated-manual-middle', './generated-manual-outer'], function (manualInner, manualMiddle, manualOuter) { 'use strict';
+define(['./generated-manual-outer', './generated-manual-middle', './generated-manual-inner'], function (manualOuter, manualMiddle, manualInner) { 'use strict';
console.log('main');
diff --git a/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs/main.js b/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs/main.js
index 7b5cf110c..70f464747 100644
--- a/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs/main.js
+++ b/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs/main.js
@@ -1,7 +1,7 @@
'use strict';
-require('./generated-manual-inner.js');
-require('./generated-manual-middle.js');
require('./generated-manual-outer.js');
+require('./generated-manual-middle.js');
+require('./generated-manual-inner.js');
console.log('main');
diff --git a/test/chunking-form/samples/manual-chunks-different-nested/_expected/es/main.js b/test/chunking-form/samples/manual-chunks-different-nested/_expected/es/main.js
index de3b67e66..10b9ca2eb 100644
--- a/test/chunking-form/samples/manual-chunks-different-nested/_expected/es/main.js
+++ b/test/chunking-form/samples/manual-chunks-different-nested/_expected/es/main.js
@@ -1,5 +1,5 @@
-import './generated-manual-inner.js';
-import './generated-manual-middle.js';
import './generated-manual-outer.js';
+import './generated-manual-middle.js';
+import './generated-manual-inner.js';
console.log('main');
diff --git a/test/chunking-form/samples/manual-chunks-different-nested/_expected/system/main.js b/test/chunking-form/samples/manual-chunks-different-nested/_expected/system/main.js
index 07ba8910b..9719fd497 100644
--- a/test/chunking-form/samples/manual-chunks-different-nested/_expected/system/main.js
+++ b/test/chunking-form/samples/manual-chunks-different-nested/_expected/system/main.js
@@ -1,4 +1,4 @@
-System.register(['./generated-manual-inner.js', './generated-manual-middle.js', './generated-manual-outer.js'], function () {
+System.register(['./generated-manual-outer.js', './generated-manual-middle.js', './generated-manual-inner.js'], function () {
'use strict';
return {
setters: [function () {}, function () {}, function () {}],
diff --git a/test/chunking-form/samples/manual-chunks-function/_expected/amd/main-a.js b/test/chunking-form/samples/manual-chunks-function/_expected/amd/main-a.js
index 939b5e414..35ee425f7 100644
--- a/test/chunking-form/samples/manual-chunks-function/_expected/amd/main-a.js
+++ b/test/chunking-form/samples/manual-chunks-function/_expected/amd/main-a.js
@@ -1,4 +1,4 @@
-define(['./generated-chunk-b', './generated-chunk-c'], function (chunkB, chunkC) { 'use strict';
+define(['./generated-chunk-c', './generated-chunk-b'], function (chunkC, chunkB) { 'use strict';
console.log('dep1');
diff --git a/test/chunking-form/samples/manual-chunks-function/_expected/cjs/main-a.js b/test/chunking-form/samples/manual-chunks-function/_expected/cjs/main-a.js
index d65da8d78..2d8f820fd 100644
--- a/test/chunking-form/samples/manual-chunks-function/_expected/cjs/main-a.js
+++ b/test/chunking-form/samples/manual-chunks-function/_expected/cjs/main-a.js
@@ -1,7 +1,7 @@
'use strict';
-require('./generated-chunk-b.js');
require('./generated-chunk-c.js');
+require('./generated-chunk-b.js');
console.log('dep1');
diff --git a/test/chunking-form/samples/manual-chunks-function/_expected/es/main-a.js b/test/chunking-form/samples/manual-chunks-function/_expected/es/main-a.js
index ae2fdbf85..d3864b714 100644
--- a/test/chunking-form/samples/manual-chunks-function/_expected/es/main-a.js
+++ b/test/chunking-form/samples/manual-chunks-function/_expected/es/main-a.js
@@ -1,5 +1,5 @@
-import './generated-chunk-b.js';
import './generated-chunk-c.js';
+import './generated-chunk-b.js';
console.log('dep1');
diff --git a/test/chunking-form/samples/manual-chunks-function/_expected/system/main-a.js b/test/chunking-form/samples/manual-chunks-function/_expected/system/main-a.js
index 69e6ce429..c897b0643 100644
--- a/test/chunking-form/samples/manual-chunks-function/_expected/system/main-a.js
+++ b/test/chunking-form/samples/manual-chunks-function/_expected/system/main-a.js
@@ -1,4 +1,4 @@
-System.register(['./generated-chunk-b.js', './generated-chunk-c.js'], function () {
+System.register(['./generated-chunk-c.js', './generated-chunk-b.js'], function () {
'use strict';
return {
setters: [function () {}, function () {}],
diff --git a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main1.js b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main1.js
index e27605e31..9a63a48b6 100644
--- a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main1.js
+++ b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main1.js
@@ -1,4 +1,4 @@
-define(['./generated-dep', 'external', './generated-index'], function (dep, external, index) { 'use strict';
+define(['./generated-index', './generated-dep', 'external'], function (index, dep, external) { 'use strict';
console.log(index.lib);
diff --git a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main2.js b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main2.js
index 2187075bd..29fd4bfaf 100644
--- a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main2.js
+++ b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main2.js
@@ -1,4 +1,4 @@
-define(['./generated-dep', 'external', './generated-index'], function (dep, external, index) { 'use strict';
+define(['./generated-index', './generated-dep', 'external'], function (index, dep, external) { 'use strict';
console.log(dep.reexported);
diff --git a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main1.js b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main1.js
index 76ea0a898..825f50ff9 100644
--- a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main1.js
+++ b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main1.js
@@ -1,7 +1,7 @@
'use strict';
+var index = require('./generated-index.js');
require('./generated-dep.js');
require('external');
-var index = require('./generated-index.js');
console.log(index.lib);
diff --git a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main2.js b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main2.js
index a97a14db2..23ef86706 100644
--- a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main2.js
+++ b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main2.js
@@ -1,7 +1,7 @@
'use strict';
+require('./generated-index.js');
var dep = require('./generated-dep.js');
require('external');
-require('./generated-index.js');
console.log(dep.reexported);
diff --git a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main1.js b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main1.js
index 2de222480..9d3be1fa5 100644
--- a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main1.js
+++ b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main1.js
@@ -1,5 +1,5 @@
+import { l as lib } from './generated-index.js';
import './generated-dep.js';
import 'external';
-import { l as lib } from './generated-index.js';
console.log(lib);
diff --git a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main2.js b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main2.js
index 0ad3b767a..eaef3e7d3 100644
--- a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main2.js
+++ b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main2.js
@@ -1,5 +1,5 @@
+import './generated-index.js';
import { r as reexported } from './generated-dep.js';
import 'external';
-import './generated-index.js';
console.log(reexported);
diff --git a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main1.js b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main1.js
index aa87cd2e3..4f903980c 100644
--- a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main1.js
+++ b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main1.js
@@ -1,10 +1,10 @@
-System.register(['./generated-dep.js', 'external', './generated-index.js'], function () {
+System.register(['./generated-index.js', './generated-dep.js', 'external'], function () {
'use strict';
var lib;
return {
- setters: [function () {}, function () {}, function (module) {
+ setters: [function (module) {
lib = module.l;
- }],
+ }, function () {}, function () {}],
execute: function () {
console.log(lib);
diff --git a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main2.js b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main2.js
index 776944744..1b7f0f1e9 100644
--- a/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main2.js
+++ b/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main2.js
@@ -1,10 +1,10 @@
-System.register(['./generated-dep.js', 'external', './generated-index.js'], function () {
+System.register(['./generated-index.js', './generated-dep.js', 'external'], function () {
'use strict';
var reexported;
return {
- setters: [function (module) {
+ setters: [function () {}, function (module) {
reexported = module.r;
- }, function () {}, function () {}],
+ }, function () {}],
execute: function () {
console.log(reexported);
diff --git a/test/chunking-form/samples/namespace-reexports/_expected/amd/main.js b/test/chunking-form/samples/namespace-reexports/_expected/amd/main.js
index 47919c686..66a16c83d 100644
--- a/test/chunking-form/samples/namespace-reexports/_expected/amd/main.js
+++ b/test/chunking-form/samples/namespace-reexports/_expected/amd/main.js
@@ -1,4 +1,4 @@
-define(['exports', './hsl2hsv', './generated-index'], function (exports, hsl2hsv, index) { 'use strict';
+define(['exports', './generated-index', './hsl2hsv'], function (exports, index, hsl2hsv) { 'use strict';
console.log(hsl2hsv.p);
var main = new Map(Object.entries(index.lib));
diff --git a/test/chunking-form/samples/namespace-reexports/_expected/cjs/main.js b/test/chunking-form/samples/namespace-reexports/_expected/cjs/main.js
index 2ca1ab022..4ac898f1a 100644
--- a/test/chunking-form/samples/namespace-reexports/_expected/cjs/main.js
+++ b/test/chunking-form/samples/namespace-reexports/_expected/cjs/main.js
@@ -2,8 +2,8 @@
Object.defineProperty(exports, '__esModule', { value: true });
-var hsl2hsv = require('./hsl2hsv.js');
var index = require('./generated-index.js');
+var hsl2hsv = require('./hsl2hsv.js');
console.log(hsl2hsv.p);
var main = new Map(Object.entries(index.lib));
diff --git a/test/chunking-form/samples/namespace-reexports/_expected/es/main.js b/test/chunking-form/samples/namespace-reexports/_expected/es/main.js
index 3b20f2399..716aeaba0 100644
--- a/test/chunking-form/samples/namespace-reexports/_expected/es/main.js
+++ b/test/chunking-form/samples/namespace-reexports/_expected/es/main.js
@@ -1,5 +1,5 @@
-import { p } from './hsl2hsv.js';
import { l as lib } from './generated-index.js';
+import { p } from './hsl2hsv.js';
console.log(p);
var main = new Map(Object.entries(lib));
diff --git a/test/chunking-form/samples/namespace-reexports/_expected/system/main.js b/test/chunking-form/samples/namespace-reexports/_expected/system/main.js
index bcb493582..cb3c1c8b4 100644
--- a/test/chunking-form/samples/namespace-reexports/_expected/system/main.js
+++ b/test/chunking-form/samples/namespace-reexports/_expected/system/main.js
@@ -1,11 +1,11 @@
-System.register(['./hsl2hsv.js', './generated-index.js'], function (exports) {
+System.register(['./generated-index.js', './hsl2hsv.js'], function (exports) {
'use strict';
- var p, lib;
+ var lib, p;
return {
setters: [function (module) {
- p = module.p;
- }, function (module) {
lib = module.l;
+ }, function (module) {
+ p = module.p;
}],
execute: function () {
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/amd/main-a.js b/test/chunking-form/samples/namespace-tracing/_expected/amd/main-a.js
index 57ff8799c..5b5590c79 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/amd/main-a.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/amd/main-a.js
@@ -1,4 +1,4 @@
-define(['./generated-broken', './generated-foo'], function (broken, foo) { 'use strict';
+define(['./generated-foo', './generated-broken'], function (foo, broken) { 'use strict';
foo.foo();
broken.broken();
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/amd/main-b.js b/test/chunking-form/samples/namespace-tracing/_expected/amd/main-b.js
index a76554407..70d5de787 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/amd/main-b.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/amd/main-b.js
@@ -1,4 +1,4 @@
-define(['./generated-broken', './generated-foo', './generated-bar'], function (broken, foo, bar) { 'use strict';
+define(['./generated-foo', './generated-bar', './generated-broken'], function (foo, bar, broken) { 'use strict';
foo.foo();
broken.broken();
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/amd/main-c.js b/test/chunking-form/samples/namespace-tracing/_expected/amd/main-c.js
index 3294fe2a7..da9307f8f 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/amd/main-c.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/amd/main-c.js
@@ -1,4 +1,4 @@
-define(['./generated-broken', './generated-bar'], function (broken, bar) { 'use strict';
+define(['./generated-bar', './generated-broken'], function (bar, broken) { 'use strict';
bar.bar();
broken.broken();
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-a.js b/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-a.js
index dc1c5e9f6..d1ae30799 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-a.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-a.js
@@ -1,7 +1,7 @@
'use strict';
-var broken = require('./generated-broken.js');
var foo = require('./generated-foo.js');
+var broken = require('./generated-broken.js');
foo.foo();
broken.broken();
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-b.js b/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-b.js
index 6ee2b541f..8af754c03 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-b.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-b.js
@@ -1,8 +1,8 @@
'use strict';
-var broken = require('./generated-broken.js');
var foo = require('./generated-foo.js');
var bar = require('./generated-bar.js');
+var broken = require('./generated-broken.js');
foo.foo();
broken.broken();
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-c.js b/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-c.js
index 54cdd8631..520e431fe 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-c.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-c.js
@@ -1,7 +1,7 @@
'use strict';
-var broken = require('./generated-broken.js');
var bar = require('./generated-bar.js');
+var broken = require('./generated-broken.js');
bar.bar();
broken.broken();
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/es/main-a.js b/test/chunking-form/samples/namespace-tracing/_expected/es/main-a.js
index 36c262d32..bb705dba6 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/es/main-a.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/es/main-a.js
@@ -1,5 +1,5 @@
-import { b as broken } from './generated-broken.js';
import { f as foo } from './generated-foo.js';
+import { b as broken } from './generated-broken.js';
foo();
broken();
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/es/main-b.js b/test/chunking-form/samples/namespace-tracing/_expected/es/main-b.js
index 6da3133e3..09e3b0f5a 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/es/main-b.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/es/main-b.js
@@ -1,6 +1,6 @@
-import { b as broken } from './generated-broken.js';
import { f as foo } from './generated-foo.js';
import { b as bar } from './generated-bar.js';
+import { b as broken } from './generated-broken.js';
foo();
broken();
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/es/main-c.js b/test/chunking-form/samples/namespace-tracing/_expected/es/main-c.js
index ba24b661e..e5cc6a878 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/es/main-c.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/es/main-c.js
@@ -1,5 +1,5 @@
-import { b as broken } from './generated-broken.js';
import { b as bar } from './generated-bar.js';
+import { b as broken } from './generated-broken.js';
bar();
broken();
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/system/main-a.js b/test/chunking-form/samples/namespace-tracing/_expected/system/main-a.js
index a67343083..baeeced58 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/system/main-a.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/system/main-a.js
@@ -1,11 +1,11 @@
-System.register(['./generated-broken.js', './generated-foo.js'], function () {
+System.register(['./generated-foo.js', './generated-broken.js'], function () {
'use strict';
- var broken, foo;
+ var foo, broken;
return {
setters: [function (module) {
- broken = module.b;
- }, function (module) {
foo = module.f;
+ }, function (module) {
+ broken = module.b;
}],
execute: function () {
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/system/main-b.js b/test/chunking-form/samples/namespace-tracing/_expected/system/main-b.js
index 720016f85..557263c8f 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/system/main-b.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/system/main-b.js
@@ -1,13 +1,13 @@
-System.register(['./generated-broken.js', './generated-foo.js', './generated-bar.js'], function () {
+System.register(['./generated-foo.js', './generated-bar.js', './generated-broken.js'], function () {
'use strict';
- var broken, foo, bar;
+ var foo, bar, broken;
return {
setters: [function (module) {
- broken = module.b;
- }, function (module) {
foo = module.f;
}, function (module) {
bar = module.b;
+ }, function (module) {
+ broken = module.b;
}],
execute: function () {
diff --git a/test/chunking-form/samples/namespace-tracing/_expected/system/main-c.js b/test/chunking-form/samples/namespace-tracing/_expected/system/main-c.js
index 7a4c64521..eb1d38991 100644
--- a/test/chunking-form/samples/namespace-tracing/_expected/system/main-c.js
+++ b/test/chunking-form/samples/namespace-tracing/_expected/system/main-c.js
@@ -1,11 +1,11 @@
-System.register(['./generated-broken.js', './generated-bar.js'], function () {
+System.register(['./generated-bar.js', './generated-broken.js'], function () {
'use strict';
- var broken, bar;
+ var bar, broken;
return {
setters: [function (module) {
- broken = module.b;
- }, function (module) {
bar = module.b;
+ }, function (module) {
+ broken = module.b;
}],
execute: function () {
diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/main.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/main.js
index 7f84fe836..ee86eabf5 100644
--- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/main.js
+++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/main.js
@@ -1,4 +1,4 @@
-define(['external', './commonjs'], function (external, commonjs) { 'use strict';
+define(['./commonjs', 'external'], function (commonjs, external) { 'use strict';
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/main.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/main.js
index ecc2cb7ff..4d7f52a73 100644
--- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/main.js
+++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/main.js
@@ -1,7 +1,7 @@
'use strict';
-var external = require('external');
var commonjs = require('./commonjs.js');
+var external = require('external');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/main.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/main.js
index 6d5496583..8b62c6965 100644
--- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/main.js
+++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/main.js
@@ -1,4 +1,4 @@
-import external from 'external';
import commonjs from './commonjs.js';
+import external from 'external';
console.log(commonjs, external);
diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/main.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/main.js
index 8ff0da14a..c6fe1949d 100644
--- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/main.js
+++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/main.js
@@ -1,11 +1,11 @@
-System.register(['external', './commonjs.js'], function () {
+System.register(['./commonjs.js', 'external'], function () {
'use strict';
- var external, commonjs;
+ var commonjs, external;
return {
setters: [function (module) {
- external = module.default;
- }, function (module) {
commonjs = module.default;
+ }, function (module) {
+ external = module.default;
}],
execute: function () {
diff --git a/test/chunking-form/samples/preserve-modules-root/_config.js b/test/chunking-form/samples/preserve-modules-root/_config.js
index 4a2c217a2..61ff285d3 100644
--- a/test/chunking-form/samples/preserve-modules-root/_config.js
+++ b/test/chunking-form/samples/preserve-modules-root/_config.js
@@ -8,9 +8,7 @@ module.exports = {
input: ['src/under-build.js', 'src/below/module.js'],
plugins: [
resolve({
- customResolveOptions: {
- moduleDirectory: ['custom_modules']
- }
+ moduleDirectories: ['custom_modules']
}),
commonjs()
],
diff --git a/test/form/samples/side-effect-default-reexport/_expected.js b/test/form/samples/side-effect-default-reexport/_expected.js
index cd5b9c8ed..03315b53f 100644
--- a/test/form/samples/side-effect-default-reexport/_expected.js
+++ b/test/form/samples/side-effect-default-reexport/_expected.js
@@ -6,25 +6,39 @@ var Item = {
name: 'item'
};
+/* default-export/index2 */
Menu.Item1 = Item;
+/* default-export/index */
Menu.Item2 = Item;
var NamedExport = {
name: 'menu'
};
+var Item$1 = {
+ name: 'item'
+};
+
+/* named-export/index2 */
+NamedExport.Item1 = Item$1;
+
+/* named-export/index */
+NamedExport.Item2 = Item$1;
+
var Menu$1 = {
name: 'menu'
};
-var Item$1 = {
+var Item$2 = {
name: 'item'
};
-Menu$1.Item1 = Item$1;
+/* default-export2/index2 */
+Menu$1.Item1 = Item$2;
-Menu$1.Item2 = Item$1;
+/* default-export2/index */
+Menu$1.Item2 = Item$2;
console.log('test-package-default-export', Menu.Item);
console.log('test-package-named-export', NamedExport.Item);
diff --git a/test/form/samples/side-effect-default-reexport/default-export/index.js b/test/form/samples/side-effect-default-reexport/default-export/index.js
index 4692e4c07..7ea5cfd23 100644
--- a/test/form/samples/side-effect-default-reexport/default-export/index.js
+++ b/test/form/samples/side-effect-default-reexport/default-export/index.js
@@ -1,6 +1,7 @@
import Menu from './index2';
import Item from './item';
+/* default-export/index */
Menu.Item2 = Item;
export default Menu;
diff --git a/test/form/samples/side-effect-default-reexport/default-export/index2.js b/test/form/samples/side-effect-default-reexport/default-export/index2.js
index 6205075bb..ef968a9c9 100644
--- a/test/form/samples/side-effect-default-reexport/default-export/index2.js
+++ b/test/form/samples/side-effect-default-reexport/default-export/index2.js
@@ -1,6 +1,7 @@
import Menu from './menu';
import Item from './item';
+/* default-export/index2 */
Menu.Item1 = Item;
export default Menu;
diff --git a/test/form/samples/side-effect-default-reexport/default-export2/index.js b/test/form/samples/side-effect-default-reexport/default-export2/index.js
index 4692e4c07..36024c3f9 100644
--- a/test/form/samples/side-effect-default-reexport/default-export2/index.js
+++ b/test/form/samples/side-effect-default-reexport/default-export2/index.js
@@ -1,6 +1,7 @@
import Menu from './index2';
import Item from './item';
+/* default-export2/index */
Menu.Item2 = Item;
export default Menu;
diff --git a/test/form/samples/side-effect-default-reexport/default-export2/index2.js b/test/form/samples/side-effect-default-reexport/default-export2/index2.js
index 6205075bb..2a00d7268 100644
--- a/test/form/samples/side-effect-default-reexport/default-export2/index2.js
+++ b/test/form/samples/side-effect-default-reexport/default-export2/index2.js
@@ -1,6 +1,7 @@
import Menu from './menu';
import Item from './item';
+/* default-export2/index2 */
Menu.Item1 = Item;
export default Menu;
diff --git a/test/form/samples/side-effect-default-reexport/named-export/index.js b/test/form/samples/side-effect-default-reexport/named-export/index.js
index 9c39fe3cd..354790c11 100644
--- a/test/form/samples/side-effect-default-reexport/named-export/index.js
+++ b/test/form/samples/side-effect-default-reexport/named-export/index.js
@@ -1,6 +1,7 @@
import { Menu } from './index2';
import Item from './item';
+/* named-export/index */
Menu.Item2 = Item;
export { Menu };
diff --git a/test/form/samples/side-effect-default-reexport/named-export/index2.js b/test/form/samples/side-effect-default-reexport/named-export/index2.js
index 9217f2505..056fd976c 100644
--- a/test/form/samples/side-effect-default-reexport/named-export/index2.js
+++ b/test/form/samples/side-effect-default-reexport/named-export/index2.js
@@ -1,6 +1,7 @@
import Menu from './menu';
import Item from './item';
+/* named-export/index2 */
Menu.Item1 = Item;
export { Menu };
diff --git a/test/form/samples/supports-core-js/_expected.js b/test/form/samples/supports-core-js/_expected.js
index 61e5b3c12..65c863fb9 100644
--- a/test/form/samples/supports-core-js/_expected.js
+++ b/test/form/samples/supports-core-js/_expected.js
@@ -27,7 +27,7 @@ var fails = function (exec) {
}
};
-// Thank's IE8 for his funny defineProperty
+// Detect IE8's incomplete defineProperty implementation
var descriptors = !fails(function () {
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
});
@@ -39,7 +39,7 @@ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
// `Object.prototype.propertyIsEnumerable` method implementation
-// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
+// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
var descriptor = getOwnPropertyDescriptor(this, V);
return !!descriptor && descriptor.enumerable;
@@ -76,7 +76,7 @@ var indexedObject = fails(function () {
} : Object;
// `RequireObjectCoercible` abstract operation
-// https://tc39.github.io/ecma262/#sec-requireobjectcoercible
+// https://tc39.es/ecma262/#sec-requireobjectcoercible
var requireObjectCoercible = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
@@ -95,7 +95,7 @@ var isObject = function (it) {
};
// `ToPrimitive` abstract operation
-// https://tc39.github.io/ecma262/#sec-toprimitive
+// https://tc39.es/ecma262/#sec-toprimitive
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
var toPrimitive = function (input, PREFERRED_STRING) {
@@ -131,7 +131,7 @@ var ie8DomDefine = !descriptors && !fails(function () {
var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// `Object.getOwnPropertyDescriptor` method
-// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
+// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
O = toIndexedObject(O);
P = toPrimitive(P, true);
@@ -154,7 +154,7 @@ var anObject = function (it) {
var nativeDefineProperty = Object.defineProperty;
// `Object.defineProperty` method
-// https://tc39.github.io/ecma262/#sec-object.defineproperty
+// https://tc39.es/ecma262/#sec-object.defineproperty
var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
@@ -212,9 +212,9 @@ var shared = createCommonjsModule(function (module) {
(module.exports = function (key, value) {
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
})('versions', []).push({
- version: '3.8.1',
+ version: '3.8.2',
mode: 'global',
- copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
+ copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
});
});
@@ -340,7 +340,7 @@ var ceil = Math.ceil;
var floor = Math.floor;
// `ToInteger` abstract operation
-// https://tc39.github.io/ecma262/#sec-tointeger
+// https://tc39.es/ecma262/#sec-tointeger
var toInteger = function (argument) {
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
};
@@ -348,7 +348,7 @@ var toInteger = function (argument) {
var min = Math.min;
// `ToLength` abstract operation
-// https://tc39.github.io/ecma262/#sec-tolength
+// https://tc39.es/ecma262/#sec-tolength
var toLength = function (argument) {
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
};
@@ -386,10 +386,10 @@ var createMethod = function (IS_INCLUDES) {
var arrayIncludes = {
// `Array.prototype.includes` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.includes
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
includes: createMethod(true),
// `Array.prototype.indexOf` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
indexOf: createMethod(false)
};
@@ -423,7 +423,7 @@ var enumBugKeys = [
var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
// `Object.getOwnPropertyNames` method
-// https://tc39.github.io/ecma262/#sec-object.getownpropertynames
+// https://tc39.es/ecma262/#sec-object.getownpropertynames
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return objectKeysInternal(O, hiddenKeys$1);
};
@@ -542,25 +542,25 @@ var useSymbolAsUid = nativeSymbol
&& typeof Symbol.iterator == 'symbol';
// `IsArray` abstract operation
-// https://tc39.github.io/ecma262/#sec-isarray
+// https://tc39.es/ecma262/#sec-isarray
var isArray = Array.isArray || function isArray(arg) {
return classofRaw(arg) == 'Array';
};
// `ToObject` abstract operation
-// https://tc39.github.io/ecma262/#sec-toobject
+// https://tc39.es/ecma262/#sec-toobject
var toObject = function (argument) {
return Object(requireObjectCoercible(argument));
};
// `Object.keys` method
-// https://tc39.github.io/ecma262/#sec-object.keys
+// https://tc39.es/ecma262/#sec-object.keys
var objectKeys = Object.keys || function keys(O) {
return objectKeysInternal(O, enumBugKeys);
};
// `Object.defineProperties` method
-// https://tc39.github.io/ecma262/#sec-object.defineproperties
+// https://tc39.es/ecma262/#sec-object.defineproperties
var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = objectKeys(Properties);
@@ -631,7 +631,7 @@ var NullProtoObject = function () {
hiddenKeys[IE_PROTO] = true;
// `Object.create` method
-// https://tc39.github.io/ecma262/#sec-object.create
+// https://tc39.es/ecma262/#sec-object.create
var objectCreate = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
@@ -740,7 +740,7 @@ var functionBindContext = function (fn, that, length) {
var SPECIES = wellKnownSymbol('species');
// `ArraySpeciesCreate` abstract operation
-// https://tc39.github.io/ecma262/#sec-arrayspeciescreate
+// https://tc39.es/ecma262/#sec-arrayspeciescreate
var arraySpeciesCreate = function (originalArray, length) {
var C;
if (isArray(originalArray)) {
@@ -796,25 +796,25 @@ var createMethod$1 = function (TYPE) {
var arrayIteration = {
// `Array.prototype.forEach` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
+ // https://tc39.es/ecma262/#sec-array.prototype.foreach
forEach: createMethod$1(0),
// `Array.prototype.map` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.map
+ // https://tc39.es/ecma262/#sec-array.prototype.map
map: createMethod$1(1),
// `Array.prototype.filter` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.filter
+ // https://tc39.es/ecma262/#sec-array.prototype.filter
filter: createMethod$1(2),
// `Array.prototype.some` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.some
+ // https://tc39.es/ecma262/#sec-array.prototype.some
some: createMethod$1(3),
// `Array.prototype.every` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.every
+ // https://tc39.es/ecma262/#sec-array.prototype.every
every: createMethod$1(4),
// `Array.prototype.find` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.find
+ // https://tc39.es/ecma262/#sec-array.prototype.find
find: createMethod$1(5),
// `Array.prototype.findIndex` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
+ // https://tc39.es/ecma262/#sec-array.prototype.findIndex
findIndex: createMethod$1(6),
// `Array.prototype.filterOut` method
// https://github.com/tc39/proposal-array-filtering
@@ -946,7 +946,7 @@ var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
};
// `Symbol` constructor
-// https://tc39.github.io/ecma262/#sec-symbol-constructor
+// https://tc39.es/ecma262/#sec-symbol-constructor
if (!nativeSymbol) {
$Symbol = function Symbol() {
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
@@ -1003,7 +1003,7 @@ $forEach(objectKeys(WellKnownSymbolsStore$1), function (name) {
_export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
// `Symbol.for` method
- // https://tc39.github.io/ecma262/#sec-symbol.for
+ // https://tc39.es/ecma262/#sec-symbol.for
'for': function (key) {
var string = String(key);
if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
@@ -1013,7 +1013,7 @@ _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
return symbol;
},
// `Symbol.keyFor` method
- // https://tc39.github.io/ecma262/#sec-symbol.keyfor
+ // https://tc39.es/ecma262/#sec-symbol.keyfor
keyFor: function keyFor(sym) {
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
@@ -1024,25 +1024,25 @@ _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
_export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, {
// `Object.create` method
- // https://tc39.github.io/ecma262/#sec-object.create
+ // https://tc39.es/ecma262/#sec-object.create
create: $create,
// `Object.defineProperty` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperty
+ // https://tc39.es/ecma262/#sec-object.defineproperty
defineProperty: $defineProperty,
// `Object.defineProperties` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
+ // https://tc39.es/ecma262/#sec-object.defineproperties
defineProperties: $defineProperties,
// `Object.getOwnPropertyDescriptor` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
getOwnPropertyDescriptor: $getOwnPropertyDescriptor
});
_export({ target: 'Object', stat: true, forced: !nativeSymbol }, {
// `Object.getOwnPropertyNames` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
getOwnPropertyNames: $getOwnPropertyNames,
// `Object.getOwnPropertySymbols` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
+ // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
getOwnPropertySymbols: $getOwnPropertySymbols
});
@@ -1055,7 +1055,7 @@ _export({ target: 'Object', stat: true, forced: fails(function () { objectGetOwn
});
// `JSON.stringify` method behavior with symbols
-// https://tc39.github.io/ecma262/#sec-json.stringify
+// https://tc39.es/ecma262/#sec-json.stringify
if ($stringify) {
var FORCED_JSON_STRINGIFY = !nativeSymbol || fails(function () {
var symbol = $Symbol();
@@ -1087,18 +1087,18 @@ if ($stringify) {
}
// `Symbol.prototype[@@toPrimitive]` method
-// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
+// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) {
createNonEnumerableProperty($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
}
// `Symbol.prototype[@@toStringTag]` property
-// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
+// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
setToStringTag($Symbol, SYMBOL);
hiddenKeys[HIDDEN] = true;
// `Symbol.asyncIterator` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.asynciterator
+// https://tc39.es/ecma262/#sec-symbol.asynciterator
defineWellKnownSymbol('asyncIterator');
var defineProperty$2 = objectDefineProperty.f;
@@ -1145,50 +1145,51 @@ if (descriptors && typeof NativeSymbol == 'function' && (!('description' in Nati
}
// `Symbol.hasInstance` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.hasinstance
+// https://tc39.es/ecma262/#sec-symbol.hasinstance
defineWellKnownSymbol('hasInstance');
// `Symbol.isConcatSpreadable` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.isconcatspreadable
+// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
defineWellKnownSymbol('isConcatSpreadable');
// `Symbol.iterator` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.iterator
+// https://tc39.es/ecma262/#sec-symbol.iterator
defineWellKnownSymbol('iterator');
// `Symbol.match` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.match
+// https://tc39.es/ecma262/#sec-symbol.match
defineWellKnownSymbol('match');
// `Symbol.matchAll` well-known symbol
+// https://tc39.es/ecma262/#sec-symbol.matchall
defineWellKnownSymbol('matchAll');
// `Symbol.replace` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.replace
+// https://tc39.es/ecma262/#sec-symbol.replace
defineWellKnownSymbol('replace');
// `Symbol.search` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.search
+// https://tc39.es/ecma262/#sec-symbol.search
defineWellKnownSymbol('search');
// `Symbol.species` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.species
+// https://tc39.es/ecma262/#sec-symbol.species
defineWellKnownSymbol('species');
// `Symbol.split` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.split
+// https://tc39.es/ecma262/#sec-symbol.split
defineWellKnownSymbol('split');
// `Symbol.toPrimitive` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.toprimitive
+// https://tc39.es/ecma262/#sec-symbol.toprimitive
defineWellKnownSymbol('toPrimitive');
// `Symbol.toStringTag` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.tostringtag
+// https://tc39.es/ecma262/#sec-symbol.tostringtag
defineWellKnownSymbol('toStringTag');
// `Symbol.unscopables` well-known symbol
-// https://tc39.github.io/ecma262/#sec-symbol.unscopables
+// https://tc39.es/ecma262/#sec-symbol.unscopables
defineWellKnownSymbol('unscopables');
var correctPrototypeGetter = !fails(function () {
@@ -1201,7 +1202,7 @@ var IE_PROTO$1 = sharedKey('IE_PROTO');
var ObjectPrototype$1 = Object.prototype;
// `Object.getPrototypeOf` method
-// https://tc39.github.io/ecma262/#sec-object.getprototypeof
+// https://tc39.es/ecma262/#sec-object.getprototypeof
var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
O = toObject(O);
if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
@@ -1217,7 +1218,7 @@ var aPossiblePrototype = function (it) {
};
// `Object.setPrototypeOf` method
-// https://tc39.github.io/ecma262/#sec-object.setprototypeof
+// https://tc39.es/ecma262/#sec-object.setprototypeof
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
@@ -1349,6 +1350,7 @@ var $AggregateError = function AggregateError(errors, message) {
var that = this;
if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);
if (objectSetPrototypeOf) {
+ // eslint-disable-next-line unicorn/error-message
that = objectSetPrototypeOf(new Error(undefined), objectGetPrototypeOf(that));
}
if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));
@@ -1364,6 +1366,8 @@ $AggregateError.prototype = objectCreate(Error.prototype, {
name: createPropertyDescriptor(5, 'AggregateError')
});
+// `AggregateError` constructor
+// https://tc39.es/ecma262/#sec-aggregate-error-constructor
_export({ global: true }, {
AggregateError: $AggregateError
});
@@ -1386,7 +1390,7 @@ var createProperty = function (object, key, value) {
};
// `Array.from` method implementation
-// https://tc39.github.io/ecma262/#sec-array.from
+// https://tc39.es/ecma262/#sec-array.from
var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var C = typeof this == 'function' ? this : Array;
@@ -1460,13 +1464,13 @@ var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
});
// `Array.from` method
-// https://tc39.github.io/ecma262/#sec-array.from
+// https://tc39.es/ecma262/#sec-array.from
_export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
from: arrayFrom
});
// `Array.isArray` method
-// https://tc39.github.io/ecma262/#sec-array.isarray
+// https://tc39.es/ecma262/#sec-array.isarray
_export({ target: 'Array', stat: true }, {
isArray: isArray
});
@@ -1477,7 +1481,7 @@ var ISNT_GENERIC = fails(function () {
});
// `Array.of` method
-// https://tc39.github.io/ecma262/#sec-array.of
+// https://tc39.es/ecma262/#sec-array.of
// WebKit Array.of isn't generic
_export({ target: 'Array', stat: true, forced: ISNT_GENERIC }, {
of: function of(/* ...args */) {
@@ -1550,7 +1554,7 @@ var isConcatSpreadable = function (O) {
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
// `Array.prototype.concat` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.concat
+// https://tc39.es/ecma262/#sec-array.prototype.concat
// with adding support of @@isConcatSpreadable and @@species
_export({ target: 'Array', proto: true, forced: FORCED }, {
concat: function concat(arg) { // eslint-disable-line no-unused-vars
@@ -1577,7 +1581,7 @@ _export({ target: 'Array', proto: true, forced: FORCED }, {
var min$2 = Math.min;
// `Array.prototype.copyWithin` method implementation
-// https://tc39.github.io/ecma262/#sec-array.prototype.copywithin
+// https://tc39.es/ecma262/#sec-array.prototype.copywithin
var arrayCopyWithin = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
var O = toObject(this);
var len = toLength(O.length);
@@ -1603,7 +1607,7 @@ var UNSCOPABLES = wellKnownSymbol('unscopables');
var ArrayPrototype$1 = Array.prototype;
// Array.prototype[@@unscopables]
-// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
+// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
objectDefineProperty.f(ArrayPrototype$1, UNSCOPABLES, {
configurable: true,
@@ -1617,12 +1621,12 @@ var addToUnscopables = function (key) {
};
// `Array.prototype.copyWithin` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.copywithin
+// https://tc39.es/ecma262/#sec-array.prototype.copywithin
_export({ target: 'Array', proto: true }, {
copyWithin: arrayCopyWithin
});
-// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
+// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('copyWithin');
var arrayMethodIsStrict = function (METHOD_NAME, argument) {
@@ -1665,7 +1669,7 @@ var STRICT_METHOD = arrayMethodIsStrict('every');
var USES_TO_LENGTH = arrayMethodUsesToLength('every');
// `Array.prototype.every` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.every
+// https://tc39.es/ecma262/#sec-array.prototype.every
_export({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
every: function every(callbackfn /* , thisArg */) {
return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
@@ -1673,7 +1677,7 @@ _export({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGT
});
// `Array.prototype.fill` method implementation
-// https://tc39.github.io/ecma262/#sec-array.prototype.fill
+// https://tc39.es/ecma262/#sec-array.prototype.fill
var arrayFill = function fill(value /* , start = 0, end = @length */) {
var O = toObject(this);
var length = toLength(O.length);
@@ -1686,12 +1690,12 @@ var arrayFill = function fill(value /* , start = 0, end = @length */) {
};
// `Array.prototype.fill` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.fill
+// https://tc39.es/ecma262/#sec-array.prototype.fill
_export({ target: 'Array', proto: true }, {
fill: arrayFill
});
-// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
+// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('fill');
var $filter = arrayIteration.filter;
@@ -1703,7 +1707,7 @@ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
var USES_TO_LENGTH$1 = arrayMethodUsesToLength('filter');
// `Array.prototype.filter` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.filter
+// https://tc39.es/ecma262/#sec-array.prototype.filter
// with adding support of @@species
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH$1 }, {
filter: function filter(callbackfn /* , thisArg */) {
@@ -1724,14 +1728,14 @@ var USES_TO_LENGTH$2 = arrayMethodUsesToLength(FIND);
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
// `Array.prototype.find` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.find
+// https://tc39.es/ecma262/#sec-array.prototype.find
_export({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH$2 }, {
find: function find(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
-// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
+// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables(FIND);
var $findIndex = arrayIteration.findIndex;
@@ -1747,14 +1751,14 @@ var USES_TO_LENGTH$3 = arrayMethodUsesToLength(FIND_INDEX);
if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES$1 = false; });
// `Array.prototype.findIndex` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.findindex
+// https://tc39.es/ecma262/#sec-array.prototype.findindex
_export({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 || !USES_TO_LENGTH$3 }, {
findIndex: function findIndex(callbackfn /* , that = undefined */) {
return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
-// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
+// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables(FIND_INDEX);
// `FlattenIntoArray` abstract operation
@@ -1786,7 +1790,7 @@ var flattenIntoArray = function (target, original, source, sourceLen, start, dep
var flattenIntoArray_1 = flattenIntoArray;
// `Array.prototype.flat` method
-// https://github.com/tc39/proposal-flatMap
+// https://tc39.es/ecma262/#sec-array.prototype.flat
_export({ target: 'Array', proto: true }, {
flat: function flat(/* depthArg = 1 */) {
var depthArg = arguments.length ? arguments[0] : undefined;
@@ -1799,7 +1803,7 @@ _export({ target: 'Array', proto: true }, {
});
// `Array.prototype.flatMap` method
-// https://github.com/tc39/proposal-flatMap
+// https://tc39.es/ecma262/#sec-array.prototype.flatmap
_export({ target: 'Array', proto: true }, {
flatMap: function flatMap(callbackfn /* , thisArg */) {
var O = toObject(this);
@@ -1820,13 +1824,13 @@ var STRICT_METHOD$1 = arrayMethodIsStrict('forEach');
var USES_TO_LENGTH$4 = arrayMethodUsesToLength('forEach');
// `Array.prototype.forEach` method implementation
-// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
+// https://tc39.es/ecma262/#sec-array.prototype.foreach
var arrayForEach = (!STRICT_METHOD$1 || !USES_TO_LENGTH$4) ? function forEach(callbackfn /* , thisArg */) {
return $forEach$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
} : [].forEach;
// `Array.prototype.forEach` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
+// https://tc39.es/ecma262/#sec-array.prototype.foreach
_export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, {
forEach: arrayForEach
});
@@ -1838,14 +1842,14 @@ var $includes = arrayIncludes.includes;
var USES_TO_LENGTH$5 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
// `Array.prototype.includes` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.includes
+// https://tc39.es/ecma262/#sec-array.prototype.includes
_export({ target: 'Array', proto: true, forced: !USES_TO_LENGTH$5 }, {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
-// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
+// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('includes');
var $indexOf = arrayIncludes.indexOf;
@@ -1859,7 +1863,7 @@ var STRICT_METHOD$2 = arrayMethodIsStrict('indexOf');
var USES_TO_LENGTH$6 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
// `Array.prototype.indexOf` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.indexof
+// https://tc39.es/ecma262/#sec-array.prototype.indexof
_export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$2 || !USES_TO_LENGTH$6 }, {
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
return NEGATIVE_ZERO
@@ -1875,7 +1879,7 @@ var ES3_STRINGS = indexedObject != Object;
var STRICT_METHOD$3 = arrayMethodIsStrict('join', ',');
// `Array.prototype.join` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.join
+// https://tc39.es/ecma262/#sec-array.prototype.join
_export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$3 }, {
join: function join(separator) {
return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
@@ -1891,7 +1895,7 @@ var USES_TO_LENGTH$7 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1:
var FORCED$1 = NEGATIVE_ZERO$1 || !STRICT_METHOD$4 || !USES_TO_LENGTH$7;
// `Array.prototype.lastIndexOf` method implementation
-// https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
+// https://tc39.es/ecma262/#sec-array.prototype.lastindexof
var arrayLastIndexOf = FORCED$1 ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
// convert -0 to +0
if (NEGATIVE_ZERO$1) return nativeLastIndexOf.apply(this, arguments) || 0;
@@ -1905,7 +1909,7 @@ var arrayLastIndexOf = FORCED$1 ? function lastIndexOf(searchElement /* , fromIn
} : nativeLastIndexOf;
// `Array.prototype.lastIndexOf` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
+// https://tc39.es/ecma262/#sec-array.prototype.lastindexof
_export({ target: 'Array', proto: true, forced: arrayLastIndexOf !== [].lastIndexOf }, {
lastIndexOf: arrayLastIndexOf
});
@@ -1919,7 +1923,7 @@ var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map');
var USES_TO_LENGTH$8 = arrayMethodUsesToLength('map');
// `Array.prototype.map` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.map
+// https://tc39.es/ecma262/#sec-array.prototype.map
// with adding support of @@species
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 || !USES_TO_LENGTH$8 }, {
map: function map(callbackfn /* , thisArg */) {
@@ -1956,10 +1960,10 @@ var createMethod$2 = function (IS_RIGHT) {
var arrayReduce = {
// `Array.prototype.reduce` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
left: createMethod$2(false),
// `Array.prototype.reduceRight` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
+ // https://tc39.es/ecma262/#sec-array.prototype.reduceright
right: createMethod$2(true)
};
@@ -1978,7 +1982,7 @@ var USES_TO_LENGTH$9 = arrayMethodUsesToLength('reduce', { 1: 0 });
var CHROME_BUG = !engineIsNode && engineV8Version > 79 && engineV8Version < 83;
// `Array.prototype.reduce` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
+// https://tc39.es/ecma262/#sec-array.prototype.reduce
_export({ target: 'Array', proto: true, forced: !STRICT_METHOD$5 || !USES_TO_LENGTH$9 || CHROME_BUG }, {
reduce: function reduce(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
@@ -1999,7 +2003,7 @@ var USES_TO_LENGTH$a = arrayMethodUsesToLength('reduce', { 1: 0 });
var CHROME_BUG$1 = !engineIsNode && engineV8Version > 79 && engineV8Version < 83;
// `Array.prototype.reduceRight` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
+// https://tc39.es/ecma262/#sec-array.prototype.reduceright
_export({ target: 'Array', proto: true, forced: !STRICT_METHOD$6 || !USES_TO_LENGTH$a || CHROME_BUG$1 }, {
reduceRight: function reduceRight(callbackfn /* , initialValue */) {
return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
@@ -2010,7 +2014,7 @@ var nativeReverse = [].reverse;
var test$1 = [1, 2];
// `Array.prototype.reverse` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.reverse
+// https://tc39.es/ecma262/#sec-array.prototype.reverse
// fix for Safari 12.0 bug
// https://bugs.webkit.org/show_bug.cgi?id=188794
_export({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, {
@@ -2029,7 +2033,7 @@ var nativeSlice = [].slice;
var max$1 = Math.max;
// `Array.prototype.slice` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.slice
+// https://tc39.es/ecma262/#sec-array.prototype.slice
// fallback for not array-like ES3 strings and DOM objects
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 || !USES_TO_LENGTH$b }, {
slice: function slice(start, end) {
@@ -2067,7 +2071,7 @@ var STRICT_METHOD$7 = arrayMethodIsStrict('some');
var USES_TO_LENGTH$c = arrayMethodUsesToLength('some');
// `Array.prototype.some` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.some
+// https://tc39.es/ecma262/#sec-array.prototype.some
_export({ target: 'Array', proto: true, forced: !STRICT_METHOD$7 || !USES_TO_LENGTH$c }, {
some: function some(callbackfn /* , thisArg */) {
return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
@@ -2091,7 +2095,7 @@ var STRICT_METHOD$8 = arrayMethodIsStrict('sort');
var FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$8;
// `Array.prototype.sort` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.sort
+// https://tc39.es/ecma262/#sec-array.prototype.sort
_export({ target: 'Array', proto: true, forced: FORCED$2 }, {
sort: function sort(comparefn) {
return comparefn === undefined
@@ -2109,7 +2113,7 @@ var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
// `Array.prototype.splice` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.splice
+// https://tc39.es/ecma262/#sec-array.prototype.splice
// with adding support of @@species
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 || !USES_TO_LENGTH$d }, {
splice: function splice(start, deleteCount /* , ...items */) {
@@ -2175,19 +2179,21 @@ var setSpecies = function (CONSTRUCTOR_NAME) {
};
// `Array[@@species]` getter
-// https://tc39.github.io/ecma262/#sec-get-array-@@species
+// https://tc39.es/ecma262/#sec-get-array-@@species
setSpecies('Array');
// this method was added to unscopables after implementation
// in popular engines, so it's moved to a separate module
+// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('flat');
// this method was added to unscopables after implementation
// in popular engines, so it's moved to a separate module
+// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('flatMap');
var ITERATOR$3 = wellKnownSymbol('iterator');
@@ -2196,7 +2202,7 @@ var BUGGY_SAFARI_ITERATORS = false;
var returnThis = function () { return this; };
// `%IteratorPrototype%` object
-// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
+// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
if ([].keys) {
@@ -2319,15 +2325,15 @@ var setInternalState$1 = internalState.set;
var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
// `Array.prototype.entries` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.entries
+// https://tc39.es/ecma262/#sec-array.prototype.entries
// `Array.prototype.keys` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.keys
+// https://tc39.es/ecma262/#sec-array.prototype.keys
// `Array.prototype.values` method
-// https://tc39.github.io/ecma262/#sec-array.prototype.values
+// https://tc39.es/ecma262/#sec-array.prototype.values
// `Array.prototype[@@iterator]` method
-// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
+// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
// `CreateArrayIterator` internal method
-// https://tc39.github.io/ecma262/#sec-createarrayiterator
+// https://tc39.es/ecma262/#sec-createarrayiterator
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
setInternalState$1(this, {
type: ARRAY_ITERATOR,
@@ -2336,7 +2342,7 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
kind: kind // kind
});
// `%ArrayIteratorPrototype%.next` method
-// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
+// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
}, function () {
var state = getInternalState$1(this);
var target = state.target;
@@ -2352,11 +2358,11 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values%
-// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
-// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
+// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
+// https://tc39.es/ecma262/#sec-createmappedargumentsobject
iterators.Arguments = iterators.Array;
-// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
+// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
@@ -2373,7 +2379,7 @@ var construct = function (C, argsLength, args) {
};
// `Function.prototype.bind` method implementation
-// https://tc39.github.io/ecma262/#sec-function.prototype.bind
+// https://tc39.es/ecma262/#sec-function.prototype.bind
var functionBind = Function.bind || function bind(that /* , ...args */) {
var fn = aFunction$1(this);
var partArgs = slice.call(arguments, 1);
@@ -2386,7 +2392,7 @@ var functionBind = Function.bind || function bind(that /* , ...args */) {
};
// `Function.prototype.bind` method
-// https://tc39.github.io/ecma262/#sec-function.prototype.bind
+// https://tc39.es/ecma262/#sec-function.prototype.bind
_export({ target: 'Function', proto: true }, {
bind: functionBind
});
@@ -2399,7 +2405,7 @@ var nameRE = /^\s*function ([^ (]*)/;
var NAME = 'name';
// Function instances `.name` property
-// https://tc39.github.io/ecma262/#sec-function-instances-name
+// https://tc39.es/ecma262/#sec-function-instances-name
if (descriptors && !(NAME in FunctionPrototype)) {
defineProperty$4(FunctionPrototype, NAME, {
configurable: true,
@@ -2417,7 +2423,7 @@ var HAS_INSTANCE = wellKnownSymbol('hasInstance');
var FunctionPrototype$1 = Function.prototype;
// `Function.prototype[@@hasInstance]` method
-// https://tc39.github.io/ecma262/#sec-function.prototype-@@hasinstance
+// https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance
if (!(HAS_INSTANCE in FunctionPrototype$1)) {
objectDefineProperty.f(FunctionPrototype$1, HAS_INSTANCE, { value: function (O) {
if (typeof this != 'function' || !isObject(O)) return false;
@@ -2429,7 +2435,7 @@ if (!(HAS_INSTANCE in FunctionPrototype$1)) {
}
// `globalThis` object
-// https://github.com/tc39/proposal-global
+// https://tc39.es/ecma262/#sec-globalthis
_export({ global: true }, {
globalThis: global$1
});
@@ -2438,7 +2444,7 @@ var nativeAssign = Object.assign;
var defineProperty$5 = Object.defineProperty;
// `Object.assign` method
-// https://tc39.github.io/ecma262/#sec-object.assign
+// https://tc39.es/ecma262/#sec-object.assign
var objectAssign = !nativeAssign || fails(function () {
// should have correct order of operations (Edge bug)
if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$5({}, 'a', {
@@ -2479,25 +2485,25 @@ var objectAssign = !nativeAssign || fails(function () {
} : nativeAssign;
// `Object.assign` method
-// https://tc39.github.io/ecma262/#sec-object.assign
+// https://tc39.es/ecma262/#sec-object.assign
_export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
assign: objectAssign
});
// `Object.create` method
-// https://tc39.github.io/ecma262/#sec-object.create
+// https://tc39.es/ecma262/#sec-object.create
_export({ target: 'Object', stat: true, sham: !descriptors }, {
create: objectCreate
});
// `Object.defineProperty` method
-// https://tc39.github.io/ecma262/#sec-object.defineproperty
+// https://tc39.es/ecma262/#sec-object.defineproperty
_export({ target: 'Object', stat: true, forced: !descriptors, sham: !descriptors }, {
defineProperty: objectDefineProperty.f
});
// `Object.defineProperties` method
-// https://tc39.github.io/ecma262/#sec-object.defineproperties
+// https://tc39.es/ecma262/#sec-object.defineproperties
_export({ target: 'Object', stat: true, forced: !descriptors, sham: !descriptors }, {
defineProperties: objectDefineProperties
});
@@ -2525,17 +2531,17 @@ var createMethod$3 = function (TO_ENTRIES) {
var objectToArray = {
// `Object.entries` method
- // https://tc39.github.io/ecma262/#sec-object.entries
+ // https://tc39.es/ecma262/#sec-object.entries
entries: createMethod$3(true),
// `Object.values` method
- // https://tc39.github.io/ecma262/#sec-object.values
+ // https://tc39.es/ecma262/#sec-object.values
values: createMethod$3(false)
};
var $entries = objectToArray.entries;
// `Object.entries` method
-// https://tc39.github.io/ecma262/#sec-object.entries
+// https://tc39.es/ecma262/#sec-object.entries
_export({ target: 'Object', stat: true }, {
entries: function entries(O) {
return $entries(O);
@@ -2613,7 +2619,7 @@ var nativeFreeze = Object.freeze;
var FAILS_ON_PRIMITIVES = fails(function () { nativeFreeze(1); });
// `Object.freeze` method
-// https://tc39.github.io/ecma262/#sec-object.freeze
+// https://tc39.es/ecma262/#sec-object.freeze
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !freezing }, {
freeze: function freeze(it) {
return nativeFreeze && isObject(it) ? nativeFreeze(onFreeze(it)) : it;
@@ -2639,7 +2645,7 @@ var FAILS_ON_PRIMITIVES$1 = fails(function () { nativeGetOwnPropertyDescriptor$2
var FORCED$3 = !descriptors || FAILS_ON_PRIMITIVES$1;
// `Object.getOwnPropertyDescriptor` method
-// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
+// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
_export({ target: 'Object', stat: true, forced: FORCED$3, sham: !descriptors }, {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
return nativeGetOwnPropertyDescriptor$2(toIndexedObject(it), key);
@@ -2647,7 +2653,7 @@ _export({ target: 'Object', stat: true, forced: FORCED$3, sham: !descriptors },
});
// `Object.getOwnPropertyDescriptors` method
-// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
+// https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
_export({ target: 'Object', stat: true, sham: !descriptors }, {
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
var O = toIndexedObject(object);
@@ -2669,7 +2675,7 @@ var nativeGetOwnPropertyNames$2 = objectGetOwnPropertyNamesExternal.f;
var FAILS_ON_PRIMITIVES$2 = fails(function () { return !Object.getOwnPropertyNames(1); });
// `Object.getOwnPropertyNames` method
-// https://tc39.github.io/ecma262/#sec-object.getownpropertynames
+// https://tc39.es/ecma262/#sec-object.getownpropertynames
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2 }, {
getOwnPropertyNames: nativeGetOwnPropertyNames$2
});
@@ -2677,7 +2683,7 @@ _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2 }, {
var FAILS_ON_PRIMITIVES$3 = fails(function () { objectGetPrototypeOf(1); });
// `Object.getPrototypeOf` method
-// https://tc39.github.io/ecma262/#sec-object.getprototypeof
+// https://tc39.es/ecma262/#sec-object.getprototypeof
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$3, sham: !correctPrototypeGetter }, {
getPrototypeOf: function getPrototypeOf(it) {
return objectGetPrototypeOf(toObject(it));
@@ -2685,14 +2691,14 @@ _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$3, sham: !co
});
// `SameValue` abstract operation
-// https://tc39.github.io/ecma262/#sec-samevalue
+// https://tc39.es/ecma262/#sec-samevalue
var sameValue = Object.is || function is(x, y) {
// eslint-disable-next-line no-self-compare
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
};
// `Object.is` method
-// https://tc39.github.io/ecma262/#sec-object.is
+// https://tc39.es/ecma262/#sec-object.is
_export({ target: 'Object', stat: true }, {
is: sameValue
});
@@ -2701,7 +2707,7 @@ var nativeIsExtensible = Object.isExtensible;
var FAILS_ON_PRIMITIVES$4 = fails(function () { nativeIsExtensible(1); });
// `Object.isExtensible` method
-// https://tc39.github.io/ecma262/#sec-object.isextensible
+// https://tc39.es/ecma262/#sec-object.isextensible
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$4 }, {
isExtensible: function isExtensible(it) {
return isObject(it) ? nativeIsExtensible ? nativeIsExtensible(it) : true : false;
@@ -2712,7 +2718,7 @@ var nativeIsFrozen = Object.isFrozen;
var FAILS_ON_PRIMITIVES$5 = fails(function () { nativeIsFrozen(1); });
// `Object.isFrozen` method
-// https://tc39.github.io/ecma262/#sec-object.isfrozen
+// https://tc39.es/ecma262/#sec-object.isfrozen
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$5 }, {
isFrozen: function isFrozen(it) {
return isObject(it) ? nativeIsFrozen ? nativeIsFrozen(it) : false : true;
@@ -2723,7 +2729,7 @@ var nativeIsSealed = Object.isSealed;
var FAILS_ON_PRIMITIVES$6 = fails(function () { nativeIsSealed(1); });
// `Object.isSealed` method
-// https://tc39.github.io/ecma262/#sec-object.issealed
+// https://tc39.es/ecma262/#sec-object.issealed
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$6 }, {
isSealed: function isSealed(it) {
return isObject(it) ? nativeIsSealed ? nativeIsSealed(it) : false : true;
@@ -2733,7 +2739,7 @@ _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$6 }, {
var FAILS_ON_PRIMITIVES$7 = fails(function () { objectKeys(1); });
// `Object.keys` method
-// https://tc39.github.io/ecma262/#sec-object.keys
+// https://tc39.es/ecma262/#sec-object.keys
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$7 }, {
keys: function keys(it) {
return objectKeys(toObject(it));
@@ -2748,7 +2754,7 @@ var nativePreventExtensions = Object.preventExtensions;
var FAILS_ON_PRIMITIVES$8 = fails(function () { nativePreventExtensions(1); });
// `Object.preventExtensions` method
-// https://tc39.github.io/ecma262/#sec-object.preventextensions
+// https://tc39.es/ecma262/#sec-object.preventextensions
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$8, sham: !freezing }, {
preventExtensions: function preventExtensions(it) {
return nativePreventExtensions && isObject(it) ? nativePreventExtensions(onFreeze$1(it)) : it;
@@ -2763,7 +2769,7 @@ var nativeSeal = Object.seal;
var FAILS_ON_PRIMITIVES$9 = fails(function () { nativeSeal(1); });
// `Object.seal` method
-// https://tc39.github.io/ecma262/#sec-object.seal
+// https://tc39.es/ecma262/#sec-object.seal
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$9, sham: !freezing }, {
seal: function seal(it) {
return nativeSeal && isObject(it) ? nativeSeal(onFreeze$2(it)) : it;
@@ -2771,7 +2777,7 @@ _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$9, sham: !fr
});
// `Object.setPrototypeOf` method
-// https://tc39.github.io/ecma262/#sec-object.setprototypeof
+// https://tc39.es/ecma262/#sec-object.setprototypeof
_export({ target: 'Object', stat: true }, {
setPrototypeOf: objectSetPrototypeOf
});
@@ -2779,7 +2785,7 @@ _export({ target: 'Object', stat: true }, {
var $values = objectToArray.values;
// `Object.values` method
-// https://tc39.github.io/ecma262/#sec-object.values
+// https://tc39.es/ecma262/#sec-object.values
_export({ target: 'Object', stat: true }, {
values: function values(O) {
return $values(O);
@@ -2787,13 +2793,13 @@ _export({ target: 'Object', stat: true }, {
});
// `Object.prototype.toString` method implementation
-// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
+// https://tc39.es/ecma262/#sec-object.prototype.tostring
var objectToString = toStringTagSupport ? {}.toString : function toString() {
return '[object ' + classof(this) + ']';
};
// `Object.prototype.toString` method
-// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
+// https://tc39.es/ecma262/#sec-object.prototype.tostring
if (!toStringTagSupport) {
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
}
@@ -2808,7 +2814,7 @@ var objectPrototypeAccessorsForced = !fails(function () {
});
// `Object.prototype.__defineGetter__` method
-// https://tc39.github.io/ecma262/#sec-object.prototype.__defineGetter__
+// https://tc39.es/ecma262/#sec-object.prototype.__defineGetter__
if (descriptors) {
_export({ target: 'Object', proto: true, forced: objectPrototypeAccessorsForced }, {
__defineGetter__: function __defineGetter__(P, getter) {
@@ -2818,7 +2824,7 @@ if (descriptors) {
}
// `Object.prototype.__defineSetter__` method
-// https://tc39.github.io/ecma262/#sec-object.prototype.__defineSetter__
+// https://tc39.es/ecma262/#sec-object.prototype.__defineSetter__
if (descriptors) {
_export({ target: 'Object', proto: true, forced: objectPrototypeAccessorsForced }, {
__defineSetter__: function __defineSetter__(P, setter) {
@@ -2830,7 +2836,7 @@ if (descriptors) {
var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
// `Object.prototype.__lookupGetter__` method
-// https://tc39.github.io/ecma262/#sec-object.prototype.__lookupGetter__
+// https://tc39.es/ecma262/#sec-object.prototype.__lookupGetter__
if (descriptors) {
_export({ target: 'Object', proto: true, forced: objectPrototypeAccessorsForced }, {
__lookupGetter__: function __lookupGetter__(P) {
@@ -2847,7 +2853,7 @@ if (descriptors) {
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
// `Object.prototype.__lookupSetter__` method
-// https://tc39.github.io/ecma262/#sec-object.prototype.__lookupSetter__
+// https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__
if (descriptors) {
_export({ target: 'Object', proto: true, forced: objectPrototypeAccessorsForced }, {
__lookupSetter__: function __lookupSetter__(P) {
@@ -2868,7 +2874,7 @@ var nativeFromCodePoint = String.fromCodePoint;
var INCORRECT_LENGTH = !!nativeFromCodePoint && nativeFromCodePoint.length != 1;
// `String.fromCodePoint` method
-// https://tc39.github.io/ecma262/#sec-string.fromcodepoint
+// https://tc39.es/ecma262/#sec-string.fromcodepoint
_export({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, {
fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
var elements = [];
@@ -2887,7 +2893,7 @@ _export({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, {
});
// `String.raw` method
-// https://tc39.github.io/ecma262/#sec-string.raw
+// https://tc39.es/ecma262/#sec-string.raw
_export({ target: 'String', stat: true }, {
raw: function raw(template) {
var rawTemplate = toIndexedObject(template.raw);
@@ -2920,7 +2926,7 @@ var createMethod$4 = function (CONVERT_TO_STRING) {
var stringMultibyte = {
// `String.prototype.codePointAt` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
+ // https://tc39.es/ecma262/#sec-string.prototype.codepointat
codeAt: createMethod$4(false),
// `String.prototype.at` method
// https://github.com/mathiasbynens/String.prototype.at
@@ -2930,7 +2936,7 @@ var stringMultibyte = {
var codeAt = stringMultibyte.codeAt;
// `String.prototype.codePointAt` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
+// https://tc39.es/ecma262/#sec-string.prototype.codepointat
_export({ target: 'String', proto: true }, {
codePointAt: function codePointAt(pos) {
return codeAt(this, pos);
@@ -2940,7 +2946,7 @@ _export({ target: 'String', proto: true }, {
var MATCH = wellKnownSymbol('match');
// `IsRegExp` abstract operation
-// https://tc39.github.io/ecma262/#sec-isregexp
+// https://tc39.es/ecma262/#sec-isregexp
var isRegexp = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
@@ -2984,7 +2990,7 @@ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
}();
// `String.prototype.endsWith` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.endswith
+// https://tc39.es/ecma262/#sec-string.prototype.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));
@@ -3000,7 +3006,7 @@ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_I
});
// `String.prototype.includes` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.includes
+// https://tc39.es/ecma262/#sec-string.prototype.includes
_export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
includes: function includes(searchString /* , position = 0 */) {
return !!~String(requireObjectCoercible(this))
@@ -3009,7 +3015,7 @@ _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes
});
// `RegExp.prototype.flags` getter implementation
-// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
+// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
var regexpFlags = function () {
var that = anObject(this);
var result = '';
@@ -3131,6 +3137,8 @@ if (PATCH) {
var regexpExec = patchedExec;
+// `RegExp.prototype.exec` method
+// https://tc39.es/ecma262/#sec-regexp.prototype.exec
_export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
exec: regexpExec
});
@@ -3263,13 +3271,13 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
var charAt = stringMultibyte.charAt;
// `AdvanceStringIndex` abstract operation
-// https://tc39.github.io/ecma262/#sec-advancestringindex
+// https://tc39.es/ecma262/#sec-advancestringindex
var advanceStringIndex = function (S, index, unicode) {
return index + (unicode ? charAt(S, index).length : 1);
};
// `RegExpExec` abstract operation
-// https://tc39.github.io/ecma262/#sec-regexpexec
+// https://tc39.es/ecma262/#sec-regexpexec
var regexpExecAbstract = function (R, S) {
var exec = R.exec;
if (typeof exec === 'function') {
@@ -3291,14 +3299,14 @@ var regexpExecAbstract = function (R, S) {
fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
return [
// `String.prototype.match` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.match
+ // https://tc39.es/ecma262/#sec-string.prototype.match
function match(regexp) {
var O = requireObjectCoercible(this);
var matcher = regexp == undefined ? undefined : regexp[MATCH];
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
},
// `RegExp.prototype[@@match]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
function (regexp) {
var res = maybeCallNative(nativeMatch, regexp, this);
if (res.done) return res.value;
@@ -3327,7 +3335,7 @@ fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCal
var SPECIES$5 = wellKnownSymbol('species');
// `SpeciesConstructor` abstract operation
-// https://tc39.github.io/ecma262/#sec-speciesconstructor
+// https://tc39.es/ecma262/#sec-speciesconstructor
var speciesConstructor = function (O, defaultConstructor) {
var C = anObject(O).constructor;
var S;
@@ -3400,7 +3408,7 @@ var $matchAll = function (string) {
};
// `String.prototype.matchAll` method
-// https://github.com/tc39/proposal-string-matchall
+// https://tc39.es/ecma262/#sec-string.prototype.matchall
_export({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {
matchAll: function matchAll(regexp) {
var O = requireObjectCoercible(this);
@@ -3427,7 +3435,7 @@ _export({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX },
MATCH_ALL in RegExpPrototype || createNonEnumerableProperty(RegExpPrototype, MATCH_ALL, $matchAll);
// `String.prototype.repeat` method implementation
-// https://tc39.github.io/ecma262/#sec-string.prototype.repeat
+// https://tc39.es/ecma262/#sec-string.prototype.repeat
var stringRepeat = ''.repeat || function repeat(count) {
var str = String(requireObjectCoercible(this));
var result = '';
@@ -3462,10 +3470,10 @@ var createMethod$5 = function (IS_END) {
var stringPad = {
// `String.prototype.padStart` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
+ // https://tc39.es/ecma262/#sec-string.prototype.padstart
start: createMethod$5(false),
// `String.prototype.padEnd` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.padend
+ // https://tc39.es/ecma262/#sec-string.prototype.padend
end: createMethod$5(true)
};
@@ -3479,7 +3487,7 @@ var $padEnd = stringPad.end;
// `String.prototype.padEnd` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.padend
+// https://tc39.es/ecma262/#sec-string.prototype.padend
_export({ target: 'String', proto: true, forced: stringPadWebkitBug }, {
padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
@@ -3490,7 +3498,7 @@ var $padStart = stringPad.start;
// `String.prototype.padStart` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.padstart
+// https://tc39.es/ecma262/#sec-string.prototype.padstart
_export({ target: 'String', proto: true, forced: stringPadWebkitBug }, {
padStart: function padStart(maxLength /* , fillString = ' ' */) {
return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
@@ -3498,17 +3506,53 @@ _export({ target: 'String', proto: true, forced: stringPadWebkitBug }, {
});
// `String.prototype.repeat` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.repeat
+// https://tc39.es/ecma262/#sec-string.prototype.repeat
_export({ target: 'String', proto: true }, {
repeat: stringRepeat
});
-var max$3 = Math.max;
-var min$6 = Math.min;
var floor$1 = Math.floor;
+var replace = ''.replace;
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
+// https://tc39.es/ecma262/#sec-getsubstitution
+var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
+ var tailPos = position + matched.length;
+ var m = captures.length;
+ var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
+ if (namedCaptures !== undefined) {
+ namedCaptures = toObject(namedCaptures);
+ symbols = SUBSTITUTION_SYMBOLS;
+ }
+ return replace.call(replacement, symbols, function (match, ch) {
+ var capture;
+ switch (ch.charAt(0)) {
+ case '$': return '$';
+ case '&': return matched;
+ case '`': return str.slice(0, position);
+ case "'": return str.slice(tailPos);
+ case '<':
+ capture = namedCaptures[ch.slice(1, -1)];
+ break;
+ default: // \d\d?
+ var n = +ch;
+ if (n === 0) return match;
+ if (n > m) {
+ var f = floor$1(n / 10);
+ if (f === 0) return match;
+ if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
+ return match;
+ }
+ capture = captures[n - 1];
+ }
+ return capture === undefined ? '' : capture;
+ });
+};
+
+var max$3 = Math.max;
+var min$6 = Math.min;
+
var maybeToString = function (it) {
return it === undefined ? it : String(it);
};
@@ -3521,7 +3565,7 @@ fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, ma
return [
// `String.prototype.replace` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.replace
+ // https://tc39.es/ecma262/#sec-string.prototype.replace
function replace(searchValue, replaceValue) {
var O = requireObjectCoercible(this);
var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
@@ -3530,7 +3574,7 @@ fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, ma
: nativeReplace.call(String(O), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
function (regexp, replaceValue) {
if (
(!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
@@ -3593,54 +3637,20 @@ fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, ma
return accumulatedResult + S.slice(nextSourcePosition);
}
];
-
- // https://tc39.github.io/ecma262/#sec-getsubstitution
- function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
- var tailPos = position + matched.length;
- var m = captures.length;
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
- if (namedCaptures !== undefined) {
- namedCaptures = toObject(namedCaptures);
- symbols = SUBSTITUTION_SYMBOLS;
- }
- return nativeReplace.call(replacement, symbols, function (match, ch) {
- var capture;
- switch (ch.charAt(0)) {
- case '$': return '$';
- case '&': return matched;
- case '`': return str.slice(0, position);
- case "'": return str.slice(tailPos);
- case '<':
- capture = namedCaptures[ch.slice(1, -1)];
- break;
- default: // \d\d?
- var n = +ch;
- if (n === 0) return match;
- if (n > m) {
- var f = floor$1(n / 10);
- if (f === 0) return match;
- if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
- return match;
- }
- capture = captures[n - 1];
- }
- return capture === undefined ? '' : capture;
- });
- }
});
// @@search logic
fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
return [
// `String.prototype.search` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.search
+ // https://tc39.es/ecma262/#sec-string.prototype.search
function search(regexp) {
var O = requireObjectCoercible(this);
var searcher = regexp == undefined ? undefined : regexp[SEARCH];
return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
},
// `RegExp.prototype[@@search]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
function (regexp) {
var res = maybeCallNative(nativeSearch, regexp, this);
if (res.done) return res.value;
@@ -3719,7 +3729,7 @@ fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCal
return [
// `String.prototype.split` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.split
+ // https://tc39.es/ecma262/#sec-string.prototype.split
function split(separator, limit) {
var O = requireObjectCoercible(this);
var splitter = separator == undefined ? undefined : separator[SPLIT];
@@ -3728,7 +3738,7 @@ fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCal
: internalSplit.call(String(O), separator, limit);
},
// `RegExp.prototype[@@split]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
//
// NOTE: This cannot be properly polyfilled in engines that don't support
// the 'y' flag.
@@ -3798,7 +3808,7 @@ var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
}();
// `String.prototype.startsWith` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.startswith
+// https://tc39.es/ecma262/#sec-string.prototype.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));
@@ -3831,13 +3841,13 @@ var createMethod$6 = function (TYPE) {
var stringTrim = {
// `String.prototype.{ trimLeft, trimStart }` methods
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
start: createMethod$6(1),
// `String.prototype.{ trimRight, trimEnd }` methods
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
end: createMethod$6(2),
// `String.prototype.trim` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.trim
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
trim: createMethod$6(3)
};
@@ -3855,7 +3865,7 @@ var $trim = stringTrim.trim;
// `String.prototype.trim` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.trim
+// https://tc39.es/ecma262/#sec-string.prototype.trim
_export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, {
trim: function trim() {
return $trim(this);
@@ -3872,7 +3882,8 @@ var trimStart = FORCED$4 ? function trimStart() {
} : ''.trimStart;
// `String.prototype.{ trimStart, trimLeft }` methods
-// https://github.com/tc39/ecmascript-string-left-right-trim
+// https://tc39.es/ecma262/#sec-string.prototype.trimstart
+// https://tc39.es/ecma262/#String.prototype.trimleft
_export({ target: 'String', proto: true, forced: FORCED$4 }, {
trimStart: trimStart,
trimLeft: trimStart
@@ -3888,7 +3899,8 @@ var trimEnd = FORCED$5 ? function trimEnd() {
} : ''.trimEnd;
// `String.prototype.{ trimEnd, trimRight }` methods
-// https://github.com/tc39/ecmascript-string-left-right-trim
+// https://tc39.es/ecma262/#sec-string.prototype.trimend
+// https://tc39.es/ecma262/#String.prototype.trimright
_export({ target: 'String', proto: true, forced: FORCED$5 }, {
trimEnd: trimEnd,
trimRight: trimEnd
@@ -3903,7 +3915,7 @@ var setInternalState$3 = internalState.set;
var getInternalState$3 = internalState.getterFor(STRING_ITERATOR);
// `String.prototype[@@iterator]` method
-// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
+// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
defineIterator(String, 'String', function (iterated) {
setInternalState$3(this, {
type: STRING_ITERATOR,
@@ -3911,7 +3923,7 @@ defineIterator(String, 'String', function (iterated) {
index: 0
});
// `%StringIteratorPrototype%.next` method
-// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
+// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
}, function next() {
var state = getInternalState$3(this);
var string = state.string;
@@ -3926,7 +3938,7 @@ defineIterator(String, 'String', function (iterated) {
var quot = /"/g;
// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
-// https://tc39.github.io/ecma262/#sec-createhtml
+// https://tc39.es/ecma262/#sec-createhtml
var createHtml = function (string, tag, attribute, value) {
var S = String(requireObjectCoercible(string));
var p1 = '<' + tag;
@@ -3944,7 +3956,7 @@ var stringHtmlForced = function (METHOD_NAME) {
};
// `String.prototype.anchor` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.anchor
+// https://tc39.es/ecma262/#sec-string.prototype.anchor
_export({ target: 'String', proto: true, forced: stringHtmlForced('anchor') }, {
anchor: function anchor(name) {
return createHtml(this, 'a', 'name', name);
@@ -3952,7 +3964,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('anchor') }, {
});
// `String.prototype.big` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.big
+// https://tc39.es/ecma262/#sec-string.prototype.big
_export({ target: 'String', proto: true, forced: stringHtmlForced('big') }, {
big: function big() {
return createHtml(this, 'big', '', '');
@@ -3960,7 +3972,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('big') }, {
});
// `String.prototype.blink` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.blink
+// https://tc39.es/ecma262/#sec-string.prototype.blink
_export({ target: 'String', proto: true, forced: stringHtmlForced('blink') }, {
blink: function blink() {
return createHtml(this, 'blink', '', '');
@@ -3968,7 +3980,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('blink') }, {
});
// `String.prototype.bold` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.bold
+// https://tc39.es/ecma262/#sec-string.prototype.bold
_export({ target: 'String', proto: true, forced: stringHtmlForced('bold') }, {
bold: function bold() {
return createHtml(this, 'b', '', '');
@@ -3976,7 +3988,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('bold') }, {
});
// `String.prototype.fixed` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.fixed
+// https://tc39.es/ecma262/#sec-string.prototype.fixed
_export({ target: 'String', proto: true, forced: stringHtmlForced('fixed') }, {
fixed: function fixed() {
return createHtml(this, 'tt', '', '');
@@ -3984,7 +3996,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('fixed') }, {
});
// `String.prototype.fontcolor` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.fontcolor
+// https://tc39.es/ecma262/#sec-string.prototype.fontcolor
_export({ target: 'String', proto: true, forced: stringHtmlForced('fontcolor') }, {
fontcolor: function fontcolor(color) {
return createHtml(this, 'font', 'color', color);
@@ -3992,7 +4004,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('fontcolor') }
});
// `String.prototype.fontsize` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.fontsize
+// https://tc39.es/ecma262/#sec-string.prototype.fontsize
_export({ target: 'String', proto: true, forced: stringHtmlForced('fontsize') }, {
fontsize: function fontsize(size) {
return createHtml(this, 'font', 'size', size);
@@ -4000,7 +4012,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('fontsize') },
});
// `String.prototype.italics` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.italics
+// https://tc39.es/ecma262/#sec-string.prototype.italics
_export({ target: 'String', proto: true, forced: stringHtmlForced('italics') }, {
italics: function italics() {
return createHtml(this, 'i', '', '');
@@ -4008,7 +4020,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('italics') },
});
// `String.prototype.link` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.link
+// https://tc39.es/ecma262/#sec-string.prototype.link
_export({ target: 'String', proto: true, forced: stringHtmlForced('link') }, {
link: function link(url) {
return createHtml(this, 'a', 'href', url);
@@ -4016,7 +4028,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('link') }, {
});
// `String.prototype.small` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.small
+// https://tc39.es/ecma262/#sec-string.prototype.small
_export({ target: 'String', proto: true, forced: stringHtmlForced('small') }, {
small: function small() {
return createHtml(this, 'small', '', '');
@@ -4024,7 +4036,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('small') }, {
});
// `String.prototype.strike` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.strike
+// https://tc39.es/ecma262/#sec-string.prototype.strike
_export({ target: 'String', proto: true, forced: stringHtmlForced('strike') }, {
strike: function strike() {
return createHtml(this, 'strike', '', '');
@@ -4032,7 +4044,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('strike') }, {
});
// `String.prototype.sub` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.sub
+// https://tc39.es/ecma262/#sec-string.prototype.sub
_export({ target: 'String', proto: true, forced: stringHtmlForced('sub') }, {
sub: function sub() {
return createHtml(this, 'sub', '', '');
@@ -4040,7 +4052,7 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('sub') }, {
});
// `String.prototype.sup` method
-// https://tc39.github.io/ecma262/#sec-string.prototype.sup
+// https://tc39.es/ecma262/#sec-string.prototype.sup
_export({ target: 'String', proto: true, forced: stringHtmlForced('sup') }, {
sup: function sup() {
return createHtml(this, 'sup', '', '');
@@ -4049,13 +4061,23 @@ _export({ target: 'String', proto: true, forced: stringHtmlForced('sup') }, {
var REPLACE$1 = wellKnownSymbol('replace');
var RegExpPrototype$1 = RegExp.prototype;
+var max$4 = Math.max;
+
+var stringIndexOf = function (string, searchValue, fromIndex) {
+ if (fromIndex > string.length) return -1;
+ if (searchValue === '') return fromIndex;
+ return string.indexOf(searchValue, fromIndex);
+};
// `String.prototype.replaceAll` method
-// https://github.com/tc39/proposal-string-replace-all
+// https://tc39.es/ecma262/#sec-string.prototype.replaceall
_export({ target: 'String', proto: true }, {
replaceAll: function replaceAll(searchValue, replaceValue) {
var O = requireObjectCoercible(this);
- var IS_REG_EXP, flags, replacer, string, searchString, template, result, position, index;
+ var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;
+ var position = 0;
+ var endOfLastMatch = 0;
+ var result = '';
if (searchValue != null) {
IS_REG_EXP = isRegexp(searchValue);
if (IS_REG_EXP) {
@@ -4072,17 +4094,23 @@ _export({ target: 'String', proto: true }, {
}
string = String(O);
searchString = String(searchValue);
- if (searchString === '') return replaceAll.call(string, /(?:)/g, replaceValue);
- template = string.split(searchString);
- if (typeof replaceValue !== 'function') {
- return template.join(String(replaceValue));
- }
- result = template[0];
- position = result.length;
- for (index = 1; index < template.length; index++) {
- result += String(replaceValue(searchString, position, string));
- position += searchString.length + template[index].length;
- result += template[index];
+ functionalReplace = typeof replaceValue === 'function';
+ if (!functionalReplace) replaceValue = String(replaceValue);
+ searchLength = searchString.length;
+ advanceBy = max$4(1, searchLength);
+ position = stringIndexOf(string, searchString, 0);
+ while (position !== -1) {
+ if (functionalReplace) {
+ replacement = String(replaceValue(searchString, position, string));
+ } else {
+ replacement = getSubstitution(searchString, string, position, [], undefined, replaceValue);
+ }
+ result += string.slice(endOfLastMatch, position) + replacement;
+ endOfLastMatch = position + searchLength;
+ position = stringIndexOf(string, searchString, position + advanceBy);
+ }
+ if (endOfLastMatch < string.length) {
+ result += string.slice(endOfLastMatch);
}
return result;
}
@@ -4132,7 +4160,7 @@ var FORCED$6 = descriptors && isForced_1('RegExp', (!CORRECT_NEW || UNSUPPORTED_
})));
// `RegExp` constructor
-// https://tc39.github.io/ecma262/#sec-regexp-constructor
+// https://tc39.es/ecma262/#sec-regexp-constructor
if (FORCED$6) {
var RegExpWrapper = function RegExp(pattern, flags) {
var thisIsRegExp = this instanceof RegExpWrapper;
@@ -4181,13 +4209,13 @@ if (FORCED$6) {
redefine(global$1, 'RegExp', RegExpWrapper);
}
-// https://tc39.github.io/ecma262/#sec-get-regexp-@@species
+// https://tc39.es/ecma262/#sec-get-regexp-@@species
setSpecies('RegExp');
var UNSUPPORTED_Y$3 = regexpStickyHelpers.UNSUPPORTED_Y;
// `RegExp.prototype.flags` getter
-// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
+// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
if (descriptors && (/./g.flags != 'g' || UNSUPPORTED_Y$3)) {
objectDefineProperty.f(RegExp.prototype, 'flags', {
configurable: true,
@@ -4201,6 +4229,7 @@ var getInternalState$4 = internalState.get;
var RegExpPrototype$3 = RegExp.prototype;
// `RegExp.prototype.sticky` getter
+// https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky
if (descriptors && UNSUPPORTED_Y$4) {
defineProperty$7(RegExp.prototype, 'sticky', {
configurable: true,
@@ -4233,6 +4262,8 @@ var DELEGATES_TO_EXEC = function () {
var nativeTest = /./.test;
+// `RegExp.prototype.test` method
+// https://tc39.es/ecma262/#sec-regexp.prototype.test
_export({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
test: function (str) {
if (typeof this.exec !== 'function') {
@@ -4255,7 +4286,7 @@ var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a',
var INCORRECT_NAME = nativeToString.name != TO_STRING;
// `RegExp.prototype.toString` method
-// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
+// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
if (NOT_GENERIC || INCORRECT_NAME) {
redefine(RegExp.prototype, TO_STRING, function toString() {
var R = anObject(this);
@@ -4274,14 +4305,14 @@ var hex = /^[+-]?0[Xx]/;
var FORCED$7 = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
// `parseInt` method
-// https://tc39.github.io/ecma262/#sec-parseint-string-radix
+// https://tc39.es/ecma262/#sec-parseint-string-radix
var numberParseInt = FORCED$7 ? function parseInt(string, radix) {
var S = trim(String(string));
return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
} : $parseInt;
// `parseInt` method
-// https://tc39.github.io/ecma262/#sec-parseint-string-radix
+// https://tc39.es/ecma262/#sec-parseint-string-radix
_export({ global: true, forced: parseInt != numberParseInt }, {
parseInt: numberParseInt
});
@@ -4293,7 +4324,7 @@ var $parseFloat = global$1.parseFloat;
var FORCED$8 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
// `parseFloat` method
-// https://tc39.github.io/ecma262/#sec-parsefloat-string
+// https://tc39.es/ecma262/#sec-parsefloat-string
var numberParseFloat = FORCED$8 ? function parseFloat(string) {
var trimmedString = trim$1(String(string));
var result = $parseFloat(trimmedString);
@@ -4301,7 +4332,7 @@ var numberParseFloat = FORCED$8 ? function parseFloat(string) {
} : $parseFloat;
// `parseFloat` method
-// https://tc39.github.io/ecma262/#sec-parsefloat-string
+// https://tc39.es/ecma262/#sec-parsefloat-string
_export({ global: true, forced: parseFloat != numberParseFloat }, {
parseFloat: numberParseFloat
});
@@ -4319,7 +4350,7 @@ var NumberPrototype = NativeNumber.prototype;
var BROKEN_CLASSOF = classofRaw(objectCreate(NumberPrototype)) == NUMBER;
// `ToNumber` abstract operation
-// https://tc39.github.io/ecma262/#sec-tonumber
+// https://tc39.es/ecma262/#sec-tonumber
var toNumber = function (argument) {
var it = toPrimitive(argument, false);
var first, third, radix, maxCode, digits, length, index, code;
@@ -4348,7 +4379,7 @@ var toNumber = function (argument) {
};
// `Number` constructor
-// https://tc39.github.io/ecma262/#sec-number-constructor
+// https://tc39.es/ecma262/#sec-number-constructor
if (isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
var NumberWrapper = function Number(value) {
var it = arguments.length < 1 ? 0 : value;
@@ -4377,7 +4408,7 @@ if (isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNu
}
// `Number.EPSILON` constant
-// https://tc39.github.io/ecma262/#sec-number.epsilon
+// https://tc39.es/ecma262/#sec-number.epsilon
_export({ target: 'Number', stat: true }, {
EPSILON: Math.pow(2, -52)
});
@@ -4385,31 +4416,31 @@ _export({ target: 'Number', stat: true }, {
var globalIsFinite = global$1.isFinite;
// `Number.isFinite` method
-// https://tc39.github.io/ecma262/#sec-number.isfinite
+// https://tc39.es/ecma262/#sec-number.isfinite
var numberIsFinite = Number.isFinite || function isFinite(it) {
return typeof it == 'number' && globalIsFinite(it);
};
// `Number.isFinite` method
-// https://tc39.github.io/ecma262/#sec-number.isfinite
+// https://tc39.es/ecma262/#sec-number.isfinite
_export({ target: 'Number', stat: true }, { isFinite: numberIsFinite });
var floor$2 = Math.floor;
// `Number.isInteger` method implementation
-// https://tc39.github.io/ecma262/#sec-number.isinteger
+// https://tc39.es/ecma262/#sec-number.isinteger
var isInteger = function isInteger(it) {
return !isObject(it) && isFinite(it) && floor$2(it) === it;
};
// `Number.isInteger` method
-// https://tc39.github.io/ecma262/#sec-number.isinteger
+// https://tc39.es/ecma262/#sec-number.isinteger
_export({ target: 'Number', stat: true }, {
isInteger: isInteger
});
// `Number.isNaN` method
-// https://tc39.github.io/ecma262/#sec-number.isnan
+// https://tc39.es/ecma262/#sec-number.isnan
_export({ target: 'Number', stat: true }, {
isNaN: function isNaN(number) {
// eslint-disable-next-line no-self-compare
@@ -4420,7 +4451,7 @@ _export({ target: 'Number', stat: true }, {
var abs = Math.abs;
// `Number.isSafeInteger` method
-// https://tc39.github.io/ecma262/#sec-number.issafeinteger
+// https://tc39.es/ecma262/#sec-number.issafeinteger
_export({ target: 'Number', stat: true }, {
isSafeInteger: function isSafeInteger(number) {
return isInteger(number) && abs(number) <= 0x1FFFFFFFFFFFFF;
@@ -4428,31 +4459,31 @@ _export({ target: 'Number', stat: true }, {
});
// `Number.MAX_SAFE_INTEGER` constant
-// https://tc39.github.io/ecma262/#sec-number.max_safe_integer
+// https://tc39.es/ecma262/#sec-number.max_safe_integer
_export({ target: 'Number', stat: true }, {
MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF
});
// `Number.MIN_SAFE_INTEGER` constant
-// https://tc39.github.io/ecma262/#sec-number.min_safe_integer
+// https://tc39.es/ecma262/#sec-number.min_safe_integer
_export({ target: 'Number', stat: true }, {
MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF
});
// `Number.parseFloat` method
-// https://tc39.github.io/ecma262/#sec-number.parseFloat
+// https://tc39.es/ecma262/#sec-number.parseFloat
_export({ target: 'Number', stat: true, forced: Number.parseFloat != numberParseFloat }, {
parseFloat: numberParseFloat
});
// `Number.parseInt` method
-// https://tc39.github.io/ecma262/#sec-number.parseint
+// https://tc39.es/ecma262/#sec-number.parseint
_export({ target: 'Number', stat: true, forced: Number.parseInt != numberParseInt }, {
parseInt: numberParseInt
});
// `thisNumberValue` abstract operation
-// https://tc39.github.io/ecma262/#sec-thisnumbervalue
+// https://tc39.es/ecma262/#sec-thisnumbervalue
var thisNumberValue = function (value) {
if (typeof value != 'number' && classofRaw(value) != 'Number') {
throw TypeError('Incorrect invocation');
@@ -4491,7 +4522,7 @@ var FORCED$9 = nativeToFixed && (
});
// `Number.prototype.toFixed` method
-// https://tc39.github.io/ecma262/#sec-number.prototype.tofixed
+// https://tc39.es/ecma262/#sec-number.prototype.tofixed
_export({ target: 'Number', proto: true, forced: FORCED$9 }, {
// eslint-disable-next-line max-statements
toFixed: function toFixed(fractionDigits) {
@@ -4591,7 +4622,7 @@ var FORCED$a = fails(function () {
});
// `Number.prototype.toPrecision` method
-// https://tc39.github.io/ecma262/#sec-number.prototype.toprecision
+// https://tc39.es/ecma262/#sec-number.prototype.toprecision
_export({ target: 'Number', proto: true, forced: FORCED$a }, {
toPrecision: function toPrecision(precision) {
return precision === undefined
@@ -4603,7 +4634,7 @@ _export({ target: 'Number', proto: true, forced: FORCED$a }, {
var log$1 = Math.log;
// `Math.log1p` method implementation
-// https://tc39.github.io/ecma262/#sec-math.log1p
+// https://tc39.es/ecma262/#sec-math.log1p
var mathLog1p = Math.log1p || function log1p(x) {
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log$1(1 + x);
};
@@ -4620,7 +4651,7 @@ var FORCED$b = !nativeAcosh
|| nativeAcosh(Infinity) != Infinity;
// `Math.acosh` method
-// https://tc39.github.io/ecma262/#sec-math.acosh
+// https://tc39.es/ecma262/#sec-math.acosh
_export({ target: 'Math', stat: true, forced: FORCED$b }, {
acosh: function acosh(x) {
return (x = +x) < 1 ? NaN : x > 94906265.62425156
@@ -4638,7 +4669,7 @@ function asinh(x) {
}
// `Math.asinh` method
-// https://tc39.github.io/ecma262/#sec-math.asinh
+// https://tc39.es/ecma262/#sec-math.asinh
// Tor Browser bug: Math.asinh(0) -> -0
_export({ target: 'Math', stat: true, forced: !(nativeAsinh && 1 / nativeAsinh(0) > 0) }, {
asinh: asinh
@@ -4648,7 +4679,7 @@ var nativeAtanh = Math.atanh;
var log$4 = Math.log;
// `Math.atanh` method
-// https://tc39.github.io/ecma262/#sec-math.atanh
+// https://tc39.es/ecma262/#sec-math.atanh
// Tor Browser bug: Math.atanh(-0) -> 0
_export({ target: 'Math', stat: true, forced: !(nativeAtanh && 1 / nativeAtanh(-0) < 0) }, {
atanh: function atanh(x) {
@@ -4657,7 +4688,7 @@ _export({ target: 'Math', stat: true, forced: !(nativeAtanh && 1 / nativeAtanh(-
});
// `Math.sign` method implementation
-// https://tc39.github.io/ecma262/#sec-math.sign
+// https://tc39.es/ecma262/#sec-math.sign
var mathSign = Math.sign || function sign(x) {
// eslint-disable-next-line no-self-compare
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
@@ -4667,7 +4698,7 @@ var abs$1 = Math.abs;
var pow$1 = Math.pow;
// `Math.cbrt` method
-// https://tc39.github.io/ecma262/#sec-math.cbrt
+// https://tc39.es/ecma262/#sec-math.cbrt
_export({ target: 'Math', stat: true }, {
cbrt: function cbrt(x) {
return mathSign(x = +x) * pow$1(abs$1(x), 1 / 3);
@@ -4679,7 +4710,7 @@ var log$5 = Math.log;
var LOG2E = Math.LOG2E;
// `Math.clz32` method
-// https://tc39.github.io/ecma262/#sec-math.clz32
+// https://tc39.es/ecma262/#sec-math.clz32
_export({ target: 'Math', stat: true }, {
clz32: function clz32(x) {
return (x >>>= 0) ? 31 - floor$4(log$5(x + 0.5) * LOG2E) : 32;
@@ -4690,7 +4721,7 @@ var nativeExpm1 = Math.expm1;
var exp = Math.exp;
// `Math.expm1` method implementation
-// https://tc39.github.io/ecma262/#sec-math.expm1
+// https://tc39.es/ecma262/#sec-math.expm1
var mathExpm1 = (!nativeExpm1
// Old FF bug
|| nativeExpm1(10) > 22025.465794806719 || nativeExpm1(10) < 22025.4657948067165168
@@ -4705,7 +4736,7 @@ var abs$2 = Math.abs;
var E = Math.E;
// `Math.cosh` method
-// https://tc39.github.io/ecma262/#sec-math.cosh
+// https://tc39.es/ecma262/#sec-math.cosh
_export({ target: 'Math', stat: true, forced: !nativeCosh || nativeCosh(710) === Infinity }, {
cosh: function cosh(x) {
var t = mathExpm1(abs$2(x) - 1) + 1;
@@ -4714,7 +4745,7 @@ _export({ target: 'Math', stat: true, forced: !nativeCosh || nativeCosh(710) ===
});
// `Math.expm1` method
-// https://tc39.github.io/ecma262/#sec-math.expm1
+// https://tc39.es/ecma262/#sec-math.expm1
_export({ target: 'Math', stat: true, forced: mathExpm1 != Math.expm1 }, { expm1: mathExpm1 });
var abs$3 = Math.abs;
@@ -4729,7 +4760,7 @@ var roundTiesToEven = function (n) {
};
// `Math.fround` method implementation
-// https://tc39.github.io/ecma262/#sec-math.fround
+// https://tc39.es/ecma262/#sec-math.fround
var mathFround = Math.fround || function fround(x) {
var $abs = abs$3(x);
var $sign = mathSign(x);
@@ -4743,7 +4774,7 @@ var mathFround = Math.fround || function fround(x) {
};
// `Math.fround` method
-// https://tc39.github.io/ecma262/#sec-math.fround
+// https://tc39.es/ecma262/#sec-math.fround
_export({ target: 'Math', stat: true }, { fround: mathFround });
var $hypot = Math.hypot;
@@ -4755,7 +4786,7 @@ var sqrt$2 = Math.sqrt;
var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
// `Math.hypot` method
-// https://tc39.github.io/ecma262/#sec-math.hypot
+// https://tc39.es/ecma262/#sec-math.hypot
_export({ target: 'Math', stat: true, forced: BUGGY }, {
hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
var sum = 0;
@@ -4785,7 +4816,7 @@ var FORCED$c = fails(function () {
});
// `Math.imul` method
-// https://tc39.github.io/ecma262/#sec-math.imul
+// https://tc39.es/ecma262/#sec-math.imul
// some WebKit versions fails with big numbers, some has wrong arity
_export({ target: 'Math', stat: true, forced: FORCED$c }, {
imul: function imul(x, y) {
@@ -4802,7 +4833,7 @@ var log$6 = Math.log;
var LOG10E = Math.LOG10E;
// `Math.log10` method
-// https://tc39.github.io/ecma262/#sec-math.log10
+// https://tc39.es/ecma262/#sec-math.log10
_export({ target: 'Math', stat: true }, {
log10: function log10(x) {
return log$6(x) * LOG10E;
@@ -4810,14 +4841,14 @@ _export({ target: 'Math', stat: true }, {
});
// `Math.log1p` method
-// https://tc39.github.io/ecma262/#sec-math.log1p
+// https://tc39.es/ecma262/#sec-math.log1p
_export({ target: 'Math', stat: true }, { log1p: mathLog1p });
var log$7 = Math.log;
var LN2$1 = Math.LN2;
// `Math.log2` method
-// https://tc39.github.io/ecma262/#sec-math.log2
+// https://tc39.es/ecma262/#sec-math.log2
_export({ target: 'Math', stat: true }, {
log2: function log2(x) {
return log$7(x) / LN2$1;
@@ -4825,7 +4856,7 @@ _export({ target: 'Math', stat: true }, {
});
// `Math.sign` method
-// https://tc39.github.io/ecma262/#sec-math.sign
+// https://tc39.es/ecma262/#sec-math.sign
_export({ target: 'Math', stat: true }, {
sign: mathSign
});
@@ -4839,7 +4870,7 @@ var FORCED$d = fails(function () {
});
// `Math.sinh` method
-// https://tc39.github.io/ecma262/#sec-math.sinh
+// https://tc39.es/ecma262/#sec-math.sinh
// V8 near Chromium 38 has a problem with very small numbers
_export({ target: 'Math', stat: true, forced: FORCED$d }, {
sinh: function sinh(x) {
@@ -4850,7 +4881,7 @@ _export({ target: 'Math', stat: true, forced: FORCED$d }, {
var exp$2 = Math.exp;
// `Math.tanh` method
-// https://tc39.github.io/ecma262/#sec-math.tanh
+// https://tc39.es/ecma262/#sec-math.tanh
_export({ target: 'Math', stat: true }, {
tanh: function tanh(x) {
var a = mathExpm1(x = +x);
@@ -4860,14 +4891,14 @@ _export({ target: 'Math', stat: true }, {
});
// Math[@@toStringTag] property
-// https://tc39.github.io/ecma262/#sec-math-@@tostringtag
+// https://tc39.es/ecma262/#sec-math-@@tostringtag
setToStringTag(Math, 'Math', true);
var ceil$2 = Math.ceil;
var floor$5 = Math.floor;
// `Math.trunc` method
-// https://tc39.github.io/ecma262/#sec-math.trunc
+// https://tc39.es/ecma262/#sec-math.trunc
_export({ target: 'Math', stat: true }, {
trunc: function trunc(it) {
return (it > 0 ? floor$5 : ceil$2)(it);
@@ -4875,7 +4906,7 @@ _export({ target: 'Math', stat: true }, {
});
// `Date.now` method
-// https://tc39.github.io/ecma262/#sec-date.now
+// https://tc39.es/ecma262/#sec-date.now
_export({ target: 'Date', stat: true }, {
now: function now() {
return new Date().getTime();
@@ -4888,7 +4919,7 @@ var FORCED$e = fails(function () {
});
// `Date.prototype.toJSON` method
-// https://tc39.github.io/ecma262/#sec-date.prototype.tojson
+// https://tc39.es/ecma262/#sec-date.prototype.tojson
_export({ target: 'Date', proto: true, forced: FORCED$e }, {
// eslint-disable-next-line no-unused-vars
toJSON: function toJSON(key) {
@@ -4906,7 +4937,7 @@ var getTime = DatePrototype.getTime;
var nativeDateToISOString = DatePrototype.toISOString;
// `Date.prototype.toISOString` method implementation
-// https://tc39.github.io/ecma262/#sec-date.prototype.toisostring
+// https://tc39.es/ecma262/#sec-date.prototype.toisostring
// PhantomJS / old WebKit fails here:
var dateToIsoString = (fails(function () {
return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
@@ -4929,7 +4960,7 @@ var dateToIsoString = (fails(function () {
} : nativeDateToISOString;
// `Date.prototype.toISOString` method
-// https://tc39.github.io/ecma262/#sec-date.prototype.toisostring
+// https://tc39.es/ecma262/#sec-date.prototype.toisostring
// PhantomJS / old WebKit has a broken implementations
_export({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== dateToIsoString }, {
toISOString: dateToIsoString
@@ -4942,7 +4973,7 @@ var nativeDateToString = DatePrototype$1[TO_STRING$1];
var getTime$1 = DatePrototype$1.getTime;
// `Date.prototype.toString` method
-// https://tc39.github.io/ecma262/#sec-date.prototype.tostring
+// https://tc39.es/ecma262/#sec-date.prototype.tostring
if (new Date(NaN) + '' != INVALID_DATE) {
redefine(DatePrototype$1, TO_STRING$1, function toString() {
var value = getTime$1.call(this);
@@ -4961,7 +4992,7 @@ var TO_PRIMITIVE$1 = wellKnownSymbol('toPrimitive');
var DatePrototype$2 = Date.prototype;
// `Date.prototype[@@toPrimitive]` method
-// https://tc39.github.io/ecma262/#sec-date.prototype-@@toprimitive
+// https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
if (!(TO_PRIMITIVE$1 in DatePrototype$2)) {
createNonEnumerableProperty(DatePrototype$2, TO_PRIMITIVE$1, dateToPrimitive);
}
@@ -4985,6 +5016,8 @@ var FORCED$f = fails(function () {
});
if ($stringify$1) {
+ // `JSON.stringify` method
+ // https://tc39.es/ecma262/#sec-json.stringify
// https://github.com/tc39/proposal-well-formed-stringify
_export({ target: 'JSON', stat: true, forced: FORCED$f }, {
// eslint-disable-next-line no-unused-vars
@@ -4996,7 +5029,7 @@ if ($stringify$1) {
}
// JSON[@@toStringTag] property
-// https://tc39.github.io/ecma262/#sec-json-@@tostringtag
+// https://tc39.es/ecma262/#sec-json-@@tostringtag
setToStringTag(global$1.JSON, 'JSON', true);
var nativePromiseConstructor = global$1.Promise;
@@ -5114,11 +5147,14 @@ var task = {
clear: clear
};
+var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
+
var getOwnPropertyDescriptor$7 = objectGetOwnPropertyDescriptor.f;
var macrotask = task.set;
+
var MutationObserver = global$1.MutationObserver || global$1.WebKitMutationObserver;
var document$2 = global$1.document;
var process$2 = global$1.process;
@@ -5149,7 +5185,8 @@ if (!queueMicrotask) {
};
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
- if (!engineIsIos && !engineIsNode && MutationObserver && document$2) {
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
+ if (!engineIsIos && !engineIsNode && !engineIsWebosWebkit && MutationObserver && document$2) {
toggle = true;
node = document$2.createTextNode('');
new MutationObserver(flush).observe(node, { characterData: true });
@@ -5471,7 +5508,7 @@ if (FORCED$g) {
};
Internal.prototype = redefineAll(PromiseConstructor.prototype, {
// `Promise.prototype.then` method
- // https://tc39.github.io/ecma262/#sec-promise.prototype.then
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
then: function then(onFulfilled, onRejected) {
var state = getInternalPromiseState(this);
var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
@@ -5484,7 +5521,7 @@ if (FORCED$g) {
return reaction.promise;
},
// `Promise.prototype.catch` method
- // https://tc39.github.io/ecma262/#sec-promise.prototype.catch
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
'catch': function (onRejected) {
return this.then(undefined, onRejected);
}
@@ -5536,7 +5573,7 @@ PromiseWrapper = getBuiltIn(PROMISE);
// statics
_export({ target: PROMISE, stat: true, forced: FORCED$g }, {
// `Promise.reject` method
- // https://tc39.github.io/ecma262/#sec-promise.reject
+ // https://tc39.es/ecma262/#sec-promise.reject
reject: function reject(r) {
var capability = newPromiseCapability$1(this);
capability.reject.call(undefined, r);
@@ -5546,7 +5583,7 @@ _export({ target: PROMISE, stat: true, forced: FORCED$g }, {
_export({ target: PROMISE, stat: true, forced: FORCED$g }, {
// `Promise.resolve` method
- // https://tc39.github.io/ecma262/#sec-promise.resolve
+ // https://tc39.es/ecma262/#sec-promise.resolve
resolve: function resolve(x) {
return promiseResolve( this, x);
}
@@ -5554,7 +5591,7 @@ _export({ target: PROMISE, stat: true, forced: FORCED$g }, {
_export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, {
// `Promise.all` method
- // https://tc39.github.io/ecma262/#sec-promise.all
+ // https://tc39.es/ecma262/#sec-promise.all
all: function all(iterable) {
var C = this;
var capability = newPromiseCapability$1(C);
@@ -5583,7 +5620,7 @@ _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, {
return capability.promise;
},
// `Promise.race` method
- // https://tc39.github.io/ecma262/#sec-promise.race
+ // https://tc39.es/ecma262/#sec-promise.race
race: function race(iterable) {
var C = this;
var capability = newPromiseCapability$1(C);
@@ -5600,7 +5637,7 @@ _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, {
});
// `Promise.allSettled` method
-// https://github.com/tc39/proposal-promise-allSettled
+// https://tc39.es/ecma262/#sec-promise.allsettled
_export({ target: 'Promise', stat: true }, {
allSettled: function allSettled(iterable) {
var C = this;
@@ -5639,7 +5676,7 @@ _export({ target: 'Promise', stat: true }, {
var PROMISE_ANY_ERROR = 'No one promise resolved';
// `Promise.any` method
-// https://github.com/tc39/proposal-promise-any
+// https://tc39.es/ecma262/#sec-promise.any
_export({ target: 'Promise', stat: true }, {
any: function any(iterable) {
var C = this;
@@ -5681,7 +5718,7 @@ var NON_GENERIC = !!nativePromiseConstructor && fails(function () {
});
// `Promise.prototype.finally` method
-// https://tc39.github.io/ecma262/#sec-promise.prototype.finally
+// https://tc39.es/ecma262/#sec-promise.prototype.finally
_export({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
'finally': function (onFinally) {
var C = speciesConstructor(this, getBuiltIn('Promise'));
@@ -5975,13 +6012,13 @@ var collectionStrong = {
};
// `Map` constructor
-// https://tc39.github.io/ecma262/#sec-map-objects
+// https://tc39.es/ecma262/#sec-map-objects
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
+// https://tc39.es/ecma262/#sec-set-objects
var es_set = collection('Set', function (init) {
return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
}, collectionStrong);
@@ -6127,7 +6164,7 @@ var wrapper = function (init) {
};
// `WeakMap` constructor
-// https://tc39.github.io/ecma262/#sec-weakmap-constructor
+// https://tc39.es/ecma262/#sec-weakmap-constructor
var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak);
// IE11 WeakMap frozen keys fix
@@ -6176,7 +6213,7 @@ if (nativeWeakMap && IS_IE11) {
});
// `WeakSet` constructor
-// https://tc39.github.io/ecma262/#sec-weakset-constructor
+// https://tc39.es/ecma262/#sec-weakset-constructor
collection('WeakSet', function (init) {
return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); };
}, collectionWeak);
@@ -6184,7 +6221,7 @@ collection('WeakSet', function (init) {
var arrayBufferNative = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';
// `ToIndex` abstract operation
-// https://tc39.github.io/ecma262/#sec-toindex
+// https://tc39.es/ecma262/#sec-toindex
var toIndex = function (it) {
if (it === undefined) return 0;
var number = toInteger(it);
@@ -6500,7 +6537,7 @@ var ArrayBuffer$1 = arrayBuffer[ARRAY_BUFFER$1];
var NativeArrayBuffer$1 = global$1[ARRAY_BUFFER$1];
// `ArrayBuffer` constructor
-// https://tc39.github.io/ecma262/#sec-arraybuffer-constructor
+// https://tc39.es/ecma262/#sec-arraybuffer-constructor
_export({ global: true, forced: NativeArrayBuffer$1 !== ArrayBuffer$1 }, {
ArrayBuffer: ArrayBuffer$1
});
@@ -6669,7 +6706,7 @@ var arrayBufferViewCore = {
var NATIVE_ARRAY_BUFFER_VIEWS$1 = arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
// `ArrayBuffer.isView` method
-// https://tc39.github.io/ecma262/#sec-arraybuffer.isview
+// https://tc39.es/ecma262/#sec-arraybuffer.isview
_export({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS$1 }, {
isView: arrayBufferViewCore.isView
});
@@ -6683,7 +6720,7 @@ var INCORRECT_SLICE = fails(function () {
});
// `ArrayBuffer.prototype.slice` method
-// https://tc39.github.io/ecma262/#sec-arraybuffer.prototype.slice
+// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice
_export({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, {
slice: function slice(start, end) {
if (nativeArrayBufferSlice !== undefined && end === undefined) {
@@ -6703,7 +6740,7 @@ _export({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SL
});
// `DataView` constructor
-// https://tc39.github.io/ecma262/#sec-dataview-constructor
+// https://tc39.es/ecma262/#sec-dataview-constructor
_export({ global: true, forced: !arrayBufferNative }, {
DataView: arrayBuffer.DataView
});
@@ -7002,7 +7039,7 @@ if (descriptors) {
});
// `Int8Array` constructor
-// https://tc39.github.io/ecma262/#sec-typedarray-objects
+// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor('Int8', function (init) {
return function Int8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
@@ -7010,7 +7047,7 @@ typedArrayConstructor('Int8', function (init) {
});
// `Uint8Array` constructor
-// https://tc39.github.io/ecma262/#sec-typedarray-objects
+// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor('Uint8', function (init) {
return function Uint8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
@@ -7018,7 +7055,7 @@ typedArrayConstructor('Uint8', function (init) {
});
// `Uint8ClampedArray` constructor
-// https://tc39.github.io/ecma262/#sec-typedarray-objects
+// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor('Uint8', function (init) {
return function Uint8ClampedArray(data, byteOffset, length) {
return init(this, data, byteOffset, length);
@@ -7026,7 +7063,7 @@ typedArrayConstructor('Uint8', function (init) {
}, true);
// `Int16Array` constructor
-// https://tc39.github.io/ecma262/#sec-typedarray-objects
+// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor('Int16', function (init) {
return function Int16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
@@ -7034,7 +7071,7 @@ typedArrayConstructor('Int16', function (init) {
});
// `Uint16Array` constructor
-// https://tc39.github.io/ecma262/#sec-typedarray-objects
+// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor('Uint16', function (init) {
return function Uint16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
@@ -7042,7 +7079,7 @@ typedArrayConstructor('Uint16', function (init) {
});
// `Int32Array` constructor
-// https://tc39.github.io/ecma262/#sec-typedarray-objects
+// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor('Int32', function (init) {
return function Int32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
@@ -7050,7 +7087,7 @@ typedArrayConstructor('Int32', function (init) {
});
// `Uint32Array` constructor
-// https://tc39.github.io/ecma262/#sec-typedarray-objects
+// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor('Uint32', function (init) {
return function Uint32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
@@ -7058,7 +7095,7 @@ typedArrayConstructor('Uint32', function (init) {
});
// `Float32Array` constructor
-// https://tc39.github.io/ecma262/#sec-typedarray-objects
+// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor('Float32', function (init) {
return function Float32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
@@ -7066,7 +7103,7 @@ typedArrayConstructor('Float32', function (init) {
});
// `Float64Array` constructor
-// https://tc39.github.io/ecma262/#sec-typedarray-objects
+// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor('Float64', function (init) {
return function Float64Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
@@ -7077,14 +7114,14 @@ var exportTypedArrayStaticMethod$1 = arrayBufferViewCore.exportTypedArrayStaticM
// `%TypedArray%.from` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.from
+// https://tc39.es/ecma262/#sec-%typedarray%.from
exportTypedArrayStaticMethod$1('from', typedArrayFrom, typedArrayConstructorsRequireWrappers);
var aTypedArrayConstructor$2 = arrayBufferViewCore.aTypedArrayConstructor;
var exportTypedArrayStaticMethod$2 = arrayBufferViewCore.exportTypedArrayStaticMethod;
// `%TypedArray%.of` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.of
+// https://tc39.es/ecma262/#sec-%typedarray%.of
exportTypedArrayStaticMethod$2('of', function of(/* ...items */) {
var index = 0;
var length = arguments.length;
@@ -7097,7 +7134,7 @@ var aTypedArray$1 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$1 = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.copyWithin` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin
exportTypedArrayMethod$1('copyWithin', function copyWithin(target, start /* , end */) {
return arrayCopyWithin.call(aTypedArray$1(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
});
@@ -7108,7 +7145,7 @@ var aTypedArray$2 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$2 = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.every` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every
exportTypedArrayMethod$2('every', function every(callbackfn /* , thisArg */) {
return $every$1(aTypedArray$2(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
});
@@ -7117,7 +7154,7 @@ var aTypedArray$3 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$3 = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.fill` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill
// eslint-disable-next-line no-unused-vars
exportTypedArrayMethod$3('fill', function fill(value /* , start, end */) {
return arrayFill.apply(aTypedArray$3(this), arguments);
@@ -7131,7 +7168,7 @@ var aTypedArrayConstructor$3 = arrayBufferViewCore.aTypedArrayConstructor;
var exportTypedArrayMethod$4 = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.filter` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter
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);
@@ -7148,7 +7185,7 @@ var aTypedArray$5 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$5 = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.find` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find
exportTypedArrayMethod$5('find', function find(predicate /* , thisArg */) {
return $find$1(aTypedArray$5(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
});
@@ -7159,7 +7196,7 @@ var aTypedArray$6 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$6 = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.findIndex` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex
exportTypedArrayMethod$6('findIndex', function findIndex(predicate /* , thisArg */) {
return $findIndex$1(aTypedArray$6(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
});
@@ -7170,7 +7207,7 @@ var aTypedArray$7 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$7 = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.forEach` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach
exportTypedArrayMethod$7('forEach', function forEach(callbackfn /* , thisArg */) {
$forEach$2(aTypedArray$7(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
});
@@ -7181,7 +7218,7 @@ var aTypedArray$8 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$8 = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.includes` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes
exportTypedArrayMethod$8('includes', function includes(searchElement /* , fromIndex */) {
return $includes$1(aTypedArray$8(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
});
@@ -7192,7 +7229,7 @@ var aTypedArray$9 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$9 = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.indexOf` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof
exportTypedArrayMethod$9('indexOf', function indexOf(searchElement /* , fromIndex */) {
return $indexOf$1(aTypedArray$9(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
});
@@ -7214,20 +7251,20 @@ var typedArrayValues = function values() {
};
// `%TypedArray%.prototype.entries` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.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
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.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
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values
exportTypedArrayMethod$a('values', typedArrayValues, !CORRECT_ITER_NAME);
// `%TypedArray%.prototype[@@iterator]` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator
exportTypedArrayMethod$a(ITERATOR$5, typedArrayValues, !CORRECT_ITER_NAME);
var aTypedArray$b = arrayBufferViewCore.aTypedArray;
@@ -7235,7 +7272,7 @@ var exportTypedArrayMethod$b = arrayBufferViewCore.exportTypedArrayMethod;
var $join = [].join;
// `%TypedArray%.prototype.join` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join
// eslint-disable-next-line no-unused-vars
exportTypedArrayMethod$b('join', function join(separator) {
return $join.apply(aTypedArray$b(this), arguments);
@@ -7245,7 +7282,7 @@ var aTypedArray$c = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$c = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.lastIndexOf` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof
// eslint-disable-next-line no-unused-vars
exportTypedArrayMethod$c('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {
return arrayLastIndexOf.apply(aTypedArray$c(this), arguments);
@@ -7259,7 +7296,7 @@ var aTypedArrayConstructor$4 = arrayBufferViewCore.aTypedArrayConstructor;
var exportTypedArrayMethod$d = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.map` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map
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);
@@ -7272,7 +7309,7 @@ var aTypedArray$e = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$e = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.reduce` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce
exportTypedArrayMethod$e('reduce', function reduce(callbackfn /* , initialValue */) {
return $reduce$1(aTypedArray$e(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
});
@@ -7283,7 +7320,7 @@ var aTypedArray$f = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$f = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.reduceRicht` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright
exportTypedArrayMethod$f('reduceRight', function reduceRight(callbackfn /* , initialValue */) {
return $reduceRight$1(aTypedArray$f(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
});
@@ -7293,7 +7330,7 @@ var exportTypedArrayMethod$g = arrayBufferViewCore.exportTypedArrayMethod;
var floor$7 = Math.floor;
// `%TypedArray%.prototype.reverse` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse
exportTypedArrayMethod$g('reverse', function reverse() {
var that = this;
var length = aTypedArray$g(that).length;
@@ -7316,7 +7353,7 @@ var FORCED$h = fails(function () {
});
// `%TypedArray%.prototype.set` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set
exportTypedArrayMethod$h('set', function set(arrayLike /* , offset */) {
aTypedArray$h(this);
var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
@@ -7339,7 +7376,7 @@ var FORCED$i = fails(function () {
});
// `%TypedArray%.prototype.slice` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice
exportTypedArrayMethod$i('slice', function slice(start, end) {
var list = $slice.call(aTypedArray$i(this), start, end);
var C = speciesConstructor(this, this.constructor);
@@ -7356,7 +7393,7 @@ var aTypedArray$j = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$j = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.some` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some
exportTypedArrayMethod$j('some', function some(callbackfn /* , thisArg */) {
return $some$1(aTypedArray$j(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
});
@@ -7366,7 +7403,7 @@ var exportTypedArrayMethod$k = arrayBufferViewCore.exportTypedArrayMethod;
var $sort = [].sort;
// `%TypedArray%.prototype.sort` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
exportTypedArrayMethod$k('sort', function sort(comparefn) {
return $sort.call(aTypedArray$k(this), comparefn);
});
@@ -7375,7 +7412,7 @@ var aTypedArray$l = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$l = arrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.subarray` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray
exportTypedArrayMethod$l('subarray', function subarray(begin, end) {
var O = aTypedArray$l(this);
var length = O.length;
@@ -7405,7 +7442,7 @@ var FORCED$j = fails(function () {
});
// `%TypedArray%.prototype.toLocaleString` method
-// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring
exportTypedArrayMethod$m('toLocaleString', function toLocaleString() {
return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice$1.call(aTypedArray$m(this)) : aTypedArray$m(this), arguments);
}, FORCED$j);
@@ -7428,7 +7465,7 @@ 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
+// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring
exportTypedArrayMethod$n('toString', arrayToString, IS_NOT_ARRAY_METHOD);
var nativeApply = getBuiltIn('Reflect', 'apply');
@@ -7440,7 +7477,7 @@ var OPTIONAL_ARGUMENTS_LIST = !fails(function () {
});
// `Reflect.apply` method
-// https://tc39.github.io/ecma262/#sec-reflect.apply
+// https://tc39.es/ecma262/#sec-reflect.apply
_export({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, {
apply: function apply(target, thisArgument, argumentsList) {
aFunction$1(target);
@@ -7454,7 +7491,7 @@ _export({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, {
var nativeConstruct = getBuiltIn('Reflect', 'construct');
// `Reflect.construct` method
-// https://tc39.github.io/ecma262/#sec-reflect.construct
+// https://tc39.es/ecma262/#sec-reflect.construct
// MS Edge supports only 2 arguments and argumentsList argument is optional
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
var NEW_TARGET_BUG = fails(function () {
@@ -7501,7 +7538,7 @@ var ERROR_INSTEAD_OF_FALSE = fails(function () {
});
// `Reflect.defineProperty` method
-// https://tc39.github.io/ecma262/#sec-reflect.defineproperty
+// https://tc39.es/ecma262/#sec-reflect.defineproperty
_export({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !descriptors }, {
defineProperty: function defineProperty(target, propertyKey, attributes) {
anObject(target);
@@ -7519,7 +7556,7 @@ _export({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !
var getOwnPropertyDescriptor$8 = objectGetOwnPropertyDescriptor.f;
// `Reflect.deleteProperty` method
-// https://tc39.github.io/ecma262/#sec-reflect.deleteproperty
+// https://tc39.es/ecma262/#sec-reflect.deleteproperty
_export({ target: 'Reflect', stat: true }, {
deleteProperty: function deleteProperty(target, propertyKey) {
var descriptor = getOwnPropertyDescriptor$8(anObject(target), propertyKey);
@@ -7528,7 +7565,7 @@ _export({ target: 'Reflect', stat: true }, {
});
// `Reflect.get` method
-// https://tc39.github.io/ecma262/#sec-reflect.get
+// https://tc39.es/ecma262/#sec-reflect.get
function get$2(target, propertyKey /* , receiver */) {
var receiver = arguments.length < 3 ? target : arguments[2];
var descriptor, prototype;
@@ -7546,7 +7583,7 @@ _export({ target: 'Reflect', stat: true }, {
});
// `Reflect.getOwnPropertyDescriptor` method
-// https://tc39.github.io/ecma262/#sec-reflect.getownpropertydescriptor
+// https://tc39.es/ecma262/#sec-reflect.getownpropertydescriptor
_export({ target: 'Reflect', stat: true, sham: !descriptors }, {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
return objectGetOwnPropertyDescriptor.f(anObject(target), propertyKey);
@@ -7554,7 +7591,7 @@ _export({ target: 'Reflect', stat: true, sham: !descriptors }, {
});
// `Reflect.getPrototypeOf` method
-// https://tc39.github.io/ecma262/#sec-reflect.getprototypeof
+// https://tc39.es/ecma262/#sec-reflect.getprototypeof
_export({ target: 'Reflect', stat: true, sham: !correctPrototypeGetter }, {
getPrototypeOf: function getPrototypeOf(target) {
return objectGetPrototypeOf(anObject(target));
@@ -7562,7 +7599,7 @@ _export({ target: 'Reflect', stat: true, sham: !correctPrototypeGetter }, {
});
// `Reflect.has` method
-// https://tc39.github.io/ecma262/#sec-reflect.has
+// https://tc39.es/ecma262/#sec-reflect.has
_export({ target: 'Reflect', stat: true }, {
has: function has(target, propertyKey) {
return propertyKey in target;
@@ -7572,7 +7609,7 @@ _export({ target: 'Reflect', stat: true }, {
var objectIsExtensible = Object.isExtensible;
// `Reflect.isExtensible` method
-// https://tc39.github.io/ecma262/#sec-reflect.isextensible
+// https://tc39.es/ecma262/#sec-reflect.isextensible
_export({ target: 'Reflect', stat: true }, {
isExtensible: function isExtensible(target) {
anObject(target);
@@ -7581,13 +7618,13 @@ _export({ target: 'Reflect', stat: true }, {
});
// `Reflect.ownKeys` method
-// https://tc39.github.io/ecma262/#sec-reflect.ownkeys
+// https://tc39.es/ecma262/#sec-reflect.ownkeys
_export({ target: 'Reflect', stat: true }, {
ownKeys: ownKeys
});
// `Reflect.preventExtensions` method
-// https://tc39.github.io/ecma262/#sec-reflect.preventextensions
+// https://tc39.es/ecma262/#sec-reflect.preventextensions
_export({ target: 'Reflect', stat: true, sham: !freezing }, {
preventExtensions: function preventExtensions(target) {
anObject(target);
@@ -7602,7 +7639,7 @@ _export({ target: 'Reflect', stat: true, sham: !freezing }, {
});
// `Reflect.set` method
-// https://tc39.github.io/ecma262/#sec-reflect.set
+// https://tc39.es/ecma262/#sec-reflect.set
function set$3(target, propertyKey, V /* , receiver */) {
var receiver = arguments.length < 4 ? target : arguments[3];
var ownDescriptor = objectGetOwnPropertyDescriptor.f(anObject(target), propertyKey);
@@ -7639,7 +7676,7 @@ _export({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, {
});
// `Reflect.setPrototypeOf` method
-// https://tc39.github.io/ecma262/#sec-reflect.setprototypeof
+// https://tc39.es/ecma262/#sec-reflect.setprototypeof
if (objectSetPrototypeOf) _export({ target: 'Reflect', stat: true }, {
setPrototypeOf: function setPrototypeOf(target, proto) {
anObject(target);
@@ -8205,7 +8242,7 @@ var deserialize = function (it) {
var find$1 = /[!'()~]|%20/g;
-var replace = {
+var replace$1 = {
'!': '%21',
"'": '%27',
'(': '%28',
@@ -8215,7 +8252,7 @@ var replace = {
};
var replacer = function (match) {
- return replace[match];
+ return replace$1[match];
};
var serialize = function (it) {
@@ -9722,7 +9759,7 @@ _export({ target: 'Map', proto: true, real: true, forced: isPure }, {
});
// `SameValueZero` abstract operation
-// https://tc39.github.io/ecma262/#sec-samevaluezero
+// https://tc39.es/ecma262/#sec-samevaluezero
var sameValueZero = function (x, y) {
// eslint-disable-next-line no-self-compare
return x === y || x != x && y != y;
@@ -10155,13 +10192,13 @@ _export({ global: true }, {
});
var min$9 = Math.min;
-var max$4 = Math.max;
+var max$5 = Math.max;
// `Math.clamp` method
// https://rwaldron.github.io/proposal-math-extensions/
_export({ target: 'Math', stat: true }, {
clamp: function clamp(x, lower, upper) {
- return min$9(upper, max$4(lower, x));
+ return min$9(upper, max$5(lower, x));
}
});
diff --git a/test/form/samples/supports-es5-shim/_expected.js b/test/form/samples/supports-es5-shim/_expected.js
index 669b1265a..e6c25f06f 100644
--- a/test/form/samples/supports-es5-shim/_expected.js
+++ b/test/form/samples/supports-es5-shim/_expected.js
@@ -57,6 +57,9 @@ var es5Shim = createCommonjsModule(function (module, exports) {
var apply = FunctionPrototype.apply;
var max = Math.max;
var min = Math.min;
+ var floor = Math.floor;
+ var abs = Math.abs;
+ var pow = Math.pow;
// Having a toString local variable name breaks in Opera so use to_string.
var to_string = ObjectPrototype.toString;
@@ -74,9 +77,8 @@ var es5Shim = createCommonjsModule(function (module, exports) {
try {
var obj = {};
$Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
- for (var _ in obj) { // jscs:ignore disallowUnusedVariables
- return false;
- }
+ // eslint-disable-next-line no-unreachable-loop, max-statements-per-line
+ for (var _ in obj) { return false; } // jscs:ignore disallowUnusedVariables
return obj.x === obj;
} catch (e) { /* this is ES3 */
return false;
@@ -140,7 +142,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
if (isActualNaN(n)) {
n = 0;
} else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
- n = (n > 0 || -1) * Math.floor(Math.abs(n));
+ n = (n > 0 || -1) * floor(abs(n));
}
return n;
},
@@ -740,7 +742,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
i = min(i, ES.ToInteger(arguments[1]));
}
// handle negative indices
- i = i >= 0 ? i : length - Math.abs(i);
+ i = i >= 0 ? i : length - abs(i);
for (; i >= 0; i--) {
if (i in self && searchElement === self[i]) {
return i;
@@ -1314,8 +1316,8 @@ var es5Shim = createCommonjsModule(function (module, exports) {
var minute = this.getMinutes();
var second = this.getSeconds();
var timezoneOffset = this.getTimezoneOffset();
- var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60);
- var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60);
+ var hoursOffset = floor(abs(timezoneOffset) / 60);
+ var minutesOffset = floor(abs(timezoneOffset) % 60);
return dayName[day] + ' '
+ monthName[month] + ' '
+ (date < 10 ? '0' + date : date) + ' '
@@ -1361,7 +1363,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
var month = originalGetUTCMonth(this);
// see https://github.com/es-shims/es5-shim/issues/111
- year += Math.floor(month / 12);
+ year += floor(month / 12);
month = ((month % 12) + 12) % 12;
// the date time string format is specified in 15.9.1.15.
@@ -1374,7 +1376,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
];
year = (
(year < 0 ? '-' : (year > 9999 ? '+' : ''))
- + strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6)
+ + strSlice('00000' + abs(year), (0 <= year && year <= 9999) ? -4 : -6)
);
for (var i = 0; i < result.length; ++i) {
@@ -1452,7 +1454,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) {
// XXX global assignment won't work in embeddings that use
// an alternate object for the context.
- var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1;
+ var maxSafeUnsigned32Bit = pow(2, 31) - 1;
var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime());
// eslint-disable-next-line no-implicit-globals, no-global-assign
Date = (function (NativeDate) {
@@ -1465,8 +1467,8 @@ var es5Shim = createCommonjsModule(function (module, exports) {
var millis = ms;
if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) {
// work around a Safari 8/9 bug where it treats the seconds as signed
- var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
- var sToShift = Math.floor(msToShift / 1e3);
+ var msToShift = floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
+ var sToShift = floor(msToShift / 1e3);
seconds += sToShift;
millis -= sToShift * 1e3;
}
@@ -1521,9 +1523,9 @@ var es5Shim = createCommonjsModule(function (module, exports) {
var t = month > 1 ? 1 : 0;
return (
months[month]
- + Math.floor((year - 1969 + t) / 4)
- - Math.floor((year - 1901 + t) / 100)
- + Math.floor((year - 1601 + t) / 400)
+ + floor((year - 1969 + t) / 4)
+ - floor((year - 1901 + t) / 100)
+ + floor((year - 1601 + t) / 400)
+ (365 * (year - 1970))
);
};
@@ -1533,8 +1535,8 @@ var es5Shim = createCommonjsModule(function (module, exports) {
var ms = t;
if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) {
// work around a Safari 8/9 bug where it treats the seconds as signed
- var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
- var sToShift = Math.floor(msToShift / 1e3);
+ var msToShift = floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
+ var sToShift = floor(msToShift / 1e3);
s += sToShift;
ms -= sToShift * 1e3;
}
@@ -1569,7 +1571,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
hour = $Number(match[4] || 0),
minute = $Number(match[5] || 0),
second = $Number(match[6] || 0),
- millisecond = Math.floor($Number(match[7] || 0) * 1000),
+ millisecond = floor($Number(match[7] || 0) * 1000),
// When time zone is missed, local offset should be used
// (ES 5.1 bug)
// see https://bugs.ecmascript.org/show_bug.cgi?id=112
@@ -1645,7 +1647,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
while (++i < toFixedHelpers.size) {
c2 += n * toFixedHelpers.data[i];
toFixedHelpers.data[i] = c2 % toFixedHelpers.base;
- c2 = Math.floor(c2 / toFixedHelpers.base);
+ c2 = floor(c2 / toFixedHelpers.base);
}
},
divide: function divide(n) {
@@ -1653,7 +1655,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
var c = 0;
while (--i >= 0) {
c += toFixedHelpers.data[i];
- toFixedHelpers.data[i] = Math.floor(c / n);
+ toFixedHelpers.data[i] = floor(c / n);
c = (c % n) * toFixedHelpers.base;
}
},
@@ -1695,7 +1697,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
// Test for NaN and round fractionDigits down
f = $Number(fractionDigits);
- f = isActualNaN(f) ? 0 : Math.floor(f);
+ f = isActualNaN(f) ? 0 : floor(f);
if (f < 0 || f > 20) {
throw new RangeError('Number.toFixed called with invalid number of decimals');
@@ -1726,7 +1728,7 @@ var es5Shim = createCommonjsModule(function (module, exports) {
// -70 < log2(x) < 70
e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69;
z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1));
- z *= 0x10000000000000; // Math.pow(2, 52);
+ z *= 0x10000000000000; // pow(2, 52);
e = 52 - e;
// -18 < e < 122
@@ -1819,9 +1821,9 @@ var es5Shim = createCommonjsModule(function (module, exports) {
) {
(function () {
var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group
- var maxSafe32BitInt = Math.pow(2, 32) - 1;
+ var maxSafe32BitInt = pow(2, 32) - 1;
- StringPrototype.split = function (separator, limit) {
+ StringPrototype.split = function split(separator, limit) {
var string = String(this);
if (typeof separator === 'undefined' && limit === 0) {
return [];
@@ -1848,8 +1850,8 @@ var es5Shim = createCommonjsModule(function (module, exports) {
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // maxSafe32BitInt
* If 0, Infinity, or NaN: 0
- * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
- * If negative number: 4294967296 - Math.floor(Math.abs(limit))
+ * If positive number: limit = floor(limit); if (limit > 4294967295) limit -= 4294967296;
+ * If negative number: 4294967296 - floor(abs(limit))
* If other: Type-convert, then use the above rules
*/
var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit);
diff --git a/test/function/index.js b/test/function/index.js
index 703d670bb..0f2a85d63 100644
--- a/test/function/index.js
+++ b/test/function/index.js
@@ -3,8 +3,9 @@ const assert = require('assert');
const rollup = require('../../dist/rollup');
const { compareError, compareWarnings, runTestSuiteWithSamples } = require('../utils.js');
-function requireWithContext(code, context, module) {
- const contextWithExports = Object.assign({}, context, { module, exports: module.exports });
+function requireWithContext(code, context, exports) {
+ const module = { exports };
+ const contextWithExports = Object.assign({}, context, { module, exports });
const contextKeys = Object.keys(contextWithExports);
const contextValues = contextKeys.map(key => contextWithExports[key]);
try {
@@ -30,7 +31,7 @@ function runCodeSplitTest(codeMap, entryId, configContext) {
return (exportsMap[outputId] = requireWithContext(
code,
Object.assign({ require: requireFromOutputVia(outputId) }, context),
- (exportsMap[outputId] = { exports: {} })
+ (exportsMap[outputId] = {})
));
} else {
return require(importee);
diff --git a/test/function/samples/add-watch-file-generate/_config.js b/test/function/samples/add-watch-file-generate/_config.js
index 38c4562c7..49d71307e 100644
--- a/test/function/samples/add-watch-file-generate/_config.js
+++ b/test/function/samples/add-watch-file-generate/_config.js
@@ -6,7 +6,7 @@ module.exports = {
plugins: {
name: 'test-plugin',
renderStart() {
- this.addWatchFile(path.resolve(__dirname, 'watched.js'));
+ this.addWatchFile(path.join(__dirname, 'watched.js'));
}
}
},
diff --git a/test/function/samples/chunk-external-dependency-execution-order/_config.js b/test/function/samples/chunk-external-dependency-execution-order/_config.js
new file mode 100644
index 000000000..2fde7185a
--- /dev/null
+++ b/test/function/samples/chunk-external-dependency-execution-order/_config.js
@@ -0,0 +1,20 @@
+const assert = require('assert');
+const executionOrder = [];
+
+module.exports = {
+ description:
+ 'Uses correct execution order when several modules in a chunk have external dependencies',
+ context: {
+ executionOrder,
+ require(id) {
+ executionOrder.push(id);
+ return {};
+ }
+ },
+ options: {
+ external: ['external-first', 'external-second']
+ },
+ exports() {
+ assert.deepStrictEqual(executionOrder, ['external-first', 'external-second', 'dep', 'main']);
+ }
+};
diff --git a/test/function/samples/chunk-external-dependency-execution-order/dep.js b/test/function/samples/chunk-external-dependency-execution-order/dep.js
new file mode 100644
index 000000000..e37ed9b73
--- /dev/null
+++ b/test/function/samples/chunk-external-dependency-execution-order/dep.js
@@ -0,0 +1,2 @@
+import 'external-second';
+executionOrder.push('dep');
diff --git a/test/function/samples/chunk-external-dependency-execution-order/main.js b/test/function/samples/chunk-external-dependency-execution-order/main.js
new file mode 100644
index 000000000..87a6fbf96
--- /dev/null
+++ b/test/function/samples/chunk-external-dependency-execution-order/main.js
@@ -0,0 +1,3 @@
+import 'external-first';
+import './dep.js';
+executionOrder.push('main');
diff --git a/test/function/samples/circular-default-exports/_config.js b/test/function/samples/circular-default-exports/_config.js
new file mode 100644
index 000000000..37b931422
--- /dev/null
+++ b/test/function/samples/circular-default-exports/_config.js
@@ -0,0 +1,11 @@
+module.exports = {
+ description: 'handles circular default exports',
+ warnings: [
+ {
+ code: 'CIRCULAR_DEPENDENCY',
+ cycle: ['main.js', 'main.js'],
+ importer: 'main.js',
+ message: 'Circular dependency: main.js -> main.js'
+ }
+ ]
+};
diff --git a/test/function/samples/circular-default-exports/main.js b/test/function/samples/circular-default-exports/main.js
new file mode 100644
index 000000000..7e137f762
--- /dev/null
+++ b/test/function/samples/circular-default-exports/main.js
@@ -0,0 +1,3 @@
+import foo from './main.js';
+
+export default foo;
diff --git a/test/function/samples/circular-missed-reexports-2/_config.js b/test/function/samples/circular-missed-reexports-2/_config.js
index 04075a8bb..acd615579 100644
--- a/test/function/samples/circular-missed-reexports-2/_config.js
+++ b/test/function/samples/circular-missed-reexports-2/_config.js
@@ -7,23 +7,14 @@ module.exports = {
assert.strictEqual(exports.exists, 42);
},
error: {
- code: 'MISSING_EXPORT',
- id: path.resolve(__dirname, 'dep2.js'),
- frame: `
-1: export { doesNotExist } from './dep1.js';
- ^`,
- loc: {
- column: 9,
- file: path.resolve(__dirname, 'dep2.js'),
- line: 1
- },
- message: "'doesNotExist' is not exported by dep1.js, imported by dep2.js",
- pos: 9,
- url: 'https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module',
+ code: 'CIRCULAR_REEXPORT',
+ id: path.join(__dirname, 'dep1.js'),
+ message:
+ '"doesNotExist" cannot be exported from dep1.js as it is a reexport that references itself.',
watchFiles: [
- path.resolve(__dirname, 'main.js'),
- path.resolve(__dirname, 'dep1.js'),
- path.resolve(__dirname, 'dep2.js')
+ path.join(__dirname, 'main.js'),
+ path.join(__dirname, 'dep1.js'),
+ path.join(__dirname, 'dep2.js')
]
}
};
diff --git a/test/function/samples/circular-missed-reexports/_config.js b/test/function/samples/circular-missed-reexports/_config.js
index 469d378d4..3e576566b 100644
--- a/test/function/samples/circular-missed-reexports/_config.js
+++ b/test/function/samples/circular-missed-reexports/_config.js
@@ -1,6 +1,9 @@
const assert = require('assert');
const path = require('path');
+const ID_MAIN = path.join(__dirname, 'main.js');
+const ID_DEP1 = path.join(__dirname, 'dep1.js');
+
module.exports = {
description: 'handles circular reexports',
exports(exports) {
@@ -21,20 +24,20 @@ module.exports = {
},
{
code: 'NON_EXISTENT_EXPORT',
- frame: `
-1: import { exists, doesNotExist } from './dep1.js';
- ^
-2: export { exists };`,
- id: path.resolve(__dirname, 'main.js'),
- loc: {
- column: 17,
- file: path.resolve(__dirname, 'main.js'),
- line: 1
- },
message: "Non-existent export 'doesNotExist' is imported from dep1.js",
name: 'doesNotExist',
+ source: ID_DEP1,
+ id: ID_MAIN,
pos: 17,
- source: path.resolve(__dirname, 'dep1.js')
+ loc: {
+ file: ID_MAIN,
+ line: 1,
+ column: 17
+ },
+ frame: `
+1: import { exists, doesNotExist } from './dep1.js';
+ ^
+2: export { exists };`
}
]
};
diff --git a/test/function/samples/circular-preserve-modules/_config.js b/test/function/samples/circular-preserve-modules/_config.js
new file mode 100644
index 000000000..097090160
--- /dev/null
+++ b/test/function/samples/circular-preserve-modules/_config.js
@@ -0,0 +1,41 @@
+const path = require('path');
+const ID_MAIN = path.join(__dirname, 'main.js');
+const ID_FIRST = path.join(__dirname, 'first.js');
+const ID_SECOND = path.join(__dirname, 'second.js');
+
+module.exports = {
+ description: 'correctly handles circular dependencies whe preserving modules',
+ options: {
+ output: { preserveModules: true }
+ },
+ warnings: [
+ {
+ code: 'CIRCULAR_DEPENDENCY',
+ cycle: ['main.js', 'first.js', 'main.js'],
+ importer: 'main.js',
+ message: 'Circular dependency: main.js -> first.js -> main.js'
+ },
+ {
+ code: 'CIRCULAR_DEPENDENCY',
+ cycle: ['main.js', 'second.js', 'main.js'],
+ importer: 'main.js',
+ message: 'Circular dependency: main.js -> second.js -> main.js'
+ },
+ {
+ code: 'CYCLIC_CROSS_CHUNK_REEXPORT',
+ exporter: ID_SECOND,
+ importer: ID_FIRST,
+ message:
+ 'Export "second" of module second.js was reexported through module main.js while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in first.js to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.',
+ reexporter: ID_MAIN
+ },
+ {
+ code: 'CYCLIC_CROSS_CHUNK_REEXPORT',
+ exporter: ID_FIRST,
+ importer: ID_SECOND,
+ message:
+ 'Export "first" of module first.js was reexported through module main.js while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in second.js to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.',
+ reexporter: ID_MAIN
+ }
+ ]
+};
diff --git a/test/function/samples/circular-preserve-modules/first.js b/test/function/samples/circular-preserve-modules/first.js
new file mode 100644
index 000000000..1340624df
--- /dev/null
+++ b/test/function/samples/circular-preserve-modules/first.js
@@ -0,0 +1,3 @@
+import { second } from './main.js';
+export const first = 'first';
+export const getSecond = () => second;
diff --git a/test/function/samples/circular-preserve-modules/main.js b/test/function/samples/circular-preserve-modules/main.js
new file mode 100644
index 000000000..ccbddd804
--- /dev/null
+++ b/test/function/samples/circular-preserve-modules/main.js
@@ -0,0 +1,8 @@
+import { getSecond } from './first';
+import { second, getFirst } from './second';
+
+export { first } from './first.js';
+export { second };
+
+assert.strictEqual(getFirst(), 'first');
+assert.strictEqual(getSecond(), 'second');
diff --git a/test/function/samples/circular-preserve-modules/second.js b/test/function/samples/circular-preserve-modules/second.js
new file mode 100644
index 000000000..4f961d680
--- /dev/null
+++ b/test/function/samples/circular-preserve-modules/second.js
@@ -0,0 +1,3 @@
+import { first } from './main.js';
+export const second = 'second';
+export const getFirst = () => first;
diff --git a/test/function/samples/context-resolve-skipself/_config.js b/test/function/samples/context-resolve-skipself/_config.js
index 8ed89faf6..9376a2c68 100644
--- a/test/function/samples/context-resolve-skipself/_config.js
+++ b/test/function/samples/context-resolve-skipself/_config.js
@@ -15,7 +15,7 @@ module.exports = {
},
load(id) {
if (id === 'resolutions') {
- const importer = path.resolve(__dirname, 'main.js');
+ const importer = path.join(__dirname, 'main.js');
return Promise.all([
this.resolve('test', importer).then(result => ({ id: result.id, text: 'all' })),
this.resolve('test', importer, { skipSelf: false }).then(result => ({
diff --git a/test/function/samples/context-resolve/_config.js b/test/function/samples/context-resolve/_config.js
index 567679e9f..9c83e137c 100644
--- a/test/function/samples/context-resolve/_config.js
+++ b/test/function/samples/context-resolve/_config.js
@@ -5,7 +5,7 @@ const tests = [
{
source: './existing',
expected: {
- id: path.resolve(__dirname, 'existing.js'),
+ id: path.join(__dirname, 'existing.js'),
external: false,
meta: {},
moduleSideEffects: true,
@@ -23,7 +23,7 @@ const tests = [
{
source: './marked-directly-external-relative',
expected: {
- id: path.resolve(__dirname, 'marked-directly-external-relative'),
+ id: path.join(__dirname, 'marked-directly-external-relative'),
external: true,
meta: {},
moduleSideEffects: true,
@@ -33,7 +33,7 @@ const tests = [
{
source: './marked-external-relative',
expected: {
- id: path.resolve(__dirname, 'marked-external-relative'),
+ id: path.join(__dirname, 'marked-external-relative'),
external: true,
meta: {},
moduleSideEffects: true,
@@ -108,7 +108,7 @@ module.exports = {
external: [
'marked-external-absolute',
'./marked-directly-external-relative',
- path.resolve(__dirname, 'marked-external-relative')
+ path.join(__dirname, 'marked-external-relative')
],
plugins: [
{
@@ -121,7 +121,7 @@ module.exports = {
if (id === 'resolutions') {
return Promise.all(
tests.map(({ source, expected }) =>
- this.resolve(source, path.resolve(__dirname, 'main.js')).then(resolution =>
+ this.resolve(source, path.join(__dirname, 'main.js')).then(resolution =>
assert.deepStrictEqual(resolution, expected)
)
)
diff --git a/test/function/samples/custom-external-resolver-async/_config.js b/test/function/samples/custom-external-resolver-async/_config.js
index 295b6a050..9676201eb 100644
--- a/test/function/samples/custom-external-resolver-async/_config.js
+++ b/test/function/samples/custom-external-resolver-async/_config.js
@@ -8,7 +8,7 @@ module.exports = {
{
resolveId(id, importer) {
if (importer && id[0] !== '.')
- return Promise.resolve(path.resolve(__dirname, 'js_modules', id + '.js'));
+ return Promise.resolve(path.join(__dirname, 'js_modules', id + '.js'));
}
}
]
diff --git a/test/function/samples/custom-external-resolver-sync/_config.js b/test/function/samples/custom-external-resolver-sync/_config.js
index fab5ad51e..c86de8bf3 100644
--- a/test/function/samples/custom-external-resolver-sync/_config.js
+++ b/test/function/samples/custom-external-resolver-sync/_config.js
@@ -7,7 +7,7 @@ module.exports = {
plugins: [
{
resolveId(id, importer) {
- if (importer && id[0] !== '.') return path.resolve(__dirname, 'js_modules', id + '.js');
+ if (importer && id[0] !== '.') return path.join(__dirname, 'js_modules', id + '.js');
}
}
]
diff --git a/test/function/samples/custom-path-resolver-async/_config.js b/test/function/samples/custom-path-resolver-async/_config.js
index 6303250b7..7e568daaa 100644
--- a/test/function/samples/custom-path-resolver-async/_config.js
+++ b/test/function/samples/custom-path-resolver-async/_config.js
@@ -9,10 +9,10 @@ module.exports = {
resolveId(importee, importer) {
let resolved;
- if (path.normalize(importee) === path.resolve(__dirname, 'main.js')) return importee;
+ if (path.normalize(importee) === path.join(__dirname, 'main.js')) return importee;
if (importee === 'foo') {
- resolved = path.resolve(__dirname, 'bar.js');
+ resolved = path.join(__dirname, 'bar.js');
} else {
resolved = false;
}
diff --git a/test/function/samples/custom-path-resolver-on-entry/_config.js b/test/function/samples/custom-path-resolver-on-entry/_config.js
index a700664fa..fe037e6ab 100644
--- a/test/function/samples/custom-path-resolver-on-entry/_config.js
+++ b/test/function/samples/custom-path-resolver-on-entry/_config.js
@@ -17,7 +17,7 @@ module.exports = {
}
if (importer[0] === '@') {
- return path.resolve(__dirname, importee) + '.js';
+ return path.join(__dirname, importee) + '.js';
}
},
load(moduleId) {
diff --git a/test/function/samples/custom-path-resolver-plural/_config.js b/test/function/samples/custom-path-resolver-plural/_config.js
index 6287c6896..e95e1b188 100644
--- a/test/function/samples/custom-path-resolver-plural/_config.js
+++ b/test/function/samples/custom-path-resolver-plural/_config.js
@@ -8,7 +8,7 @@ module.exports = {
{
resolveId(importee) {
if (importee[0] === '@')
- return path.resolve(__dirname, 'globals-' + importee.slice(1).toLowerCase() + '.js');
+ return path.join(__dirname, 'globals-' + importee.slice(1).toLowerCase() + '.js');
},
load(id) {
if (id === '') return '';
diff --git a/test/function/samples/custom-path-resolver-sync/_config.js b/test/function/samples/custom-path-resolver-sync/_config.js
index 6b54dc7d9..373cb3f00 100644
--- a/test/function/samples/custom-path-resolver-sync/_config.js
+++ b/test/function/samples/custom-path-resolver-sync/_config.js
@@ -7,8 +7,8 @@ module.exports = {
plugins: [
{
resolveId(importee, importer) {
- if (path.normalize(importee) === path.resolve(__dirname, 'main.js')) return importee;
- if (importee === 'foo') return path.resolve(__dirname, 'bar.js');
+ if (path.normalize(importee) === path.join(__dirname, 'main.js')) return importee;
+ if (importee === 'foo') return path.join(__dirname, 'bar.js');
return false;
}
diff --git a/test/function/samples/default-not-reexported/_config.js b/test/function/samples/default-not-reexported/_config.js
index c0800c241..9849876b1 100644
--- a/test/function/samples/default-not-reexported/_config.js
+++ b/test/function/samples/default-not-reexported/_config.js
@@ -5,15 +5,15 @@ module.exports = {
error: {
code: 'MISSING_EXPORT',
message: `'default' is not exported by foo.js, imported by main.js`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
pos: 7,
watchFiles: [
- path.resolve(__dirname, 'main.js'),
- path.resolve(__dirname, 'foo.js'),
- path.resolve(__dirname, 'bar.js')
+ path.join(__dirname, 'main.js'),
+ path.join(__dirname, 'foo.js'),
+ path.join(__dirname, 'bar.js')
],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 7
},
diff --git a/test/function/samples/deprecated/context-resolve-id/_config.js b/test/function/samples/deprecated/context-resolve-id/_config.js
index b4b3c82b9..17c7fee18 100644
--- a/test/function/samples/deprecated/context-resolve-id/_config.js
+++ b/test/function/samples/deprecated/context-resolve-id/_config.js
@@ -66,7 +66,7 @@ module.exports = {
switch (id) {
case 'object':
return {
- id: path.resolve(__dirname, 'existing-object.js'),
+ id: path.join(__dirname, 'existing-object.js'),
external: false
};
case 'external-object':
@@ -75,7 +75,7 @@ module.exports = {
external: true
};
case 'name':
- return path.resolve(__dirname, 'existing-name.js');
+ return path.join(__dirname, 'existing-name.js');
case 'external-name':
return false;
}
diff --git a/test/function/samples/deprecated/emit-asset/set-asset-source-transform/_config.js b/test/function/samples/deprecated/emit-asset/set-asset-source-transform/_config.js
index f8aa86b8e..a65b559c3 100644
--- a/test/function/samples/deprecated/emit-asset/set-asset-source-transform/_config.js
+++ b/test/function/samples/deprecated/emit-asset/set-asset-source-transform/_config.js
@@ -21,6 +21,6 @@ module.exports = {
'setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.',
plugin: 'test-plugin',
pluginCode: 'INVALID_SETASSETSOURCE',
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/_config.js b/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/_config.js
index 1315b984b..b9f7b0369 100644
--- a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/_config.js
+++ b/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/_config.js
@@ -20,6 +20,6 @@ module.exports = {
'Plugin error - Unable to get file name for chunk "chunk.js". Ensure that generate is called first.',
plugin: 'test-plugin',
pluginCode: 'CHUNK_NOT_GENERATED',
- watchFiles: [path.resolve(__dirname, 'chunk.js')]
+ watchFiles: [path.join(__dirname, 'chunk.js')]
}
};
diff --git a/test/function/samples/deprecated/emit-chunk/chunk-not-found/_config.js b/test/function/samples/deprecated/emit-chunk/chunk-not-found/_config.js
index 4e8fb6450..c731c60c9 100644
--- a/test/function/samples/deprecated/emit-chunk/chunk-not-found/_config.js
+++ b/test/function/samples/deprecated/emit-chunk/chunk-not-found/_config.js
@@ -14,6 +14,6 @@ module.exports = {
error: {
code: 'UNRESOLVED_ENTRY',
message: 'Could not resolve entry module (not-found.js).',
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/deprecated/manual-chunks-info/_config.js b/test/function/samples/deprecated/manual-chunks-info/_config.js
index f6ef4e03e..48da2a15c 100644
--- a/test/function/samples/deprecated/manual-chunks-info/_config.js
+++ b/test/function/samples/deprecated/manual-chunks-info/_config.js
@@ -2,7 +2,7 @@ const assert = require('assert');
const path = require('path');
function getId(name) {
- return path.resolve(__dirname, `${name}.js`);
+ return path.join(__dirname, `${name}.js`);
}
module.exports = {
diff --git a/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js b/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js
index 4c0c32419..239d8f849 100644
--- a/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js
+++ b/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js
@@ -10,14 +10,14 @@ module.exports = {
warnings: [
{
code: 'MIXED_EXPORTS',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
message:
'Entry module "main.js" is using named and default exports together. Consumers of your bundle will have to use `chunk["default"]` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning',
url: 'https://rollupjs.org/guide/en/#outputexports'
},
{
code: 'MIXED_EXPORTS',
- id: path.resolve(__dirname, 'lib1.js'),
+ id: path.join(__dirname, 'lib1.js'),
message:
'Entry module "lib1.js" is using named and default exports together. Consumers of your bundle will have to use `chunk["default"]` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning',
url: 'https://rollupjs.org/guide/en/#outputexports'
diff --git a/test/function/samples/double-default-export/_config.js b/test/function/samples/double-default-export/_config.js
index 9a928a5e0..8116bd5ec 100644
--- a/test/function/samples/double-default-export/_config.js
+++ b/test/function/samples/double-default-export/_config.js
@@ -5,7 +5,7 @@ module.exports = {
error: {
code: 'PARSE_ERROR',
message: `Duplicate export 'default'`,
- id: path.resolve(__dirname, 'foo.js'),
+ id: path.join(__dirname, 'foo.js'),
parserError: {
loc: {
column: 7,
@@ -16,9 +16,9 @@ module.exports = {
raisedAt: 34
},
pos: 25,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'foo.js')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')],
loc: {
- file: path.resolve(__dirname, 'foo.js'),
+ file: path.join(__dirname, 'foo.js'),
line: 2,
column: 7
},
diff --git a/test/function/samples/double-named-export/_config.js b/test/function/samples/double-named-export/_config.js
index 7c24f8d04..eee927b47 100644
--- a/test/function/samples/double-named-export/_config.js
+++ b/test/function/samples/double-named-export/_config.js
@@ -5,7 +5,7 @@ module.exports = {
error: {
code: 'PARSE_ERROR',
message: `Duplicate export 'foo'`,
- id: path.resolve(__dirname, 'foo.js'),
+ id: path.join(__dirname, 'foo.js'),
parserError: {
loc: {
column: 9,
@@ -16,9 +16,9 @@ module.exports = {
raisedAt: 43
},
pos: 38,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'foo.js')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')],
loc: {
- file: path.resolve(__dirname, 'foo.js'),
+ file: path.join(__dirname, 'foo.js'),
line: 3,
column: 9
},
diff --git a/test/function/samples/double-named-reexport/_config.js b/test/function/samples/double-named-reexport/_config.js
index 597181042..d63163621 100644
--- a/test/function/samples/double-named-reexport/_config.js
+++ b/test/function/samples/double-named-reexport/_config.js
@@ -5,7 +5,7 @@ module.exports = {
error: {
code: 'PARSE_ERROR',
message: `Duplicate export 'foo'`,
- id: path.resolve(__dirname, 'foo.js'),
+ id: path.join(__dirname, 'foo.js'),
parserError: {
loc: {
column: 9,
@@ -16,9 +16,9 @@ module.exports = {
raisedAt: 43
},
pos: 38,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'foo.js')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')],
loc: {
- file: path.resolve(__dirname, 'foo.js'),
+ file: path.join(__dirname, 'foo.js'),
line: 3,
column: 9
},
diff --git a/test/function/samples/duplicate-import-fails/_config.js b/test/function/samples/duplicate-import-fails/_config.js
index a52a5446a..71345e647 100644
--- a/test/function/samples/duplicate-import-fails/_config.js
+++ b/test/function/samples/duplicate-import-fails/_config.js
@@ -5,7 +5,7 @@ module.exports = {
error: {
code: 'PARSE_ERROR',
message: `Identifier 'a' has already been declared`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
parserError: {
loc: {
column: 9,
@@ -16,9 +16,9 @@ module.exports = {
raisedAt: 39
},
pos: 36,
- watchFiles: [path.resolve(__dirname, 'main.js')],
+ watchFiles: [path.join(__dirname, 'main.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 2,
column: 9
},
diff --git a/test/function/samples/duplicate-import-specifier-fails/_config.js b/test/function/samples/duplicate-import-specifier-fails/_config.js
index a62bacdda..64d88e099 100644
--- a/test/function/samples/duplicate-import-specifier-fails/_config.js
+++ b/test/function/samples/duplicate-import-specifier-fails/_config.js
@@ -5,7 +5,7 @@ module.exports = {
error: {
code: 'PARSE_ERROR',
message: `Identifier 'a' has already been declared`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
parserError: {
loc: {
column: 12,
@@ -16,9 +16,9 @@ module.exports = {
raisedAt: 15
},
pos: 12,
- watchFiles: [path.resolve(__dirname, 'main.js')],
+ watchFiles: [path.join(__dirname, 'main.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 12
},
diff --git a/test/function/samples/dynamic-import-relative-not-found/_config.js b/test/function/samples/dynamic-import-relative-not-found/_config.js
index 5e7bf79c9..5b8631590 100644
--- a/test/function/samples/dynamic-import-relative-not-found/_config.js
+++ b/test/function/samples/dynamic-import-relative-not-found/_config.js
@@ -5,6 +5,6 @@ module.exports = {
error: {
code: 'UNRESOLVED_IMPORT',
message: `Could not resolve './mod' from main.js`,
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/emit-file/chunk-filename-not-available/_config.js b/test/function/samples/emit-file/chunk-filename-not-available/_config.js
index 48d5280a8..eb87d7d65 100644
--- a/test/function/samples/emit-file/chunk-filename-not-available/_config.js
+++ b/test/function/samples/emit-file/chunk-filename-not-available/_config.js
@@ -19,6 +19,6 @@ module.exports = {
'Plugin error - Unable to get file name for chunk "chunk.js". Ensure that generate is called first.',
plugin: 'test-plugin',
pluginCode: 'CHUNK_NOT_GENERATED',
- watchFiles: [path.resolve(__dirname, 'chunk.js')]
+ watchFiles: [path.join(__dirname, 'chunk.js')]
}
};
diff --git a/test/function/samples/emit-file/chunk-not-found/_config.js b/test/function/samples/emit-file/chunk-not-found/_config.js
index b136c0750..9c0df8d77 100644
--- a/test/function/samples/emit-file/chunk-not-found/_config.js
+++ b/test/function/samples/emit-file/chunk-not-found/_config.js
@@ -13,6 +13,6 @@ module.exports = {
error: {
code: 'UNRESOLVED_ENTRY',
message: 'Could not resolve entry module (not-found.js).',
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/emit-file/set-asset-source-chunk/_config.js b/test/function/samples/emit-file/set-asset-source-chunk/_config.js
index b13d837e6..5c07fa155 100644
--- a/test/function/samples/emit-file/set-asset-source-chunk/_config.js
+++ b/test/function/samples/emit-file/set-asset-source-chunk/_config.js
@@ -17,6 +17,6 @@ module.exports = {
message: 'Asset sources can only be set for emitted assets but "6c87f683" is an emitted chunk.',
plugin: 'test-plugin',
pluginCode: 'VALIDATION_ERROR',
- watchFiles: [path.resolve(__dirname, 'chunk.js')]
+ watchFiles: [path.join(__dirname, 'chunk.js')]
}
};
diff --git a/test/function/samples/emit-file/set-asset-source-transform/_config.js b/test/function/samples/emit-file/set-asset-source-transform/_config.js
index 74078f755..8c38ccfd3 100644
--- a/test/function/samples/emit-file/set-asset-source-transform/_config.js
+++ b/test/function/samples/emit-file/set-asset-source-transform/_config.js
@@ -20,6 +20,6 @@ module.exports = {
'setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.',
plugin: 'test-plugin',
pluginCode: 'INVALID_SETASSETSOURCE',
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/error-after-transform-should-throw-correct-location/_config.js b/test/function/samples/error-after-transform-should-throw-correct-location/_config.js
index 9cc9f582a..5e5026bef 100644
--- a/test/function/samples/error-after-transform-should-throw-correct-location/_config.js
+++ b/test/function/samples/error-after-transform-should-throw-correct-location/_config.js
@@ -21,11 +21,11 @@ module.exports = {
error: {
code: 'MISSING_EXPORT',
message: `'default' is not exported by empty.js, imported by main.js`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
pos: 44,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'empty.js')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'empty.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 7
},
diff --git a/test/function/samples/error-parse-json/_config.js b/test/function/samples/error-parse-json/_config.js
index a7d15c32b..5e0f3c574 100644
--- a/test/function/samples/error-parse-json/_config.js
+++ b/test/function/samples/error-parse-json/_config.js
@@ -6,7 +6,7 @@ module.exports = {
error: {
code: 'PARSE_ERROR',
message: 'Unexpected token (Note that you need @rollup/plugin-json to import JSON files)',
- id: path.resolve(__dirname, 'file.json'),
+ id: path.join(__dirname, 'file.json'),
parserError: {
loc: {
column: 8,
@@ -17,9 +17,9 @@ module.exports = {
raisedAt: 11
},
pos: 10,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'file.json')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'file.json')],
loc: {
- file: path.resolve(__dirname, 'file.json'),
+ file: path.join(__dirname, 'file.json'),
line: 2,
column: 8
},
diff --git a/test/function/samples/error-parse-unknown-extension/_config.js b/test/function/samples/error-parse-unknown-extension/_config.js
index 3f8a81d87..207677786 100644
--- a/test/function/samples/error-parse-unknown-extension/_config.js
+++ b/test/function/samples/error-parse-unknown-extension/_config.js
@@ -7,7 +7,7 @@ module.exports = {
code: 'PARSE_ERROR',
message:
'Unexpected token (Note that you need plugins to import files that are not JavaScript)',
- id: path.resolve(__dirname, 'file.css'),
+ id: path.join(__dirname, 'file.css'),
parserError: {
loc: {
column: 0,
@@ -18,9 +18,9 @@ module.exports = {
raisedAt: 1
},
pos: 0,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'file.css')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'file.css')],
loc: {
- file: path.resolve(__dirname, 'file.css'),
+ file: path.join(__dirname, 'file.css'),
line: 1,
column: 0
},
diff --git a/test/function/samples/export-not-at-top-level-fails/_config.js b/test/function/samples/export-not-at-top-level-fails/_config.js
index 3ce0c368b..da4885365 100644
--- a/test/function/samples/export-not-at-top-level-fails/_config.js
+++ b/test/function/samples/export-not-at-top-level-fails/_config.js
@@ -5,7 +5,7 @@ module.exports = {
error: {
code: 'PARSE_ERROR',
message: `'import' and 'export' may only appear at the top level`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
parserError: {
loc: {
column: 2,
@@ -16,9 +16,9 @@ module.exports = {
raisedAt: 25
},
pos: 19,
- watchFiles: [path.resolve(__dirname, 'main.js')],
+ watchFiles: [path.join(__dirname, 'main.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 2,
column: 2
},
diff --git a/test/function/samples/external-conflict/_config.js b/test/function/samples/external-conflict/_config.js
index 7785cbb3d..bab7fcc4f 100644
--- a/test/function/samples/external-conflict/_config.js
+++ b/test/function/samples/external-conflict/_config.js
@@ -19,6 +19,6 @@ module.exports = {
code: 'INVALID_EXTERNAL_ID',
message:
"'dep' is imported as an external by dep, but is already an existing non-external module id.",
- watchFiles: [path.resolve(__dirname, 'main.js'), 'dep']
+ watchFiles: [path.join(__dirname, 'main.js'), 'dep']
}
};
diff --git a/test/function/samples/has-modules-array/_config.js b/test/function/samples/has-modules-array/_config.js
index 396779425..d8e116962 100644
--- a/test/function/samples/has-modules-array/_config.js
+++ b/test/function/samples/has-modules-array/_config.js
@@ -6,7 +6,7 @@ module.exports = {
bundle(bundle) {
assert.ok(bundle.cache.modules);
assert.equal(bundle.cache.modules.length, 2);
- assert.equal(path.relative(bundle.cache.modules[0].id, path.resolve(__dirname, 'foo.js')), '');
- assert.equal(path.relative(bundle.cache.modules[1].id, path.resolve(__dirname, 'main.js')), '');
+ assert.equal(path.relative(bundle.cache.modules[0].id, path.join(__dirname, 'foo.js')), '');
+ assert.equal(path.relative(bundle.cache.modules[1].id, path.join(__dirname, 'main.js')), '');
}
};
diff --git a/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/_config.js b/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/_config.js
index 5381c832b..ba8217895 100644
--- a/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/_config.js
+++ b/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/_config.js
@@ -19,9 +19,9 @@ module.exports = {
message:
'Module "dependant.js" that should be implicitly loaded before "dep.js" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.',
watchFiles: [
- path.resolve(__dirname, 'dep.js'),
- path.resolve(__dirname, 'main.js'),
- path.resolve(__dirname, 'dependant.js')
+ path.join(__dirname, 'dep.js'),
+ path.join(__dirname, 'main.js'),
+ path.join(__dirname, 'dependant.js')
]
}
};
diff --git a/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/_config.js b/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/_config.js
index 9016ee651..e89b39449 100644
--- a/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/_config.js
+++ b/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/_config.js
@@ -25,10 +25,10 @@ module.exports = {
message:
'Module "dependant.js" that should be implicitly loaded before "dep1.js" and "dep2.js" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.',
watchFiles: [
- path.resolve(__dirname, 'dep1.js'),
- path.resolve(__dirname, 'dep2.js'),
- path.resolve(__dirname, 'main.js'),
- path.resolve(__dirname, 'dependant.js')
+ path.join(__dirname, 'dep1.js'),
+ path.join(__dirname, 'dep2.js'),
+ path.join(__dirname, 'main.js'),
+ path.join(__dirname, 'dependant.js')
]
}
};
diff --git a/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js b/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js
index 5c6d7defe..484f9eb18 100644
--- a/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js
+++ b/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js
@@ -30,11 +30,11 @@ module.exports = {
message:
'Module "dependant.js" that should be implicitly loaded before "dep1.js", "dep2.js" and "dep3.js" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.',
watchFiles: [
- path.resolve(__dirname, 'dep1.js'),
- path.resolve(__dirname, 'dep2.js'),
- path.resolve(__dirname, 'dep3.js'),
- path.resolve(__dirname, 'main.js'),
- path.resolve(__dirname, 'dependant.js')
+ path.join(__dirname, 'dep1.js'),
+ path.join(__dirname, 'dep2.js'),
+ path.join(__dirname, 'dep3.js'),
+ path.join(__dirname, 'main.js'),
+ path.join(__dirname, 'dependant.js')
]
}
};
diff --git a/test/function/samples/implicit-dependencies/external-dependant/_config.js b/test/function/samples/implicit-dependencies/external-dependant/_config.js
index 5c0a96886..1f29a9694 100644
--- a/test/function/samples/implicit-dependencies/external-dependant/_config.js
+++ b/test/function/samples/implicit-dependencies/external-dependant/_config.js
@@ -18,6 +18,6 @@ module.exports = {
code: 'MISSING_IMPLICIT_DEPENDANT',
message:
'Module "does-not-exist" that should be implicitly loaded before "dep.js" could not be resolved.',
- watchFiles: [path.resolve(__dirname, 'dep.js'), path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'dep.js'), path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/implicit-dependencies/missing-dependant/_config.js b/test/function/samples/implicit-dependencies/missing-dependant/_config.js
index 8c857519f..325723678 100644
--- a/test/function/samples/implicit-dependencies/missing-dependant/_config.js
+++ b/test/function/samples/implicit-dependencies/missing-dependant/_config.js
@@ -23,6 +23,6 @@ module.exports = {
code: 'MISSING_IMPLICIT_DEPENDANT',
message:
'Module "external" that should be implicitly loaded before "dep.js" cannot be external.',
- watchFiles: [path.resolve(__dirname, 'dep.js'), path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'dep.js'), path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/import-meta-url/_config.js b/test/function/samples/import-meta-url/_config.js
index 93f48df9f..3a0fe70bc 100644
--- a/test/function/samples/import-meta-url/_config.js
+++ b/test/function/samples/import-meta-url/_config.js
@@ -5,9 +5,9 @@ const URL = require('url').URL;
module.exports = {
description: 'resolves import.meta.url',
context: {
- __filename: path.resolve(__dirname, 'main.js')
+ __filename: path.join(__dirname, 'main.js')
},
exports(exports) {
- assert.strictEqual(exports, new URL('file:' + path.resolve(__dirname, 'main.js')).href);
+ assert.strictEqual(exports, new URL('file:' + path.join(__dirname, 'main.js')).href);
}
};
diff --git a/test/function/samples/import-not-at-top-level-fails/_config.js b/test/function/samples/import-not-at-top-level-fails/_config.js
index 2aef5c09f..7fd52d4cd 100644
--- a/test/function/samples/import-not-at-top-level-fails/_config.js
+++ b/test/function/samples/import-not-at-top-level-fails/_config.js
@@ -5,7 +5,7 @@ module.exports = {
error: {
code: 'PARSE_ERROR',
message: `'import' and 'export' may only appear at the top level`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
parserError: {
loc: {
column: 2,
@@ -16,9 +16,9 @@ module.exports = {
raisedAt: 25
},
pos: 19,
- watchFiles: [path.resolve(__dirname, 'main.js')],
+ watchFiles: [path.join(__dirname, 'main.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 2,
column: 2
},
diff --git a/test/function/samples/import-of-unexported-fails/_config.js b/test/function/samples/import-of-unexported-fails/_config.js
index f5f8c2616..0dcf4450b 100644
--- a/test/function/samples/import-of-unexported-fails/_config.js
+++ b/test/function/samples/import-of-unexported-fails/_config.js
@@ -5,11 +5,11 @@ module.exports = {
error: {
code: 'MISSING_EXPORT',
message: `'default' is not exported by empty.js, imported by main.js`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
pos: 7,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'empty.js')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'empty.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 7
},
diff --git a/test/function/samples/invalid-transform-source-function/_config.js b/test/function/samples/invalid-transform-source-function/_config.js
index 2b0fa4b87..6f438d918 100644
--- a/test/function/samples/invalid-transform-source-function/_config.js
+++ b/test/function/samples/invalid-transform-source-function/_config.js
@@ -7,7 +7,7 @@ module.exports = {
output: {
name: 'myModule',
sourcemap: true,
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
sourcemapPathTransform: () => {}
}
},
diff --git a/test/function/samples/load-module-error/load/_config.js b/test/function/samples/load-module-error/load/_config.js
index 64d39bf09..dd8d970e9 100644
--- a/test/function/samples/load-module-error/load/_config.js
+++ b/test/function/samples/load-module-error/load/_config.js
@@ -24,6 +24,6 @@ module.exports = {
hook: 'load',
message: `Could not load broken (imported by main.js): It's broken!`,
plugin: 'test',
- watchFiles: [path.resolve(__dirname, 'main.js'), 'broken']
+ watchFiles: [path.join(__dirname, 'main.js'), 'broken']
}
};
diff --git a/test/function/samples/load-module-error/transform/_config.js b/test/function/samples/load-module-error/transform/_config.js
index f67d68487..582fd5ee4 100644
--- a/test/function/samples/load-module-error/transform/_config.js
+++ b/test/function/samples/load-module-error/transform/_config.js
@@ -17,11 +17,11 @@ module.exports = {
plugin: 'test',
message: 'nope',
hook: 'transform',
- id: path.resolve(__dirname, 'main.js'),
- watchFiles: [path.resolve(__dirname, 'main.js')],
+ id: path.join(__dirname, 'main.js'),
+ watchFiles: [path.join(__dirname, 'main.js')],
pos: 22,
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 22
},
diff --git a/test/function/samples/load-returns-string-or-null/_config.js b/test/function/samples/load-returns-string-or-null/_config.js
index 183a245ed..112cf25d6 100644
--- a/test/function/samples/load-returns-string-or-null/_config.js
+++ b/test/function/samples/load-returns-string-or-null/_config.js
@@ -15,6 +15,6 @@ module.exports = {
error: {
code: 'BAD_LOADER',
message: `Error loading main.js: plugin load hook should return a string, a { code, map } object, or nothing/null`,
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/manual-chunks-info/_config.js b/test/function/samples/manual-chunks-info/_config.js
index 28cb13fb3..abf3bde89 100644
--- a/test/function/samples/manual-chunks-info/_config.js
+++ b/test/function/samples/manual-chunks-info/_config.js
@@ -2,7 +2,7 @@ const assert = require('assert');
const path = require('path');
function getId(name) {
- return path.resolve(__dirname, `${name}.js`);
+ return path.join(__dirname, `${name}.js`);
}
module.exports = {
diff --git a/test/function/samples/module-level-directive/_config.js b/test/function/samples/module-level-directive/_config.js
index a1df1b730..fd2268f65 100644
--- a/test/function/samples/module-level-directive/_config.js
+++ b/test/function/samples/module-level-directive/_config.js
@@ -7,9 +7,9 @@ module.exports = {
code: 'MODULE_LEVEL_DIRECTIVE',
message: "Module level directives cause errors when bundled, 'use asm' was ignored.",
pos: 0,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 0
},
diff --git a/test/function/samples/namespace-missing-export/_config.js b/test/function/samples/namespace-missing-export/_config.js
index bcc083511..9381fe1d1 100644
--- a/test/function/samples/namespace-missing-export/_config.js
+++ b/test/function/samples/namespace-missing-export/_config.js
@@ -7,7 +7,7 @@ module.exports = {
code: 'MISSING_EXPORT',
exporter: 'empty.js',
importer: 'main.js',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
missing: 'foo',
message: `'foo' is not exported by 'empty.js'`,
pos: 61,
diff --git a/test/function/samples/namespace-reassign-import-fails/_config.js b/test/function/samples/namespace-reassign-import-fails/_config.js
index e081014db..752f31969 100644
--- a/test/function/samples/namespace-reassign-import-fails/_config.js
+++ b/test/function/samples/namespace-reassign-import-fails/_config.js
@@ -2,7 +2,7 @@ const assert = require('assert');
const path = require('path');
const { assertIncludes } = require('../../../utils.js');
-const ID_MAIN = path.resolve(__dirname, 'main.js');
+const ID_MAIN = path.join(__dirname, 'main.js');
module.exports = {
description: 'warns for reassignments to namespace exports',
diff --git a/test/function/samples/namespace-update-import-fails/_config.js b/test/function/samples/namespace-update-import-fails/_config.js
index d4f99b2e4..5edbe40fc 100644
--- a/test/function/samples/namespace-update-import-fails/_config.js
+++ b/test/function/samples/namespace-update-import-fails/_config.js
@@ -11,10 +11,10 @@ module.exports = {
{
code: 'ILLEGAL_NAMESPACE_REASSIGNMENT',
message: `Illegal reassignment to import 'exp'`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
pos: 31,
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 3,
column: 0
},
diff --git a/test/function/samples/no-relative-external/_config.js b/test/function/samples/no-relative-external/_config.js
index bcb0341d7..44f535fc1 100644
--- a/test/function/samples/no-relative-external/_config.js
+++ b/test/function/samples/no-relative-external/_config.js
@@ -5,6 +5,6 @@ module.exports = {
error: {
code: 'UNRESOLVED_IMPORT',
message: `Could not resolve './missing.js' from main.js`,
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/options-hook/_config.js b/test/function/samples/options-hook/_config.js
index bd82a9c9d..b217bd912 100644
--- a/test/function/samples/options-hook/_config.js
+++ b/test/function/samples/options-hook/_config.js
@@ -15,7 +15,7 @@ module.exports = {
preserveParens: false,
sourceType: 'module'
},
- acornInjectPlugins: [null, null, null],
+ acornInjectPlugins: [null, null],
context: 'undefined',
experimentalCacheExpiry: 10,
input: ['used'],
diff --git a/test/function/samples/paths-are-case-sensitive/_config.js b/test/function/samples/paths-are-case-sensitive/_config.js
index c9a6a4cbe..b881cc3e8 100644
--- a/test/function/samples/paths-are-case-sensitive/_config.js
+++ b/test/function/samples/paths-are-case-sensitive/_config.js
@@ -5,6 +5,6 @@ module.exports = {
error: {
code: 'UNRESOLVED_IMPORT',
message: `Could not resolve './foo.js' from main.js`,
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/plugin-error-loc-instead-pos/_config.js b/test/function/samples/plugin-error-loc-instead-pos/_config.js
index f6a36d10a..b203d1e5b 100644
--- a/test/function/samples/plugin-error-loc-instead-pos/_config.js
+++ b/test/function/samples/plugin-error-loc-instead-pos/_config.js
@@ -17,10 +17,10 @@ module.exports = {
plugin: 'test',
message: 'nope',
hook: 'transform',
- id: path.resolve(__dirname, 'main.js'),
- watchFiles: [path.resolve(__dirname, 'main.js')],
+ id: path.join(__dirname, 'main.js'),
+ watchFiles: [path.join(__dirname, 'main.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 22
},
diff --git a/test/function/samples/plugin-error-only-first-transform/_config.js b/test/function/samples/plugin-error-only-first-transform/_config.js
index 0b9e48979..174c3cb76 100644
--- a/test/function/samples/plugin-error-only-first-transform/_config.js
+++ b/test/function/samples/plugin-error-only-first-transform/_config.js
@@ -23,7 +23,7 @@ module.exports = {
message: `Something happened 1`,
plugin: 'plugin1',
hook: 'transform',
- id: path.resolve(__dirname, 'main.js'),
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ id: path.join(__dirname, 'main.js'),
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/plugin-error/load/_config.js b/test/function/samples/plugin-error/load/_config.js
index fd5902c20..b4748a391 100644
--- a/test/function/samples/plugin-error/load/_config.js
+++ b/test/function/samples/plugin-error/load/_config.js
@@ -15,8 +15,8 @@ module.exports = {
error: {
code: 'PLUGIN_ERROR',
plugin: 'test',
- message: `Could not load ${path.resolve(__dirname, 'main.js')}: nope`,
+ message: `Could not load ${path.join(__dirname, 'main.js')}: nope`,
hook: 'load',
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/plugin-error/transform/_config.js b/test/function/samples/plugin-error/transform/_config.js
index f67d68487..582fd5ee4 100644
--- a/test/function/samples/plugin-error/transform/_config.js
+++ b/test/function/samples/plugin-error/transform/_config.js
@@ -17,11 +17,11 @@ module.exports = {
plugin: 'test',
message: 'nope',
hook: 'transform',
- id: path.resolve(__dirname, 'main.js'),
- watchFiles: [path.resolve(__dirname, 'main.js')],
+ id: path.join(__dirname, 'main.js'),
+ watchFiles: [path.join(__dirname, 'main.js')],
pos: 22,
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 22
},
diff --git a/test/function/samples/plugin-warn-loc-instead-pos/_config.js b/test/function/samples/plugin-warn-loc-instead-pos/_config.js
index 995ed6d84..33f196fac 100644
--- a/test/function/samples/plugin-warn-loc-instead-pos/_config.js
+++ b/test/function/samples/plugin-warn-loc-instead-pos/_config.js
@@ -16,12 +16,12 @@ module.exports = {
warnings: [
{
code: 'PLUGIN_WARNING',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
plugin: 'test',
hook: 'transform',
message: 'foo',
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 22
},
diff --git a/test/function/samples/plugin-warn/_config.js b/test/function/samples/plugin-warn/_config.js
index ff0640f12..eee71ea3a 100644
--- a/test/function/samples/plugin-warn/_config.js
+++ b/test/function/samples/plugin-warn/_config.js
@@ -17,7 +17,7 @@ module.exports = {
warnings: [
{
code: 'PLUGIN_WARNING',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
hook: 'transform',
plugin: 'test',
message: 'foo',
@@ -25,13 +25,13 @@ module.exports = {
},
{
code: 'PLUGIN_WARNING',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
plugin: 'test',
hook: 'transform',
message: 'bar',
pos: 22,
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 22
},
diff --git a/test/function/samples/plugins-can-manipulate-options/_config.js b/test/function/samples/plugins-can-manipulate-options/_config.js
index d560b1b29..5ef9d0bef 100644
--- a/test/function/samples/plugins-can-manipulate-options/_config.js
+++ b/test/function/samples/plugins-can-manipulate-options/_config.js
@@ -7,7 +7,7 @@ module.exports = {
plugins: [
{
options(options) {
- options.input = path.resolve(__dirname, 'answer.js');
+ options.input = path.join(__dirname, 'answer.js');
}
}
]
diff --git a/test/function/samples/preserve-entry-signatures-empty-facade/_config.js b/test/function/samples/preserve-entry-signatures-empty-facade/_config.js
index ef790558a..2630a3228 100644
--- a/test/function/samples/preserve-entry-signatures-empty-facade/_config.js
+++ b/test/function/samples/preserve-entry-signatures-empty-facade/_config.js
@@ -8,7 +8,7 @@ module.exports = {
warnings: [
{
code: 'EMPTY_FACADE',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
message: `To preserve the export signature of the entry module "main.js", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`,
url: 'https://rollupjs.org/guide/en/#preserveentrysignatures'
}
diff --git a/test/function/samples/preserve-modules-circular-order/_config.js b/test/function/samples/preserve-modules-circular-order/_config.js
new file mode 100644
index 000000000..7bd9f5d3b
--- /dev/null
+++ b/test/function/samples/preserve-modules-circular-order/_config.js
@@ -0,0 +1,40 @@
+const assert = require('assert');
+const executionOrder = [];
+
+module.exports = {
+ description: 'preserves execution order for circular dependencies when preserving modules',
+ options: {
+ output: { preserveModules: true }
+ },
+ context: {
+ executionOrder
+ },
+ exports() {
+ assert.deepStrictEqual(executionOrder, [
+ 'index',
+ 'tag',
+ 'data',
+ 'main: Tag: Tag data Tag data'
+ ]);
+ },
+ warnings: [
+ {
+ code: 'CIRCULAR_DEPENDENCY',
+ cycle: ['data.js', 'tag.js', 'data.js'],
+ importer: 'data.js',
+ message: 'Circular dependency: data.js -> tag.js -> data.js'
+ },
+ {
+ code: 'CIRCULAR_DEPENDENCY',
+ cycle: ['data.js', 'tag.js', 'index.js', 'data.js'],
+ importer: 'data.js',
+ message: 'Circular dependency: data.js -> tag.js -> index.js -> data.js'
+ },
+ {
+ code: 'CIRCULAR_DEPENDENCY',
+ cycle: ['tag.js', 'index.js', 'tag.js'],
+ importer: 'tag.js',
+ message: 'Circular dependency: tag.js -> index.js -> tag.js'
+ }
+ ]
+};
diff --git a/test/function/samples/preserve-modules-circular-order/data.js b/test/function/samples/preserve-modules-circular-order/data.js
new file mode 100644
index 000000000..9c6b35a2a
--- /dev/null
+++ b/test/function/samples/preserve-modules-circular-order/data.js
@@ -0,0 +1,7 @@
+import { Tag } from './tag.js';
+import './index.js';
+
+executionOrder.push('data');
+
+export const data = () => 'data';
+export const Data = () => `Tag: ${Tag()}`;
diff --git a/test/function/samples/preserve-modules-circular-order/index.js b/test/function/samples/preserve-modules-circular-order/index.js
new file mode 100644
index 000000000..c14367a2b
--- /dev/null
+++ b/test/function/samples/preserve-modules-circular-order/index.js
@@ -0,0 +1,6 @@
+import { Data, data } from './data.js';
+import { Tag } from './tag.js';
+
+executionOrder.push('index');
+
+export { Data, data, Tag };
diff --git a/test/function/samples/preserve-modules-circular-order/main.js b/test/function/samples/preserve-modules-circular-order/main.js
new file mode 100644
index 000000000..3d342b53c
--- /dev/null
+++ b/test/function/samples/preserve-modules-circular-order/main.js
@@ -0,0 +1,5 @@
+import { Data } from './data.js';
+import { Tag } from './tag.js';
+import './index.js';
+
+executionOrder.push(`main: ${Data()} ${Tag()}`);
diff --git a/test/function/samples/preserve-modules-circular-order/tag.js b/test/function/samples/preserve-modules-circular-order/tag.js
new file mode 100644
index 000000000..31a478eed
--- /dev/null
+++ b/test/function/samples/preserve-modules-circular-order/tag.js
@@ -0,0 +1,8 @@
+import * as D from './data.js';
+import './index.js';
+
+executionOrder.push('tag');
+
+export function Tag() {
+ return `Tag ${D.data()}`;
+}
diff --git a/test/function/samples/preserve-modules/mixed-exports/_config.js b/test/function/samples/preserve-modules/mixed-exports/_config.js
index a52cae53f..523d0c0f1 100644
--- a/test/function/samples/preserve-modules/mixed-exports/_config.js
+++ b/test/function/samples/preserve-modules/mixed-exports/_config.js
@@ -9,14 +9,14 @@ module.exports = {
warnings: [
{
code: 'MIXED_EXPORTS',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
message:
'Entry module "main.js" is using named and default exports together. Consumers of your bundle will have to use `chunk["default"]` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning',
url: 'https://rollupjs.org/guide/en/#outputexports'
},
{
code: 'MIXED_EXPORTS',
- id: path.resolve(__dirname, 'lib1.js'),
+ id: path.join(__dirname, 'lib1.js'),
message:
'Entry module "lib1.js" is using named and default exports together. Consumers of your bundle will have to use `chunk["default"]` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning',
url: 'https://rollupjs.org/guide/en/#outputexports'
diff --git a/test/function/samples/reassign-import-fails/_config.js b/test/function/samples/reassign-import-fails/_config.js
index f0d284518..e4aaef4bc 100644
--- a/test/function/samples/reassign-import-fails/_config.js
+++ b/test/function/samples/reassign-import-fails/_config.js
@@ -5,11 +5,11 @@ module.exports = {
error: {
code: 'ILLEGAL_REASSIGNMENT',
message: `Illegal reassignment to import 'x'`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
pos: 113,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'foo.js')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 8,
column: 0
},
diff --git a/test/function/samples/reassign-import-not-at-top-level-fails/_config.js b/test/function/samples/reassign-import-not-at-top-level-fails/_config.js
index 65c3b8a61..43d4f0d4e 100644
--- a/test/function/samples/reassign-import-not-at-top-level-fails/_config.js
+++ b/test/function/samples/reassign-import-not-at-top-level-fails/_config.js
@@ -5,11 +5,11 @@ module.exports = {
error: {
code: 'ILLEGAL_REASSIGNMENT',
message: `Illegal reassignment to import 'x'`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
pos: 95,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'foo.js')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 7,
column: 2
},
diff --git a/test/function/samples/reexport-missing-error/_config.js b/test/function/samples/reexport-missing-error/_config.js
index bf769ecca..510b104ce 100644
--- a/test/function/samples/reexport-missing-error/_config.js
+++ b/test/function/samples/reexport-missing-error/_config.js
@@ -5,11 +5,11 @@ module.exports = {
error: {
code: 'MISSING_EXPORT',
message: `'foo' is not exported by empty.js, imported by main.js`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
pos: 9,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'empty.js')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'empty.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 9
},
diff --git a/test/function/samples/resolve-id-object/_config.js b/test/function/samples/resolve-id-object/_config.js
index 4c3f96751..aace40222 100644
--- a/test/function/samples/resolve-id-object/_config.js
+++ b/test/function/samples/resolve-id-object/_config.js
@@ -5,7 +5,7 @@ module.exports = {
options: {
plugins: {
resolveId(importee) {
- const fooId = path.resolve(__dirname, 'foo.js');
+ const fooId = path.join(__dirname, 'foo.js');
switch (importee) {
case 'internal1':
return { id: fooId };
diff --git a/test/function/samples/resolve-relative-external-id/_config.js b/test/function/samples/resolve-relative-external-id/_config.js
index 36c59cc10..f6a6d4515 100644
--- a/test/function/samples/resolve-relative-external-id/_config.js
+++ b/test/function/samples/resolve-relative-external-id/_config.js
@@ -4,24 +4,21 @@ const path = require('path');
module.exports = {
description: 'resolves relative external ids',
options: {
- external: [
- path.resolve(__dirname, 'external.js'),
- path.resolve(__dirname, 'nested', 'external.js')
- ],
+ external: [path.join(__dirname, 'external.js'), path.join(__dirname, 'nested', 'external.js')],
plugins: {
async buildStart() {
assert.deepStrictEqual(await this.resolve('./external.js'), {
external: true,
- id: path.resolve(__dirname, 'external.js'),
+ id: path.join(__dirname, 'external.js'),
meta: {},
moduleSideEffects: true,
syntheticNamedExports: false
});
assert.deepStrictEqual(
- await this.resolve('./external.js', path.resolve(__dirname, 'nested', 'some-file.js')),
+ await this.resolve('./external.js', path.join(__dirname, 'nested', 'some-file.js')),
{
external: true,
- id: path.resolve(__dirname, 'nested', 'external.js'),
+ id: path.join(__dirname, 'nested', 'external.js'),
meta: {},
moduleSideEffects: true,
syntheticNamedExports: false
diff --git a/test/function/samples/respect-default-export-reexporter-side-effects/_config.js b/test/function/samples/respect-default-export-reexporter-side-effects/_config.js
new file mode 100644
index 000000000..7ddf180ef
--- /dev/null
+++ b/test/function/samples/respect-default-export-reexporter-side-effects/_config.js
@@ -0,0 +1,8 @@
+module.exports = {
+ description: 'respect side-effects in reexporting modules even if moduleSideEffects are off',
+ options: {
+ treeshake: {
+ moduleSideEffects: false
+ }
+ }
+};
diff --git a/test/function/samples/respect-default-export-reexporter-side-effects/foo.js b/test/function/samples/respect-default-export-reexporter-side-effects/foo.js
new file mode 100644
index 000000000..71658c134
--- /dev/null
+++ b/test/function/samples/respect-default-export-reexporter-side-effects/foo.js
@@ -0,0 +1 @@
+export const foo = {};
diff --git a/test/function/samples/respect-default-export-reexporter-side-effects/main.js b/test/function/samples/respect-default-export-reexporter-side-effects/main.js
new file mode 100644
index 000000000..3f56b41fc
--- /dev/null
+++ b/test/function/samples/respect-default-export-reexporter-side-effects/main.js
@@ -0,0 +1,8 @@
+import { foo } from './reexporter-chain-1.js';
+
+assert.deepStrictEqual(foo, {
+ chain2: 'modified',
+ chain3: 'modified',
+ chain4: 'modified',
+ chain5: 'modified'
+});
diff --git a/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-1.js b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-1.js
new file mode 100644
index 000000000..e5a9c4edc
--- /dev/null
+++ b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-1.js
@@ -0,0 +1,3 @@
+import { foo } from './reexporter-chain-2.js';
+foo.chain1 = 'should not be modified';
+export { foo } from './reexporter-chain-2.js';
diff --git a/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-2.js b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-2.js
new file mode 100644
index 000000000..7fa384307
--- /dev/null
+++ b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-2.js
@@ -0,0 +1,3 @@
+import { foo } from './reexporter-chain-3.js';
+foo.chain2 = 'modified';
+export { foo };
diff --git a/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-3.js b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-3.js
new file mode 100644
index 000000000..6d78f2b1a
--- /dev/null
+++ b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-3.js
@@ -0,0 +1,3 @@
+import foo from './reexporter-chain-4.js';
+foo.chain3 = 'modified';
+export { foo };
diff --git a/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-4.js b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-4.js
new file mode 100644
index 000000000..c58b6c17d
--- /dev/null
+++ b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-4.js
@@ -0,0 +1,3 @@
+import foo from './reexporter-chain-5.js';
+foo.chain4 = 'modified';
+export default foo;
diff --git a/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-5.js b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-5.js
new file mode 100644
index 000000000..52b9af5d6
--- /dev/null
+++ b/test/function/samples/respect-default-export-reexporter-side-effects/reexporter-chain-5.js
@@ -0,0 +1,3 @@
+import { foo } from './foo.js';
+foo.chain5 = 'modified';
+export default foo;
diff --git a/test/function/samples/respect-reexporter-side-effects/_config.js b/test/function/samples/respect-reexporter-side-effects/_config.js
new file mode 100644
index 000000000..7ddf180ef
--- /dev/null
+++ b/test/function/samples/respect-reexporter-side-effects/_config.js
@@ -0,0 +1,8 @@
+module.exports = {
+ description: 'respect side-effects in reexporting modules even if moduleSideEffects are off',
+ options: {
+ treeshake: {
+ moduleSideEffects: false
+ }
+ }
+};
diff --git a/test/function/samples/respect-reexporter-side-effects/foo.js b/test/function/samples/respect-reexporter-side-effects/foo.js
new file mode 100644
index 000000000..71658c134
--- /dev/null
+++ b/test/function/samples/respect-reexporter-side-effects/foo.js
@@ -0,0 +1 @@
+export const foo = {};
diff --git a/test/function/samples/respect-reexporter-side-effects/main.js b/test/function/samples/respect-reexporter-side-effects/main.js
new file mode 100644
index 000000000..e3d6c0a28
--- /dev/null
+++ b/test/function/samples/respect-reexporter-side-effects/main.js
@@ -0,0 +1,8 @@
+import { foo as fooIndirect } from './reexporter-indirect.js';
+import { foo as fooDirect } from './reexporter-direct';
+import { foo as fooChained } from './reexporter-chain-1';
+import { foo as fooIndirectIgnored } from './reexporter-indirect-ignored';
+
+assert.deepStrictEqual(fooIndirect, { indirect: 'modified', chain2: 'modified', chain3: 'modified' });
+assert.deepStrictEqual(fooDirect, { indirect: 'modified', chain2: 'modified', chain3: 'modified' });
+assert.deepStrictEqual(fooChained, { indirect: 'modified', chain2: 'modified', chain3: 'modified' });
diff --git a/test/function/samples/respect-reexporter-side-effects/reexporter-chain-1.js b/test/function/samples/respect-reexporter-side-effects/reexporter-chain-1.js
new file mode 100644
index 000000000..e5a9c4edc
--- /dev/null
+++ b/test/function/samples/respect-reexporter-side-effects/reexporter-chain-1.js
@@ -0,0 +1,3 @@
+import { foo } from './reexporter-chain-2.js';
+foo.chain1 = 'should not be modified';
+export { foo } from './reexporter-chain-2.js';
diff --git a/test/function/samples/respect-reexporter-side-effects/reexporter-chain-2.js b/test/function/samples/respect-reexporter-side-effects/reexporter-chain-2.js
new file mode 100644
index 000000000..7fa384307
--- /dev/null
+++ b/test/function/samples/respect-reexporter-side-effects/reexporter-chain-2.js
@@ -0,0 +1,3 @@
+import { foo } from './reexporter-chain-3.js';
+foo.chain2 = 'modified';
+export { foo };
diff --git a/test/function/samples/respect-reexporter-side-effects/reexporter-chain-3.js b/test/function/samples/respect-reexporter-side-effects/reexporter-chain-3.js
new file mode 100644
index 000000000..7b4e05173
--- /dev/null
+++ b/test/function/samples/respect-reexporter-side-effects/reexporter-chain-3.js
@@ -0,0 +1,3 @@
+import { foo } from './foo.js';
+foo.chain3 = 'modified';
+export { foo };
diff --git a/test/function/samples/respect-reexporter-side-effects/reexporter-direct.js b/test/function/samples/respect-reexporter-side-effects/reexporter-direct.js
new file mode 100644
index 000000000..bb53dd52c
--- /dev/null
+++ b/test/function/samples/respect-reexporter-side-effects/reexporter-direct.js
@@ -0,0 +1,3 @@
+import { foo } from './foo.js';
+foo.direct = 'should not be modified';
+export { foo } from './foo.js';
diff --git a/test/function/samples/respect-reexporter-side-effects/reexporter-indirect-ignored.js b/test/function/samples/respect-reexporter-side-effects/reexporter-indirect-ignored.js
new file mode 100644
index 000000000..660ae4a4e
--- /dev/null
+++ b/test/function/samples/respect-reexporter-side-effects/reexporter-indirect-ignored.js
@@ -0,0 +1,3 @@
+import { foo } from './foo.js';
+foo.indirectIgnored = 'should not be modified';
+export { foo };
diff --git a/test/function/samples/respect-reexporter-side-effects/reexporter-indirect.js b/test/function/samples/respect-reexporter-side-effects/reexporter-indirect.js
new file mode 100644
index 000000000..a6aeeb663
--- /dev/null
+++ b/test/function/samples/respect-reexporter-side-effects/reexporter-indirect.js
@@ -0,0 +1,3 @@
+import { foo } from './foo.js';
+foo.indirect = 'modified';
+export { foo };
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/_config.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/_config.js
new file mode 100644
index 000000000..0afd5749b
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/_config.js
@@ -0,0 +1,15 @@
+module.exports = {
+ description: 'respect side-effects in reexporting modules even if moduleSideEffects are off',
+ options: {
+ treeshake: {
+ moduleSideEffects: false
+ },
+ plugins: [
+ {
+ transform() {
+ return { syntheticNamedExports: '__synthetic' };
+ }
+ }
+ ]
+ }
+};
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/baz.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/baz.js
new file mode 100644
index 000000000..c83804463
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/baz.js
@@ -0,0 +1 @@
+export const baz = { bar: { foo: {} } };
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/main.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/main.js
new file mode 100644
index 000000000..3c022c4da
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/main.js
@@ -0,0 +1,12 @@
+import { foo } from './reexporter-chain-1.js';
+
+assert.deepStrictEqual(foo, {
+ chain2: 'modified',
+ chain3: 'modified',
+ chain4: 'modified',
+ chain5: 'modified',
+ chain7: 'modified',
+ chain8: 'modified',
+ chain10: 'modified',
+ chain11: 'modified',
+});
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-1.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-1.js
new file mode 100644
index 000000000..e5a9c4edc
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-1.js
@@ -0,0 +1,3 @@
+import { foo } from './reexporter-chain-2.js';
+foo.chain1 = 'should not be modified';
+export { foo } from './reexporter-chain-2.js';
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-10.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-10.js
new file mode 100644
index 000000000..0f703dd94
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-10.js
@@ -0,0 +1,3 @@
+import baz from './reexporter-chain-11.js';
+baz.bar.foo.chain10 = 'modified';
+export { baz };
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-11.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-11.js
new file mode 100644
index 000000000..a028f060a
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-11.js
@@ -0,0 +1,3 @@
+import { baz } from './baz.js';
+baz.bar.foo.chain11 = 'modified';
+export default baz;
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-2.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-2.js
new file mode 100644
index 000000000..b4355928a
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-2.js
@@ -0,0 +1,3 @@
+import foo from './reexporter-chain-3.js';
+foo.chain2 = 'modified';
+export { foo };
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-3.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-3.js
new file mode 100644
index 000000000..2c60e035f
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-3.js
@@ -0,0 +1,3 @@
+import { foo } from './reexporter-chain-4.js';
+foo.chain3 = 'modified';
+export default foo;
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-4.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-4.js
new file mode 100644
index 000000000..68b309659
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-4.js
@@ -0,0 +1,3 @@
+import bar from './reexporter-chain-5.js';
+bar.foo.chain4 = 'modified';
+export { bar as __synthetic };
\ No newline at end of file
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-5.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-5.js
new file mode 100644
index 000000000..fe9443c23
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-5.js
@@ -0,0 +1,3 @@
+import { bar } from './reexporter-chain-6.js';
+bar.foo.chain5 = 'modified';
+export default bar;
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-6.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-6.js
new file mode 100644
index 000000000..eab68fb11
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-6.js
@@ -0,0 +1,3 @@
+import { bar } from './reexporter-chain-7.js';
+bar.foo.chain6 = 'should not be modified';
+export { bar } from './reexporter-chain-7.js';
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-7.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-7.js
new file mode 100644
index 000000000..8d5432ba4
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-7.js
@@ -0,0 +1,3 @@
+import { bar } from './reexporter-chain-8.js';
+bar.foo.chain7 = 'modified';
+export { bar };
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-8.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-8.js
new file mode 100644
index 000000000..78e57f231
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-8.js
@@ -0,0 +1,3 @@
+import { baz } from './reexporter-chain-9.js';
+baz.bar.foo.chain8 = 'modified';
+export { baz as __synthetic };
diff --git a/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-9.js b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-9.js
new file mode 100644
index 000000000..806acfc88
--- /dev/null
+++ b/test/function/samples/respect-synthetic-export-reexporter-side-effects/reexporter-chain-9.js
@@ -0,0 +1,3 @@
+import { baz } from './reexporter-chain-10.js';
+baz.bar.foo.chain9 = 'should not be modified';
+export { baz } from './reexporter-chain-10.js';
\ No newline at end of file
diff --git a/test/function/samples/synthetic-named-exports/circular-synthetic-exports/_config.js b/test/function/samples/synthetic-named-exports/circular-synthetic-exports/_config.js
new file mode 100644
index 000000000..8fe3e8a1b
--- /dev/null
+++ b/test/function/samples/synthetic-named-exports/circular-synthetic-exports/_config.js
@@ -0,0 +1,20 @@
+const path = require('path');
+
+module.exports = {
+ description: 'handles circular synthetic exports',
+ options: {
+ plugins: [
+ {
+ name: 'test',
+ transform() {
+ return { syntheticNamedExports: '__synthetic' };
+ }
+ }
+ ]
+ },
+ generateError: {
+ code: 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT',
+ id: path.join(__dirname, 'main.js'),
+ message: `Module "main.js" that is marked with 'syntheticNamedExports: "__synthetic"' needs an export named "__synthetic" that does not reexport an unresolved named export of the same module.`
+ }
+};
diff --git a/test/function/samples/synthetic-named-exports/circular-synthetic-exports/dep.js b/test/function/samples/synthetic-named-exports/circular-synthetic-exports/dep.js
new file mode 100644
index 000000000..44d715427
--- /dev/null
+++ b/test/function/samples/synthetic-named-exports/circular-synthetic-exports/dep.js
@@ -0,0 +1,2 @@
+import { foo } from './main.js';
+export default foo;
diff --git a/test/function/samples/synthetic-named-exports/circular-synthetic-exports/main.js b/test/function/samples/synthetic-named-exports/circular-synthetic-exports/main.js
new file mode 100644
index 000000000..1107c173c
--- /dev/null
+++ b/test/function/samples/synthetic-named-exports/circular-synthetic-exports/main.js
@@ -0,0 +1 @@
+export { default as __synthetic } from './dep.js';
diff --git a/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/_config.js b/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/_config.js
index 126fd55b3..0a89c1f78 100644
--- a/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/_config.js
+++ b/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/_config.js
@@ -5,21 +5,16 @@ module.exports = {
options: {
plugins: [
{
- resolveId(id) {
- if (id === './dep.js') {
- return {
- id,
- syntheticNamedExports: true
- };
- }
+ transform() {
+ return { syntheticNamedExports: true };
}
}
]
},
error: {
code: 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT',
- id: './dep.js',
- message: `Module "./dep.js" that is marked with 'syntheticNamedExports: true' needs a default export.`,
- watchFiles: [path.resolve(__dirname, 'main.js'), './dep.js']
+ id: path.join(__dirname, 'dep.js'),
+ message: `Module "dep.js" that is marked with 'syntheticNamedExports: true' needs a default export that does not reexport an unresolved named export of the same module.`,
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'dep.js')]
}
};
diff --git a/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-export/_config.js b/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-export/_config.js
index 69db64182..a11192c46 100644
--- a/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-export/_config.js
+++ b/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-export/_config.js
@@ -17,8 +17,7 @@ module.exports = {
error: {
code: 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT',
id: DEP_ID,
- message:
- 'Module "dep.js" that is marked with \'syntheticNamedExports: "__synthetic"\' needs an export named "__synthetic".',
+ message: `Module "dep.js" that is marked with 'syntheticNamedExports: "__synthetic"' needs an export named "__synthetic" that does not reexport an unresolved named export of the same module.`,
watchFiles: [path.join(__dirname, 'main.js'), DEP_ID]
}
};
diff --git a/test/function/samples/throws-not-found-module/_config.js b/test/function/samples/throws-not-found-module/_config.js
index 0d0a99d4b..5df6a0b9f 100644
--- a/test/function/samples/throws-not-found-module/_config.js
+++ b/test/function/samples/throws-not-found-module/_config.js
@@ -5,6 +5,6 @@ module.exports = {
error: {
code: 'UNRESOLVED_IMPORT',
message: `Could not resolve './mod' from main.js`,
- watchFiles: [path.resolve(__dirname, 'main.js')]
+ watchFiles: [path.join(__dirname, 'main.js')]
}
};
diff --git a/test/function/samples/update-expression-of-import-fails/_config.js b/test/function/samples/update-expression-of-import-fails/_config.js
index 4911b8316..f3596401b 100644
--- a/test/function/samples/update-expression-of-import-fails/_config.js
+++ b/test/function/samples/update-expression-of-import-fails/_config.js
@@ -5,11 +5,11 @@ module.exports = {
error: {
code: 'ILLEGAL_REASSIGNMENT',
message: `Illegal reassignment to import 'a'`,
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
pos: 28,
- watchFiles: [path.resolve(__dirname, 'main.js'), path.resolve(__dirname, 'foo.js')],
+ watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')],
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 3,
column: 0
},
diff --git a/test/function/samples/warn-on-auto-named-default-exports/_config.js b/test/function/samples/warn-on-auto-named-default-exports/_config.js
index b1dce8db1..a35384c07 100644
--- a/test/function/samples/warn-on-auto-named-default-exports/_config.js
+++ b/test/function/samples/warn-on-auto-named-default-exports/_config.js
@@ -5,7 +5,7 @@ module.exports = {
warnings: [
{
code: 'MIXED_EXPORTS',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
message:
'Entry module "main.js" is using named and default exports together. Consumers of your bundle will have to use `chunk["default"]` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning',
url: 'https://rollupjs.org/guide/en/#outputexports'
diff --git a/test/function/samples/warn-on-eval/_config.js b/test/function/samples/warn-on-eval/_config.js
index 144331439..ee1b2f5b8 100644
--- a/test/function/samples/warn-on-eval/_config.js
+++ b/test/function/samples/warn-on-eval/_config.js
@@ -5,7 +5,7 @@ module.exports = {
warnings: [
{
code: 'EVAL',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,
pos: 13,
loc: {
diff --git a/test/function/samples/warn-on-namespace-conflict/_config.js b/test/function/samples/warn-on-namespace-conflict/_config.js
index 21767e433..78cd978cd 100644
--- a/test/function/samples/warn-on-namespace-conflict/_config.js
+++ b/test/function/samples/warn-on-namespace-conflict/_config.js
@@ -6,8 +6,8 @@ module.exports = {
{
code: 'NAMESPACE_CONFLICT',
name: 'foo',
- reexporter: path.resolve(__dirname, 'main.js'),
- sources: [path.resolve(__dirname, 'foo.js'), path.resolve(__dirname, 'deep.js')],
+ reexporter: path.join(__dirname, 'main.js'),
+ sources: [path.join(__dirname, 'foo.js'), path.join(__dirname, 'deep.js')],
message: `Conflicting namespaces: main.js re-exports 'foo' from both foo.js and deep.js (will be ignored)`
}
]
diff --git a/test/function/samples/warn-on-top-level-this/_config.js b/test/function/samples/warn-on-top-level-this/_config.js
index 449b6f304..2548e7e82 100644
--- a/test/function/samples/warn-on-top-level-this/_config.js
+++ b/test/function/samples/warn-on-top-level-this/_config.js
@@ -6,11 +6,11 @@ module.exports = {
warnings: [
{
code: 'THIS_IS_UNDEFINED',
- id: path.resolve(__dirname, 'main.js'),
+ id: path.join(__dirname, 'main.js'),
message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,
pos: 81,
loc: {
- file: require('path').resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 3,
column: 0
},
diff --git a/test/function/samples/warn-on-unused-missing-imports/_config.js b/test/function/samples/warn-on-unused-missing-imports/_config.js
index 278b1159e..1869ed89c 100644
--- a/test/function/samples/warn-on-unused-missing-imports/_config.js
+++ b/test/function/samples/warn-on-unused-missing-imports/_config.js
@@ -5,13 +5,13 @@ module.exports = {
warnings: [
{
code: 'NON_EXISTENT_EXPORT',
- id: path.resolve(__dirname, 'main.js'),
- source: path.resolve(__dirname, 'foo.js'),
+ id: path.join(__dirname, 'main.js'),
+ source: path.join(__dirname, 'foo.js'),
name: 'b',
message: `Non-existent export 'b' is imported from foo.js`,
pos: 12,
loc: {
- file: path.resolve(__dirname, 'main.js'),
+ file: path.join(__dirname, 'main.js'),
line: 1,
column: 12
},
diff --git a/tsconfig.json b/tsconfig.json
index b12461482..aad06724f 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -2,6 +2,7 @@
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"diagnostics": true,
+ "isolatedModules": true,
"module": "commonjs",
"noEmitOnError": true,
"noUnusedLocals": true,
diff --git a/typings/declarations.d.ts b/typings/declarations.d.ts
index 441102c38..22a2d3138 100644
--- a/typings/declarations.d.ts
+++ b/typings/declarations.d.ts
@@ -26,11 +26,6 @@ declare module 'acorn-export-ns-from' {
export default plugin;
}
-declare module 'acorn-numeric-separator' {
- const plugin: (BaseParser: typeof acorn.Parser) => typeof acorn.Parser;
- export default plugin;
-}
-
declare module 'fsevents' {
export default {};
}