add support for class initializer properties - 6to5/6to5#619
This commit is contained in:
parent
04cf3f3f9d
commit
ac2dfced36
12
acorn.js
12
acorn.js
@ -3674,8 +3674,20 @@
|
|||||||
} else {
|
} else {
|
||||||
method.kind = "";
|
method.kind = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var classProperty = false;
|
||||||
|
|
||||||
if (tokType === _colon) {
|
if (tokType === _colon) {
|
||||||
method.typeAnnotation = parseTypeAnnotation();
|
method.typeAnnotation = parseTypeAnnotation();
|
||||||
|
classProperty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.playground && eat(_eq)) {
|
||||||
|
method.value = parseMaybeAssign();
|
||||||
|
classProperty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (classProperty) {
|
||||||
semicolon();
|
semicolon();
|
||||||
classBody.body.push(finishNode(method, "ClassProperty"));
|
classBody.body.push(finishNode(method, "ClassProperty"));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user