HeimgardTechnologiesAS / cordova-plugin-advanced-websocket

MIT License
27 stars 18 forks source link

don't use block scoped definitions (Breaks Android 6) #12

Closed pliablepixels closed 5 years ago

pliablepixels commented 5 years ago

Fixes Error reported:

03-17 11:03:34.177  4100  4100 I chromium: [INFO:CONSOLE(19)] "Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode", source: file:///android_asset/www/plugins/cordova-plugin-advanced-websocket/www/plugin.js (19)

(Android 6.0 still has the largest deployment base, so it may be worthwhile to support it)

chax commented 5 years ago

Haha, i saw you open issue in cordova-plugin-advanced-http and close it then. I will look at it tomorrow if i find time, but there migh be a possibility of you using the code wrong because it works for us.

pliablepixels commented 5 years ago

Thanks. Your code works just fine on newer browsers that support let. If you run it with an emulator with just stock Android 6 (no chrome updates), we can replicate this error. Yes, I got confused with cordova-advanced-http/websocket ;-)

chax commented 5 years ago

Aaaah, yes we are using crosswalk so that's why it probably works for us. I will review this on monday and make new release for npm when we merge this. I'm AFK now.

chax commented 5 years ago

Merged, bumped version, tagged, and published on NPM as 1.1.5

pliablepixels commented 5 years ago

Thank you!