8000 Default arguments transform is not equivalent · Issue #125 · lebab/lebab · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Default arguments transform is not equivalent #125
Closed
@osuushi

Description

@osuushi

Example:

function example (x) {
  x = x || 1;
  return x;
}

example(0); // --> 1

But the transformed version:

function example(x=1) {
  return x;
}

example(0); // --> 0

This same issue also applies to the transform for a = a ? a : 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0