Nathan-Wall / proto

A programming language derived from JavaScript which emphasizes prototypes, integrity, and syntax.
Other
12 stars 1 forks source link

Problem with `then` and `catch` methods on multi-level promises #61

Closed Nathan-Wall closed 10 years ago

Nathan-Wall commented 10 years ago

For some reason the code below fails to log anything. Calling bar instead of foo will work fine.

async foo :{
  await bar();
}

async bar :{
  throw 3;
}

foo().then(
  fn(v) :{ console.log('v', v); },
  fn(x) :{ console.log('x', x); }
);
Nathan-Wall commented 10 years ago

Most of the fix for this was done in 61b665c16c4bcbaf909cea10db3bd5e20c76286f. However, there is still a bug where functions which try to call later-defined functions don't actually refer to those later functions but instead try to retrieve the value from global built-ins. This bug has been filed under #64.

Since the async/promise part of this issue has been resolved, I'm going to close this one out.