forked from glayzzle/php-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrowfunc.js
More file actions
39 lines (37 loc) · 887 Bytes
/
arrowfunc.js
File metadata and controls
39 lines (37 loc) · 887 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
/**
* Copyright (C) 2018 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
const Expression = require("./expression");
const KIND = "arrowfunc";
/**
* Defines an arrow function (it's like a closure)
* @constructor ArrowFunc
* @extends {Expression}
* @property {Parameter[]} arguments
* @property {Identifier} type
* @property {Expression} body
* @property {boolean} byref
* @property {boolean} nullable
* @property {boolean} isStatic
*/
module.exports = Expression.extends(KIND, function Closure(
args,
byref,
body,
type,
nullable,
isStatic,
docs,
location
) {
Expression.apply(this, [KIND, docs, location]);
this.arguments = args;
this.byref = byref;
this.body = body;
this.type = type;
this.nullable = nullable;
this.isStatic = isStatic || false;
});