Prepack: Support for promises

Created on 2 Jan 2018  路  2Comments  路  Source: facebook/prepack

Feel free to rename this issue if it's something more specific. This started in this comment: https://github.com/facebook/prepack/issues/1285#issuecomment-354828615 and I've found a reduced test case which I'm filing here.

According to Sebastian's comment in that issue, evaluating promises should work, but I can't get even a basic program working. The simplest program throws the error described in the other issue, "all native function values should be intrinsics". Here's the program:

https://prepack.io/repl.html#GYVwdgxgLglg9mABAdwIYygCjASkQbwChFEAnAUyhFKTHOUQAVS4BbGAZ3Mwo7gBsAbuUQBeAHyIuUACoxW5OCCy8BwgDSJcOANyEAvoUJoMmAIwAGKzgB0UABbkwmCAj79yN-nADmmAOT2MP44OEA

bug help wanted serializer level 3 (medium)

Most helpful comment

Nice, thanks. I'd like to start contributing and that seems easy enough. Hopefully I'll find time soon (if someone else want to work on it please do).

All 2 comments

Indeed, Promises are not yet fully supported. There are certainly things missing in the serializer, but possibly more...

Here are some obvious things that need to be done:

  1. Search for "TODO #26" in the code. Cases for "Promise" need to be added.
  2. The new "Promise" cases will (hopefully) fail in a few places. Most notably in the ResidualHeapVisitor and ResidualHeapSerializer, where a case "Promise": needs to be added similar to case "Date":, as Sebastian said in https://github.com/facebook/prepack/issues/1285#issuecomment-354828615.

Nice, thanks. I'd like to start contributing and that seems easy enough. Hopefully I'll find time soon (if someone else want to work on it please do).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

simon-yxl picture simon-yxl  路  3Comments

gaearon picture gaearon  路  5Comments

jtenner picture jtenner  路  5Comments

bevacqua picture bevacqua  路  8Comments

sebmarkbage picture sebmarkbage  路  6Comments