Allow super in class properties (#499)

This commit is contained in:
Brian Ng
2017-05-02 13:41:10 -05:00
committed by Henry Zhu
parent 9660f06b25
commit d33c82781a
6 changed files with 291 additions and 3 deletions

View File

@@ -381,7 +381,11 @@ export default class ExpressionParser extends LValParser {
switch (this.state.type) {
case tt._super:
if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) {
if (
!this.state.inMethod &&
!this.state.inClassProperty &&
!this.options.allowSuperOutsideMethod
) {
this.raise(this.state.start, "'super' outside of function or class");
}