12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- "use strict";
- const WebpackError = require("./WebpackError");
- const makeSerializable = require("./util/makeSerializable");
- class EnvironmentNotSupportAsyncWarning extends WebpackError {
-
- constructor(module, feature) {
- const message = `The generated code contains 'async/await' because this module is using "${feature}".
- However, your target environment does not appear to support 'async/await'.
- As a result, the code may not run as expected or may cause runtime errors.`;
- super(message);
- this.name = "EnvironmentNotSupportAsyncWarning";
- this.module = module;
- }
-
- static check(module, runtimeTemplate, feature) {
- if (!runtimeTemplate.supportsAsyncFunction()) {
- module.addWarning(new EnvironmentNotSupportAsyncWarning(module, feature));
- }
- }
- }
- makeSerializable(
- EnvironmentNotSupportAsyncWarning,
- "webpack/lib/EnvironmentNotSupportAsyncWarning"
- );
- module.exports = EnvironmentNotSupportAsyncWarning;
|