prepack icon indicating copy to clipboard operation
prepack copied to clipboard

Symbol properties not supported in loops

Open sebmarkbage opened this issue 6 years ago • 0 comments

  let a = global.__abstract ? __makeSimple(__abstract("array", "[1, 2, 3]")) : [1, 2, 3];
  let i = 0;

  var o = {x:0};
  do {
    i++;
    o[Symbol.iterator] = i;
  } while (i < a.length);

  result = o;

I think the abstract interpretation doesn't support Symbols but more importantly all the places where we loop over properties in the serializer also excludes the special cases around widened values. https://github.com/facebook/prepack/blob/21fcfb2a0996abd2b90b61fb3ebd80bd3c9b8928/src/serializer/ResidualHeapSerializer.js#L250

sebmarkbage avatar Mar 12 '18 01:03 sebmarkbage