Skip to content

purs bundle eliminates functions called locally #4181

Description

@jamesdbrock

Description

PR #4044 seems to have introduced a regression in the bundler.

As @ozkutuk reported in purescript-contrib/purescript-arraybuffer#34 , in version 0.14.4 purs bundle started eliminating functions from a .js file which are called locally in the .js file at “load time.” (What do we call that time at which the .js file is evaluated? Is it “load time”? I don't know).

Expected behavior

This commit on my fork of purescript introduces a test which I believe should pass if the bundler is working properly.

jamesdbrock@52dd3a5

Instead the test fails with purescript> ReferenceError: localFunction is not defined.

To Reproduce

git clone https://github.com/jamesdbrock/purescript.git
cd purescript
git checkout bundle-function
stack test --test-arguments="--match FunctionDeclaration.purs"

PureScript version

0.14.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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