Skip to content

Commit

Permalink
fixing regular make check
Browse files Browse the repository at this point in the history
  • Loading branch information
notmasteryet committed Jun 23, 2010
1 parent 2006ad4 commit 80b0422
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -82,7 +82,7 @@ check-unit:
CLOSUREJAR ?= $(error Specify a valid path to a closure jar in ~/.profile: export CLOSUREJAR=~/compiler.jar)

SKETCHRUN ?= runSketch
SKETCHINPUT ?= $(error Specify a input filename in SKETCHINPUT when using package-sketch)
SKETCHINPUT ?= $(error Specify an input filename in SKETCHINPUT when using package-sketch)
SKETCHOUTPUT ?= ${SKETCHINPUT}.js

check-closure: create-release
Expand Down
6 changes: 3 additions & 3 deletions processing.js
Expand Up @@ -30,7 +30,7 @@
}
};

var isDOMPresent = "document" in this;
var isDOMPresent = ("document" in this) && !("fake" in this.document);

function Processing(curElement, aCode) {
var p = this;
Expand Down Expand Up @@ -9210,7 +9210,7 @@
// Compile the code
curSketch = Processing.compile(aCode);
//#else
throw "PJS compile is not supported";
// throw "PJS compile is not supported";
//#endif
}

Expand Down Expand Up @@ -10612,7 +10612,7 @@
}, false);
} else {
// DOM is not found
this['Processing'] = Processing;
this.Processing = Processing;
}
}());

8 changes: 5 additions & 3 deletions tools/jspreprocess.js
Expand Up @@ -2,19 +2,21 @@
function preprocess() {
var s, state = 0, stack = [];
while((s=readline()) !== null) {
var m = new RegExp(/^\s*\/\/\s*#(if|else|endif)\b(?:\s+(.*))?/).exec(s);
var m = new RegExp(/^\/\/\s*#(if|else|endif)\b(?:\s+(.*))?/).exec(s);
if(m) {
if(m[1] === "if") {
stack.push(state);
state = eval(m[2]) ? 0 : 1;
state = eval(m[2]) ? 3 : 1;
} else if(m[1] === "else") {
state = state === 1 ? 0 : 2;
state = state === 1 ? 3 : 2;
} else {
state = stack.pop();
}
} else {
if(state === 0) {
print(s);
} else if(state === 3) {
print(s.replace(/^\/\//g, " "));
}
}
}
Expand Down

0 comments on commit 80b0422

Please sign in to comment.