-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
await not available in Cordova #5
Comments
The Cordova example at https://github.com/dcdc-io/node-gp-phonegap/blob/master/www/js/index.js works using async/await on the devices I've tested. Stock LG G4 Android 6.0 Stock Sony Xperia XZ Premium Andoird 9.0 I've not delved into the Chrome/webview details but if there is a problem I suspect it's there? As a workaround I would recommend against using the promise then/catch API and instead transpiling down for older APIs |
Ah yeh I might require a pull. Will test and let you know
…________________________________
From: Benjamin Babik <notifications@github.com>
Sent: Monday, August 5, 2019 13:41
To: dcdc-io/node-gp
Cc: John McLear; Author
Subject: Re: [dcdc-io/node-gp] await not available in Cordova (#5)
The Cordova example at https://github.com/dcdc-io/node-gp-phonegap/blob/master/www/js/index.js works using async/await on the devices I've tested.
Stock LG G4 Android 6.0
Stock Sony Xperia XZ Premium Andoird 9.0
I've not delved into the Chrome/webview details but if there is a problem I suspect it's there?
As a workaround I would recommend against using the promise then/catch API and instead transpiling down for older APIs
-
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#5?email_source=notifications&email_token=AABV5QCZZLIWFUMCMJZ6ISDQDANYHA5CNFSM4IJHJHG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3RWCDY#issuecomment-518217999>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AABV5QBJ4TKV3Q7OV6743BLQDANYHANCNFSM4IJHJHGQ>.
|
Also, async/await don't work a the top of the file's scope - i.e. // foobar.js
async function foo() {
return 1;
}
// won't work - SyntaxError: await is only valid in async function
await foo();
async function bar() {
// will work
await foo();
}
bar(); |
Cordova example currently expects async/await to be available and that is not the case.
should work
The text was updated successfully, but these errors were encountered: