Skip to content

Commit

Permalink
Added Clean source test and removed debugging code..
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Dec 16, 2008
1 parent 16c0936 commit 4b77d27
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 18 deletions.
12 changes: 2 additions & 10 deletions index.php
Expand Up @@ -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();
Expand Down
32 changes: 32 additions & 0 deletions 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>

9 changes: 1 addition & 8 deletions tests/post-source.html
Expand Up @@ -11,14 +11,7 @@ <h2>Posting Source</h2>
<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++;

Expand Down

0 comments on commit 4b77d27

Please sign in to comment.