mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
Add if.js example for trees.
This commit is contained in:
parent
abaf140791
commit
93c1fd0a24
13
js/src/if.js
Normal file
13
js/src/if.js
Normal file
@ -0,0 +1,13 @@
|
||||
function f() {
|
||||
var q = 0;
|
||||
for (var i = 0; i < 100; i++) {
|
||||
if ((i & 1) == 0)
|
||||
q++;
|
||||
else
|
||||
q--;
|
||||
}
|
||||
print(q);
|
||||
}
|
||||
|
||||
f();
|
||||
|
@ -1088,7 +1088,7 @@ js_IsLoopExit(JSContext* cx, JSScript* script, jsbytecode* pc)
|
||||
/* figure out whether this side exit is exitting the loop and don't trace in that case */
|
||||
jssrcnote* note = js_GetSrcNote(script, pc);
|
||||
if (!note) /* no note -> BREAK */
|
||||
return true;
|
||||
return false;
|
||||
switch (SN_TYPE(note)) {
|
||||
case SRC_WHILE:
|
||||
case SRC_BREAK2LABEL:
|
||||
|
Loading…
Reference in New Issue
Block a user