Fix parsing of class properties (#351)

This commit is contained in:
Kevin Gibbons
2017-03-10 03:43:45 -08:00
committed by Daniel Tschinder
parent 0b7da509d9
commit 81056eeee7
47 changed files with 3821 additions and 95 deletions

View File

@@ -1109,6 +1109,13 @@ export default function (instance) {
};
});
// determine whether or not we're currently in the position where a class method would appear
instance.extend("isClassMethod", function (inner) {
return function () {
return this.isRelational("<") || inner.call(this);
};
});
// determine whether or not we're currently in the position where a class property would appear
instance.extend("isClassProperty", function (inner) {
return function () {
@@ -1439,14 +1446,4 @@ export default function (instance) {
return this.match(tt.colon) || inner.call(this);
};
});
instance.extend("isClassMutatorStarter", function (inner) {
return function () {
if (this.isRelational("<")) {
return true;
} else {
return inner.call(this);
}
};
});
}