]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/controlFlowProfiler/driver/driver.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / controlFlowProfiler / driver / driver.js
1 function assert(condition, reason) {
2 if (!condition)
3 throw new Error(reason);
4 }
5
6 var ShouldHaveExecuted = true;
7 var ShouldNotHaveExecuted = false;
8
9 function checkBasicBlock(func, expr, expectation) {
10 if (expectation === ShouldHaveExecuted)
11 assert(hasBasicBlockExecuted(func, expr, "should have executed"));
12 else
13 assert(!hasBasicBlockExecuted(func, expr, "should not have executed"));
14 }