Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Clean source test and removed debugging code..

  • Loading branch information...
commit 4b77d2709cdaec65c976e472ea6af5cc1818b77d 1 parent 16c0936
@davglass authored
Showing with 35 additions and 18 deletions.
  1. +2 −10 index.php
  2. +32 −0 tests/post-clean.html
  3. +1 −8 tests/post-source.html
View
12 index.php
@@ -21,17 +21,9 @@
if ($tempName) {
- $cmd = $java.' -jar '.escapeshellarg($rhino).' '.escapeshellarg($jslint).' '.$fulljslint.' '.escapeshellarg($tempName).' 2>&1';
- //echo($cmd);
- $out = exec($cmd, $data);
-
- $error = file_get_contents($tempNameOut);
- $error = str_replace('js: ', '', $error);
- $error = str_replace('"'.$tempName.'", ', '', $error);
-
- //echo('<pre>'.$error.'</pre>');
+ $cmd = $java.' -jar '.escapeshellarg($rhino).' '.escapeshellarg($jslint).' '.escapeshellarg($fulljslint).' '.escapeshellarg($tempName).' 2>&1'; //This redirects error and out to out so we get it..
+ $out = exec($cmd);
echo($out);
- //echo('<pre>'.print_r($data, 1).'</pre>');
} else {
$json->error = new stdclass();
View
32 tests/post-clean.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>JSON Web Service Test</title>
+</head>
+<body>
+<h2>Posting Source</h2>
+
+<form method="post" action="../index.php">
+<textarea name="source" rows="40" cols="80">
+var arr = ['1', '2', '3'];
+
+var Bar = function() {};
+
+var foo = new Bar();
+
+var test = {};
+
+for (var i in test) {
+ if (test.hasOwnProperty(i)) {
+ alert(i);
+ }
+}
+
+</textarea>
+<br><input type="submit" name="go" value="jslint this code">
+</form>
+
+</body>
+</html>
+
View
9 tests/post-source.html
@@ -11,14 +11,7 @@
<textarea name="source" rows="40" cols="80">
var arr = new Array('1', '2', '3',);
-
-var arr = new Array('1', '2', '3',);
-
-
-var arr = new Array('1', '2', '3',);
-
-
-foo = new Bar();
+var foo = new bar();
foo++;
Please sign in to comment.
Something went wrong with that request. Please try again.