Permalink
Browse files

Added JSLint to support dir and linted source.

  • Loading branch information...
1 parent 3e629cf commit 5a98b9ba1d8cd738bb9b9d19e0f2f7036642a7bf @corbanbrook committed Mar 7, 2011
Showing with 6,340 additions and 8 deletions.
  1. +15 −0 Makefile
  2. +2 −0 benchmarks/benchmarks.txt
  3. +50 −0 support/jslint-cmdline.js
  4. +6,264 −0 support/jslint.js
  5. +9 −8 webgl-2d.js
View
@@ -0,0 +1,15 @@
+# WebGL-2D
+
+# Make sure $JSSHELL points to your js shell binary in .profile or .bashrc
+# Most targets use commands that need a js shell path specified
+JSSHELL ?= $(error Specify a valid path to a js shell binary in ~/.profile: export JSSHELL=C:\path\js.exe or /path/js)
+
+# Version number used in naming release files.
+VERSION ?= $(error Specify a version for your release (e.g., VERSION=0.5))
+
+# Run JSLINT
+check-lint:
+ ${JSSHELL} -m -j -p -e "load('./support/jslint.js'); load('./support/jslint-cmdline.js'); runJslint(read('webgl-2d.js'));"
+
+clean:
+ rm -fr ./release
@@ -0,0 +1,2 @@
+WebGL-2D should be faster than Canvas2D at certain things and slower at others.
+It is important that you know what to expect when using WebGL-2D with your project.
View
@@ -0,0 +1,50 @@
+function runJslint(input) {
+ var e, i;
+ // input will come from the env via python
+ if (!JSLINT(input, {
+ predef: {
+ ImageData: true,
+ CanvasRenderingContext2D: true,
+ Float32Array: true,
+ Int32Array: true,
+ Uint16Array: true,
+ Uint8Array: true,
+ DOMParser: true,
+ window: true,
+ localStorage: true
+ },
+ evil: true,
+ undef: true,
+ eqeqeq: true,
+ newcap: false,
+ immed: true,
+ indent: 2,
+ browser: true,
+ sub: true,
+ eqeqeq: true,
+ immed: true,
+ newcap: true,
+ /*
+ forvar: true,
+ bitwise: true,
+ nomen: true,
+ onevar: true,
+ plusplus: true,
+ regexp: true,
+ rhino: true,
+ undef: true,
+ white: true
+ */
+ })) {
+ for (i = 0; i < JSLINT.errors.length; i += 1) {
+ e = JSLINT.errors[i];
+ if (e) {
+ print('Lint at line ' + e.line + ' character ' + e.character + ': ' + e.reason);
+ print((e.evidence || '').replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
+ print('');
+ }
+ }
+ } else {
+ print("jslint: No problems found");
+ }
+}
Oops, something went wrong.

0 comments on commit 5a98b9b

Please sign in to comment.