browser/devtools/debugger/test/code_math.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 function add(a, b, k) {
     2   var result = a + b;
     3   return k(result);
     4 }
     6 function sub(a, b, k) {
     7   var result = a - b;
     8   return k(result);
     9 }
    11 function mul(a, b, k) {
    12   var result = a * b;
    13   return k(result);
    14 }
    16 function div(a, b, k) {
    17   var result = a / b;
    18   return k(result);
    19 }
    21 function arithmetic() {
    22   add(4, 4, function (a) {
    23     // 8
    24     sub(a, 2, function (b) {
    25       // 6
    26       mul(b, 3, function (c) {
    27         // 18
    28         div(c, 2, function (d) {
    29           // 9
    30           console.log(d);
    31         });
    32       });
    33     });
    34   });
    35 }
    37 // Compile with closure compiler and the following flags:
    38 //
    39 //     --compilation_level WHITESPACE_ONLY
    40 //     --source_map_format V3
    41 //     --create_source_map code_math.map
    42 //     --js_output_file    code_math.min.js
    43 //
    44 // And then append the sourceMappingURL comment directive to code_math.min.js
    45 // manually.

mercurial