File: class.txt

package info (click to toggle)
highlight.js 10.7.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,332 kB
  • sloc: javascript: 41,059; makefile: 157; python: 29; sh: 20
file content (28 lines) | stat: -rw-r--r-- 512 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Vehicle {}
class Car extends Vehicle {
  constructor(speed, cost) {
    super(speed);

    var c = Symbol('cost');
    this[c] = cost;

    this.intro = `This is a car runs at
      ${speed}.`;
  }
  join() {
  }
  other(a = ( ( 3 + 2 ) ) ) {
    console.log(a)
  }
  something(a = ( ( 3 + 2 ) ), b = 1 ) {
    console.log(a)
  }
  onemore(a=(3+2, b=(5*9))) {}
}

// these should not be matched as class functions
for(expr; expr; expr) {}
while(value) {}
if(value) {}
switch(value) {}
try {} catch(err) {}