docs-v7
docs-v7 copied to clipboard
Promise? Which promise spec?
Hey, which promise spec is NativeScript following. Do you have it documented somewhere?
Hey @NathanaelA,
It's ES6's Promise spec actually. The new getting started guide mentions this (see except below), but I think that's the only place that appears in the docs. Is there someplace else you expected this to be documented?
Promises are a part of ECMAScript 6 (the scripting language of which JavaScript is an implementation). Because Promises have been implemented in the two JavaScript engines NativeScript uses—V8 for Android and JavaScriptCore for iOS—Promises are available for use in NativeScript apps.
Interesting, after looking through a couple promising (pun intended) pages -- I did a search on the site and in the github search (top of the screen) on the docs/this repo for promise and that link does NOT show up. So from my perspective it didn't exist. Hence this issue. :grinning:
As for where to put it -- I wonder if maybe there should be a special page on ES6 features supported. Because not only promises but NativeScript also supports Map (which isn't a feature iOS 6 supports by default)
I finally figured that out by looking through the es6-promisies file in the NativeScript/NativeScript repo. ;-)
I should mention after a tad of testing right now, if you do a search for "promise" your snippet doesn't show up. If you do a search for "promises" it does show up. Since you do a new Promise() I would recommend that that the above snippet add a sentence that has just the singular promise word in it so that searching will find it.
I like the idea of having a page on the docs that talks about which new JavaScript features are supported and which are not. We'll be getting more and more features out of the box as we update JavaScriptCore and V8 and it'd be cool to have someplace to see that.
:+1:
console.log
would fit into such an article pretty well too.
Adding up-for-grabs. This would fit nicely into an article on global objects. console
would fit nicely there as well. If anyone stumbles upon this and is interested in contributing feel free to ping me in the community Slack channel (I’m tjvantoll).
Sorry to revive the issue... If it is following the ES6 spec, where is the finally
method to end the chain?
@vjoao No worries. To my knowledge finally
is not part of the ES2015 spec. I might be missing something, but I don’t see if referenced here http://www.ecma-international.org/ecma-262/6.0/#sec-promise-constructor.