JavaScript: don't choke when returning object literals
[geany-mirror.git] / tests / ctags / complex-return.js
blobe84190e567180ee61dce04a88693f377f9a826a9
2 function func1() {
3   return { a: 1, b:2 };
6 function func2() {
7   return 42;
10 var class1 = function() {
11   this.method1 = function() {
12     return 42;
13   };
14   this.method2 = function() {
15     return { a:1, b:2 };
16   };
17   this.method3 = function() {
18     return [1, 2, 3];
19   };
20   this.method4 = function() {
21     return "hello";
22   };
25 var class2 = function() {
26   this.c2m1 = function() {
27     c2m3(function() {
28       return { 'test': {} };
29     });
30   };
31   this.c2m2 = function(f) {
32     return { 'ret': f() };
33   };
34   this.c2m3 = function(f) {
35     return f();
36   };
39 var class3 = function() {
40   this.c3m1 = function() {
41     return function(n) {
42       if (n == 42) {
43         return 0;
44       } else {
45         return (n + 1) % 42;
46       }
47     };
48   };
49   this.c3m2 = function() {
50     return 0;
51   };
54 var class4 = function() {
55   this.method1 = function() {
56     return [{a:1, b:2}, {a:3, b:4}, {a:5, b:6}];
57   };
58   this.method2 = function() {
59     return 0;
60   };