aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/parse.js24
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/parse.js b/lib/parse.js
index 78311f89..84b14439 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -1342,6 +1342,20 @@ function parse($TEXT, options) {
var start = S.token;
var type = start.type;
var name = as_property_name();
+ if (is("punc", "(")) {
+ var func_start = S.token;
+ var func = function_(AST_Function);
+ func.start = func_start;
+ func.end = prev();
+ a.push(new AST_ObjectKeyVal({
+ start: start,
+ quote: start.quote,
+ key: "" + name,
+ value: func,
+ end: prev(),
+ }));
+ continue;
+ }
if (!is("punc", ":") && type == "name") switch (name) {
case "get":
a.push(new AST_ObjectGetter({
@@ -1379,11 +1393,11 @@ function parse($TEXT, options) {
}
expect(":");
a.push(new AST_ObjectKeyVal({
- start : start,
- quote : start.quote,
- key : "" + name,
- value : expression(false),
- end : prev()
+ start: start,
+ quote: start.quote,
+ key: "" + name,
+ value: expression(false),
+ end: prev(),
}));
}
next();