mirror of https://github.com/webpack/webpack.git
refactor: logic
This commit is contained in:
parent
c647cf193c
commit
2dbf651409
|
@ -174,7 +174,7 @@ class MakeDeferredNamespaceObjectRuntimeModule extends HelperRuntimeModule {
|
||||||
])},`,
|
])},`,
|
||||||
`ownKeys: ${runtimeTemplate.basicFunction("", [
|
`ownKeys: ${runtimeTemplate.basicFunction("", [
|
||||||
init,
|
init,
|
||||||
`var keys = Reflect.ownKeys(ns).filter(${runtimeTemplate.expressionFunction('x !== "then" && x !== Symbol.toStringTag', "x")}).concat([Symbol.toStringTag]);`,
|
`var keys = Object.getOwnPropertyNames(ns).concat(Object.getOwnPropertySymbols(ns)).filter(${runtimeTemplate.expressionFunction('x !== "then" && x !== Symbol.toStringTag', "x")}).concat([Symbol.toStringTag]);`,
|
||||||
"return keys;"
|
"return keys;"
|
||||||
])},`,
|
])},`,
|
||||||
`getOwnPropertyDescriptor: ${runtimeTemplate.basicFunction("_, name", [
|
`getOwnPropertyDescriptor: ${runtimeTemplate.basicFunction("_, name", [
|
||||||
|
@ -186,7 +186,7 @@ class MakeDeferredNamespaceObjectRuntimeModule extends HelperRuntimeModule {
|
||||||
]),
|
]),
|
||||||
"}",
|
"}",
|
||||||
init,
|
init,
|
||||||
"var desc = Reflect.getOwnPropertyDescriptor(ns, name);",
|
"var desc = Object.getOwnPropertyDescriptor(ns, name);",
|
||||||
'if (mode == 2 && name == "default" && !desc) {',
|
'if (mode == 2 && name == "default" && !desc) {',
|
||||||
Template.indent("desc = { value: ns, configurable: true };"),
|
Template.indent("desc = { value: ns, configurable: true };"),
|
||||||
"}",
|
"}",
|
||||||
|
|
Loading…
Reference in New Issue