Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Generated function argument names conflict with inlined JS #452

Open
@bbugh

Description

The generated function arguments m, n, o can conflict with the actual JS values (particularly n which is not uncommon as a variable name), causing weird errors.

Given a module:

module Example {
 fun show(something : a, list: b, value: c) {
 `
 (() => {
 for (let n = 0; n < #{list}.length; n++) {
 console.log(#{list}[n])
 }
 })()
 `
 }
}

This generates:

const AH = new(class extends _M {
 b(n, m, o) {
 return ((() => {
 for (let n = 0; n < m.length; n++) {
 console.log(m[n])
 }
 })());
 }
});

The n defined in the JavaScript code is shadowing the n defined as the minified argument name.

It seems like these generated arguments should be ones that cannot conflict, perhaps with an index/uuid like n9208, or __0__, __1__, etc..

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /