#1330·prepack

Evaluating and serializing arrays with abstract elements/properties

Author: trueadmCreated Jan 17, 2018Updated Nov 1, 2018
Labelsabstractreact compiler

This is a follow-up from some of the internal discussion we've had regarding the handling of abstract loops within Prepack.

Given the example:

javascript
(function () {
  var array = __abstract("array", "array");
  
  var result = [];
  
  for (var i = 0; i < array.length; i++) {
    result.push(array[i]);
  }
  
  window.result = result;
})();

I'm not entirely sure how this should be dealt with, but maybe it's something that @sebmarkbage, @NTillmann and @hermanventer have thought about.

I'd expect that the evaluated value of result in this case would be that of an abstract value with a kind set to forLoop, maybe with a loop args for the starting index value, incrementer value, end index value and the body of the loop?