Skip to content

Scope is incorrectly determined when using function expressions. #8874

Description

@mmeij

Bug report

What is the current behavior?
The imported function someFunction in index.js is incorrectly called from within the inline function expression someFunction in index.js instead of calling itself recursively.

If the current behavior is a bug, please provide the steps to reproduce.
Gist:
https://gist.github.com/MathijsMeijer/660d19a5eaccb819a5c3ccb12b2e9323

Structure:
wp.js
src/index.js
src/someFunction.js

Run npm i webpack and node wp.js.

What is the expected behavior?
The inline function expression someFunction in index.js should call itself recursively. The imported function someFunction should not be called.

Other relevant information:
webpack version: 4.29.6 / 5.0.0-alpha.11
Node.js version: 10.15.0
Operating System: MacOS 10.14.3
Additional tools: n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions