mirror of https://github.com/webpack/webpack.git
parent
84720287e1
commit
ae15a701a4
|
@ -158,6 +158,8 @@ class ImportMetaPlugin {
|
|||
const expr = /** @type {MemberExpression} */ (expression);
|
||||
if (
|
||||
expr.object.type === "MetaProperty" &&
|
||||
expr.object.meta.name === "import" &&
|
||||
expr.object.property.name === "meta" &&
|
||||
expr.property.type ===
|
||||
(expr.computed ? "Literal" : "Identifier")
|
||||
) {
|
||||
|
|
|
@ -51,6 +51,7 @@ class URLPlugin {
|
|||
if (
|
||||
chain.members.length !== 1 ||
|
||||
chain.object.type !== "MetaProperty" ||
|
||||
chain.object.meta.name !== "import" ||
|
||||
chain.object.property.name !== "meta" ||
|
||||
chain.members[0] !== "url"
|
||||
)
|
||||
|
|
|
@ -802,7 +802,7 @@ class JavascriptParser extends Parser {
|
|||
case "MetaProperty": {
|
||||
const res = this.callHooksForName(
|
||||
this.hooks.evaluateTypeof,
|
||||
"import.meta",
|
||||
getRootName(expr.argument),
|
||||
expr
|
||||
);
|
||||
if (res !== undefined) return res;
|
||||
|
|
|
@ -5,7 +5,20 @@ class A {
|
|||
} else {
|
||||
this.val = 1;
|
||||
}
|
||||
if (typeof new.target !== "function") {
|
||||
this.val = 0;
|
||||
}
|
||||
if (typeof new.target.value !== "function") {
|
||||
this.val = 0;
|
||||
}
|
||||
if (typeof new.target.unknown !== "undefined") {
|
||||
this.val = 0;
|
||||
}
|
||||
if (!new.target.value) {
|
||||
this.val = 0;
|
||||
}
|
||||
}
|
||||
static value() {}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
|
Loading…
Reference in New Issue