javascript: Fix handling some class-related unterminated statements
[geany-mirror.git] / tests / ctags / js-class-related-unterminated.js
blob73fb772bed0cf6c25f49f6dc85ef4e88dc6b3bd1
2 var Cls = {
3   // add a member just so Cls is recognized as a class from the start
4   A: {}
7 Cls.B = function(a, b) {
8   this.a = a;
9   this.b = b;
12 Cls.B.Sub = function() {
13   this.a = 0
16 Cls.B.prototype.m1 = function(a) {
17   this.a = a;
18   if (a > 2) {
19     this.a *= 2
20   }
22 Cls.B.prototype.m2 = function(b) {
23   var a = b
25 Cls.B.prototype.m3 = function(c) {
26   this.c = c
28 Cls.B.prototype.m4 = function(d) {
29   this.d = d
31 Cls.B.prototype.m5 = function(e) {
32   /* this should rather be written `Cls.B.Sub.prototype.dyn1 = this.m6`, but
33    * then parser then thinks it's a child of this very scope.  it isn't really
34    * possible to fix this as the only reason it's actually not a child of the
35    * current scope is because it exists in the root scope but not in this one */
36   var Sub = Cls.B.Sub;
37   Sub.prototype.dyn1 = this.m4
39 Cls.B.prototype.m6 = function(f) {
42 function main() {
43   var c = new Cls.B(1, 2);
44   var d = new Cls.B.Sub();
45   print(d.dyn1);
46   c.m5();
47   print(d.dyn1);
50 main();