jscert / jsexplain

Apache License 2.0
26 stars 4 forks source link

Tuple Binders are Broken #16

Closed IgnoredAmbience closed 6 years ago

IgnoredAmbience commented 6 years ago

On es2016-proxies-scope, in testcase generator/tests/lettuple.ml:

let test4 _ =
  let (w,x,y,z) = (1,2,3,4)
  in (w,x,y,z)

This generates this JS:

var test4 = function (_pat_any_7) {
  var _tuple_arg_8 = [1, 2, 3, 4];
  var w = _tuple_arg_8[3];var x = _tuple_arg_8[2];var y = _tuple_arg_8[1];
    var z = _tuple_arg_8[0];
  return ([w, x, y, z]);
};

The binder indexes are reversed.

IgnoredAmbience commented 6 years ago

This issue also impacts testp1 of testctx.ml.

IgnoredAmbience commented 6 years ago

This issue also impacts shadower of shadow.ml. Meaning that test failure isn't a scope issue! :tada:

Fixing this bug is a step to confirming whether #15 can be closed.