It's a poor-man's 
[`Promise.try`](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/).

In a nutshell: It ensures that this function  __always__ returns a `Promise`. 
Even if anything we do would cause an error to be thrown, thanks to the 
wrapping it will be converted to a rejection instead of bubbling up the call 
stack.

In this case, suppose `preProcessOptions(platforms)` would return `undefined`. 
Then our accessing the result's `platforms` property would result in an error 
to be thrown.

[ Full content available at: https://github.com/apache/cordova-lib/pull/710 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to