browser/devtools/debugger/test/code_tracing-01.js

Thu, 15 Jan 2015 21:13:52 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:13:52 +0100
branch
TOR_BUG_9701
changeset 12
7540298fafa1
permissions
-rw-r--r--

Remove forgotten relic of ABI crash risk averse overloaded method change.

michael@0 1 function factorial(n) {
michael@0 2 if (n <= 1) {
michael@0 3 return 1;
michael@0 4 } else {
michael@0 5 return n * factorial(n - 1);
michael@0 6 }
michael@0 7 }
michael@0 8
michael@0 9 function* yielder(n) {
michael@0 10 while (n-- >= 0) {
michael@0 11 yield { value: n, squared: n * n };
michael@0 12 }
michael@0 13 }
michael@0 14
michael@0 15 function thrower() {
michael@0 16 throw new Error("Curse your sudden but inevitable betrayal!");
michael@0 17 }
michael@0 18
michael@0 19 function main() {
michael@0 20 factorial(5);
michael@0 21
michael@0 22 // XXX bug 923729: Can't test yielding yet.
michael@0 23 // for (let x of yielder(5)) {}
michael@0 24
michael@0 25 try {
michael@0 26 thrower();
michael@0 27 } catch (e) {
michael@0 28 }
michael@0 29 }

mercurial