Skip to content

for-of transform produces wrong output when there is no space after opening bracket

Reproducible on Buble 0.6.6:

{
  "code": "for ( var i = 0, list = this.keys; i < list.length; i += 1 ) { var key = list[i];\n\n\tconsole.log(key); }",
  "map": {
    "version": 3,
    "file": null,
    "sources": [ null ],
    "sourcesContent": [
      "for ( const key of this.keys ) { console.log(key); }"
    ],
    "names": [ "const" ]
  }
}
{
  "code": "for) {  ( var i = 0, list = this.keys; i < list.length; i += 1var key = list[i];\n\n\tconsole.log(key); }",
  "map": {
    "version": 3,
    "file": null,
    "sources": [ null ],
    "sourcesContent": [
      "for (const key of this.keys) { console.log(key); }"
    ],
    "names": [ "const" ]
  }
}