Skip to content

Breaks recursive IIFE code #27

@forivall

Description

@forivall

(contrived example, based on code i was unminifying)

function e(t) {
  function n() {}
  var e = 'foo';
  var c = [1, 2, 3];
  (function t(e, a, n) {
    console.log(e);
    (n < a.length) && t(e, a, n + 1)
  })(n, c);
}

on "safe" safety level, this is unminified to

function e(t) {
  function n() {}
  var e = 'foo';
  var c = [1, 2, 3];
  (function t() {
    var e = n;
    var a = c;
    var n;
    console.log(e);
    if (n < a.length) {
      t(e, a, n + 1);
    }
  })();
}

in which the n is now shadowed and is not available in the iife, and the recursion is broken

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    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