1 | const statement = require("./statement.js"); |
2 |
|
3 | class Event { |
4 | constructor() { |
5 | if (arguments.length == 0) this.statementsVar = []; |
6 | if (arguments.length == 1) this.statementsVar = [arguments[0]]; |
7 | if (arguments.length == 3) this.statementsVar = [new statement(arguments[0], arguments[1], arguments[2])]; |
8 | } |
9 |
|
10 | get statements() {return this.statementsVar} |
11 | set statements(statements) {this.statementsVar = statements} |
12 |
|
13 | push() { |
14 | if (arguments.length == 1) this.statements.push(arguments[0].statements); |
15 | if (arguments.length == 3) this.statements.push(new statement(arguments[0], arguments[1], arguments[2])); |
16 | return this; |
17 | } |
18 | } |
19 |
|
20 | module.exports = Event; |
21 |
|