e85263190d031570237b6beaf5d3c915fb5496bc
[platform/framework/web/crosswalk-tizen.git] /
1 function simple(x,y){return x+y;}
2
3 function simple_2(a,b,c)
4 {
5                 return a+b   +  c    ;
6 }
7
8 // indent, spaces
9 function foo( x ){ return x; }
10
11 // test space on params
12 function bar(a,b,c){
13 // test indentation
14 return 'baz'; // test comment
15 }
16
17         // test nested fn
18     function dolor(){
19         // trailing white space
20         // missing semicolon
21         function fn(){      function deep()   {
22             // moar
23     function moar() {
24 // nested comment
25             return "inner";
26         }
27             return moar(   )  ;
28         }
29             // test invocation
30             setTimeout(fn,100);
31         }
32 }
33
34 // invocation
35 dolor();
36
37
38 // start test keepEmptyLines
39
40
41
42 // end test keepEmptyLines
43
44 // test a bug related with indentation and multiple consecutive functions
45 function outter(){ function a1(){return true}function a2(val){return (val*2)} }
46
47
48 // issue #29 : return + line break + ternary
49 function iss29(a){
50   return
51     a<5?23:12;
52 }
53
54 function multiLineReturn() {
55 return a&&
56 b||
57 c;
58 }
59
60 function expressionReturn() {
61 return (
62 a &&
63 b+
64 c
65 );
66 }
67
68 // issue #283
69 function       foo () {
70   bar()
71 }
72
73 // issue #140
74 function chainedReturn() {
75   return deferred.promise
76   .then(console.log)
77 }
78
79 // issue #231
80 function multiLineParams(
81 foo,
82 bar
83 ) {
84 }
85
86 // issue #285
87 function defaultParams(z, x    =     1, y=2) {
88   return x + y + z;
89 }