Function name shortened, but not function call

Open
#25 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Start with the JavaScript example in the issue and reproduce it through tinyify, comparing the output with browserify. Trace the name-shortening path and verify that the shortened function name and its call are changed consistently; done means the example no longer raises "this.foo is not a function".

Written by the indexing model from the issue text.

Description

bug

There seems to be a problem with shortening names in some cases. Below is an example.

{
    addOnclick: function(){
        element.onclick = ()=>{this.foo("some string")};
    },

    foo: function(str){
        //do things
    }
}

I get: "this.foo is not a function"
What it looks like is happening is that it is changing the name of the function, but it is not changing the call to that function. It seems to do this everywhere that I have this format as far as I can tell. It works with browserify of course, but it breaks with tinyify.

Dominant language
JavaScript
Stars
405
Forks
14
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from browserify/tinyify

All issues in browserify/tinyify

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.