facebookarchive/prepack

Prepack emits yield outside of generator function

Open

#2294 aperta il 18 lug 2018

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (520 fork)batch import
bughelp wantedlevel 2 (easy)

Metriche repository

Star
 (14.268 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Input

"use strict";

var object = {
  *["a"]() {
    yield 1;
    yield 2;
  },
};

var x = Object.keys(object);

Output

"use strict";

var x, object;
(function () {
  var _$0 = this;

  var _3 = function () {
    yield 1; // <---------------------------------- Yield outside of generator!
    yield 2;
  };

  _$0.object = {
    a: _3
  };
  _$0.x = ["a"];
}).call(this);

Guida contributor