Skip to content

Commit 7f58e1f

Browse files
author
Eric MORAND
authored
Merge pull request #28 from ericmorand/issue_25
Implement issue #25
2 parents 722651e + 2eb12ee commit 7f58e1f

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"moment-timezone": "^0.5.14",
4848
"object-hash": "^1.2.0",
4949
"pad": "^2.0.3",
50-
"parse-function": "^5.0.23",
50+
"parse-function": "^5.1.1",
5151
"regex-parser": "^2.2.8",
5252
"secure-filters": "^1.1.0",
5353
"sha.js": "^2.4.9",

src/reflection-method.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,6 @@ class TwingReflectionMethod {
1212

1313
let parser = parseFunction();
1414

15-
// until https://github.com/tunnckoCore/parse-function/issues/110 is fixed, we have to use this plugin to support instrumentation
16-
parser.use((app: any) => {
17-
return (node: any, result: any) => {
18-
if (node.type === 'FunctionExpression') {
19-
let params = node.params;
20-
21-
for (let param of params) {
22-
if (param.type === 'AssignmentPattern') {
23-
let right = param.right;
24-
25-
if (right.type === 'SequenceExpression') {
26-
let value: any;
27-
let lastExpression = right.expressions.pop();
28-
29-
if (lastExpression.type === 'NullLiteral') {
30-
value = null;
31-
}
32-
else {
33-
value = lastExpression.value;
34-
}
35-
36-
result.defaults[param.left.name] = value;
37-
}
38-
}
39-
}
40-
}
41-
42-
return result;
43-
}
44-
});
45-
4615
if (typeof callable === 'string') {
4716
callable = Reflect.get(global, callable as string);
4817
}

0 commit comments

Comments
 (0)