This didn't make much sense before because it was blocking the User Interface, but now, we have the Web Workers allowing to take advantage of multi-threading (or at least multi processing). It then looks to me that using synchronous APIs in Workers should be perfectly acceptable, even more when we know that the importScript() method available in this context works synchronously.

Another point is about other Server-Side JavaScript implementations
Most of them have synchronous APIs and take advantage of multi-threading
I'm not aware of all the details of all of them, most should not get errors from this option as they don't have "Sync" in their method names. In this case only the option name "stupid" is a bit hard (should our feelings being hurt when we don't choose NodeJS?)
To end my purpose, I would also mention Wakanda, which runs JS code on server synchronously by default. It support natively some HTML5 and NodeJS APIs to:
- start event loops like contexts when it make sense,
- be compatible with some existing libraries,
- and of course enhance learning curve.
On this platform, not only most of the JavaScript works synchronously, but it would also get the warning while using the synchronous versions of HTML5 APIs.
Maybe a warning is ok, because such code could not be reused in any context (main user interface context, or Node.js context), but then, isn't the "stupid" option name a bit too strong?

benquarmby

Doug, I don t have a problem with this option, but I would like to suggest a stricter implementation of it s behavior. Instead of broadly catching the

Message 2 of 11
, Jun 20, 2012

0 Attachment

Doug,

I don't have a problem with this option, but I would like to suggest a stricter implementation of it's behavior.

Instead of broadly catching the substring "Sync", limit it to catch functions that *end* with "Sync", since all blocking Node methods appear use this convention.

Matching the end will also stop it catching false positives. For example, the completion event handler for an asynchronous synchronize action, i.e. "onGroupSyncComplete".

Hope you agree.

--- In jslint_com@yahoogroups.com, "douglascrockford" <douglas@...> wrote:
>
> JSLint now warns when properties contain the substring 'Sync'. The use of that substring in Nodejs is to identify methods that can cause blockage. Such methods should never be used.
>
> These useful warnings can be suppressed by using the new Tolerate stupidity option.
>

Your message has been successfully submitted and would be delivered to recipients shortly.