NathanaelA / nativescript-websockets

Websockets for NativeScript
83 stars 43 forks source link

Tremho sbg parser fixes #97

Open tremho opened 2 years ago

tremho commented 2 years ago

This represents the changes needed to prevent the Nativescript build from failing during the StaticBindingGenerator process. That process apparently uses a Javascript parser that isn't compatible with certain modern syntaxes. There is some ambiguity about the causes of this problem, because the SBG apparently can parse (or maybe ignore) this file successfully in some cases (not sure why), but the gist of this fix is that it works by changing the syntax to simplistic forms that pass in any event.

Also fixed is the value sent to NSURLRequest for the timeout. The iOS API takes seconds instead of milliseconds. This normalizes milliseconds as the nativescript API spec for both Android and iOS.

Note a couple other files were modified and then reverted in subsequent commits. In then end, there should only be changes to websockets-base.android.js and the timeout change to websockets-base.ios.js

NathanaelA commented 2 years ago

I just saw your PR (wish github let me know about it a couple months ago, sorry about that). Can you tell me what version of NativeScript is failing the SBG parsing?