facebookarchive/prepack

Unhelpful fatal error with loop in pure mode

Open

#2.396 aberto em 7 de ago. de 2018

Ver no GitHub
 (11 comments) (0 reactions) (0 assignees)JavaScript (520 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (14.268 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Prepacking this...

(function () {
    function f(a) {
        while (a > 10) {
            a--;
        }
    }
    __optimize(f);
    global.f = f;
})();

produces the following. The output looks correct, but what's that FatalError about with no message???

In input file /tmp/test.js(3:20) FatalError PP0001:  (https://github.com/facebook/prepack/wiki/PP0001)
    at f (/tmp/test.js:3:20)
Prepack failed, reporting 1 fatal error.
(function () {
  var _$2 = this;

  var _1 = function (a) {
    var __leaked_0;

    var _4 = function () {
      for (; __leaked_0 > 10;) {
        __leaked_0--;
      }
    };

    __leaked_0 = a;

    var _$1 = _4();

    return void 0;
  };

  _$2.f = _1;
}).call(this);

Guia do colaborador