intanpalupidn / jquery-oembed

Automatically exported from code.google.com/p/jquery-oembed
0 stars 0 forks source link

Patch with improvements/ fixes to plugin Javascript, based on JSLint output #30

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try the JS file (/p/jquery-oembed/source/browse/trunk/jquery.oembed.js) in 
http://JSlint.com
2.

What is the expected output? What do you see instead?
* I expect to see the minimum of spurious errors/ warnings, so real bugs can be 
found more easily.
* Plus, using JSLint may reduce the size of the minified Javascript.
* I see a lot of 'errors'/ warnings.

What version of the product are you using? On what operating system?
* Revision r24 of Javascript / any operating system.

Please provide any additional information below.

A summary of the improvements in the patch:

 * Added /*global */ comment,
 * Added /*jslint */ comment,
 * Added 'use strict' statement (http://stackoverflow.com/questions/1335851/what-does-use-strict-do-in-javascript-and-what-is-the-reasoning-behind-it)
 * Whitespace clean-up,
 * Replaced '==' with '===' and '!=' with '!==',
 * Added { } round IF-ELSE statements,
 * Moved line  var settings, activeProviders = [];
 * Replaced  for(i=0; i<..length; i++)  WITH  for(i in this.urlschemes) - approx. line 157 etc. X approx. 4 (shorter + JSLint warning),
 * Line 203 approx.: Replaced  if(activeProviders[i].apiendpoint == null)  WITH  if(typeof activeProviders[i].apiendpoint !== "string").

Original issue reported on code.google.com by n.d.freear on 21 Sep 2011 at 11:16

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Woops, that should be "Revision r23" above! (And I would have preferred to mark 
this as a Patch/Improvement, its not really a "Defect".)

Note, let me know if you'd like the patch broken down into smaller "steps".

Thanks for the continued work Richard and everyone.

Best wishes, Nick

Original comment by n.d.freear on 21 Sep 2011 at 11:38