JSLint/JSHint for adapter.js
See issue 2128 (https://code.google.com/p/webrtc/issues/detail?id=2128) for details.
Can you attach the patch here?
Github not allowing to attach a patch file.. getting an error "unfortunately we don't support file type. Try again with a PNG, GIF, or JPG".
The patch is mostly about fixes to get adapter.js to comply with jslint.com.
For files like adapter.js I find jslint pretty unworkable: hard to get past a lot of OK stuff flagged up as errors.
I think jshint.com is more useful. adapter.js currently passes jshint.com validation, apart from a few trivial errors: missing semi-colons, etc.
Adding a global 'use strict'; (at the top of the file) is probably sensible. As I understand it, function level 'use strict' is to enable the directive to be in scope only for the function – there's no point if a global 'use strict' is in place. (Just double checking that.)
On Thu, May 29, 2014 at 10:59 PM, Vikas Marwaha [email protected] wrote:
Github not allowing to attach a patch file.. getting an error "unfortunately we don't support file type. Try again with a PNG, GIF, or JPG".
— Reply to this email directly or view it on GitHub https://github.com/GoogleChrome/webrtc/issues/52#issuecomment-44590979.
OK, let's do that instead.
@marwahvikas, have you had a chance to look into this?
Sorry not yet, i will start this on Monday. Now i understand from Sam's comment what needs to be done. Will run jshint.com for adapter.js and fix the trivial errors and will use strict global mode.
Now quick question, is this something to be done only for adapter.js or all javascript samples?
Now quick question, is this something to be done only for adapter.js or all javascript samples?
I've been running all the other demos through JSHint – I'm in the process of adding the JSHint options stuff to every file, and including 'use strict'.
In the longer run we might want to do some of this (adding boilerplate code, etc.) via templating and/or build scripts – but there's something to be said for keeping it simple!
On Fri, Jun 20, 2014 at 12:21 PM, Vikas Marwaha [email protected] wrote:
Sorry not yet, i will start this on Monday. Now i understand from Sam's comment what needs to be done. Will run jshint.com for adapter.js and fix the trivial errors and will use strict global mode.
Now quick question, is this something to be done only for adapter.js or all javascript samples?
— Reply to this email directly or view it on GitHub https://github.com/GoogleChrome/webrtc/issues/52#issuecomment-46716768.
Thanks Sam, i will take care of adapter.js.
Thanks.
On Fri, Jun 20, 2014 at 1:36 PM, Vikas Marwaha [email protected] wrote:
Thanks Sam, i will take care of adapter.js.
— Reply to this email directly or view it on GitHub https://github.com/GoogleChrome/webrtc/issues/52#issuecomment-46723779.
Talked with @samdutton offline and this can probably be closed now giving his current work on jshint.