You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I just glanced over the current API draft and noticed there is no ES6 Promise API, for example napi_create_promise() etc. Is this just not done yet? Or is there another reason why it is not there?
I was hoping to find a NAPI interface for it so we can make sure we are not creating an impedance mismatch with our design of the JerryScript C Promise API (feedback appreciated ;)).
@martijnthe there are some conceptual differences between N-API design and JerryScript API design:
in N-API we pass the context as an explicit parameter to each API rather than having it implicit inside the implementation
All N-API APIs return a status to indicate whether the call was successful or not.
JS exceptions are implemented as a check-last-error concept, rather than an error flag on a JS value
JerryScript does not use scopes, but rather expects each value to be released explicitly
I have started to implement N-API using JerryScript in Zephyr.js (still a very early draft), and so far I have not found any problems bridging the two APIs.
You're right though, we should tackle ES promises in N-API.
Activity
gabrielschulhof commentedon May 4, 2017
@martijnthe there are some conceptual differences between N-API design and JerryScript API design:
I have started to implement N-API using JerryScript in Zephyr.js (still a very early draft), and so far I have not found any problems bridging the two APIs.
You're right though, we should tackle ES promises in N-API.
n-api: implement promise
n-api: implement promise
n-api: implement promise
n-api: implement promise
n-api: implement promise
n-api: implement promise