t in the constructor parameter is the same name as the class name. this._notifyMethodis getting assigned to the class. One would suspect that the variable name should shadow the class ref name but that's not the case.
There's no problem if tested with Mocha standalone in the Node.js environment.
The failure is for end-to-end testing using nightwatch when browsers are involved. I have all nightwatch tests pass with the non-minifed version, but they fail with the minified version for all (safari, chrome, firefox).
Upon closer inspection, I found that one of the constructor parameters was using the same name as the class name, and hence, during assignment, the property got assigned to the class type.
I was passing a function reference and when I attempted to call, the error is thrown: "TypeError: Cannot call a class as a function."
Manual Fix: renamed constructor parameter to t1 to differentiate.
Rollup Plugin Name: @rollup/plugin-terser,
Rollup Plugin Version: 0.4.4
Rollup Version: 4.6.1
Operating System (or Browser): macos
Node Version:
Link to reproduction (⚠️ read below):
Expected Behavior
Class names should differ from parameter names
Actual Behavior
Class names and variable names share the same character set.
Additional Information
the error will occur as soon as instantiate the class object. new Foo
Problem:
t
in the constructor parameter is the same name as theclass
name.this._notifyMethod
is getting assigned to theclass
. One would suspect that the variable name should shadow the class ref name but that's not the case.There's no problem if tested with Mocha standalone in the Node.js environment.
The failure is for end-to-end testing using nightwatch when browsers are involved. I have all nightwatch tests pass with the non-minifed version, but they fail with the minified version for all (safari, chrome, firefox).
Upon closer inspection, I found that one of the constructor parameters was using the same name as the class name, and hence, during assignment, the property got assigned to the class type.
I was passing a function reference and when I attempted to call, the error is thrown:
"TypeError: Cannot call a class as a function."
Manual Fix: renamed constructor parameter to t1 to differentiate.![Screen Shot 2023-12-06 at 8 12 52 PM](https://github.com/rollup/plugins/assets/703661/81c30f82-b39e-4bda-9f68-5252017f7955)
Expected Behavior
Class names should differ from parameter names
Actual Behavior
Class names and variable names share the same character set.
Additional Information
the error will occur as soon as instantiate the class object.
new Foo