Skip to content

Instantly share code, notes, and snippets.

@vjeux
Created October 12, 2011 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjeux/1280750 to your computer and use it in GitHub Desktop.
Save vjeux/1280750 to your computer and use it in GitHub Desktop.
/* Input */
function f1(i) {
console.log('f1');
if (i) {
console.log(1);
} else if (i > 2)
console.log(2);
else if (true) {
console.log(3)
}
}
function f2() {
console.log('f2');
}
f1(0);
f1(1);
console.log('loaded');
/* Instrumented */
164function f1(i) {
visited[5] = true;
console.log("f1");
if (i) {
visited[4] = true;
console.log(1);
} else {
visited[3] = true;
if (i > 2) {
visited[2] = true;
console.log(2);
} else {
visited[1] = true;
if (true) {
visited[0] = true;
console.log(3);
}
}
}
}
function f2() {
visited[6] = true;
console.log("f2");
}
f1(0);
f1(1);
console.log("loaded");
/* Output */
function f1(i) {
console.log("f1");
if (i) {
console.log(1);
} else {
i > 2;
if (true) {
console.log(3);
}
}
}
f1(0);
f1(1);
console.log("loaded");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment