Verify if MemberExpression is computed
If a property access is computed, e.g. a[b], then it's in topic style. Currently, this isn't accounted for. Test & change ensures this doesn't parse.
This commit is contained in:
@@ -2100,7 +2100,9 @@ export default class ExpressionParser extends LValParser {
|
||||
isSimpleReference(expression: N.Expression): boolean {
|
||||
switch (expression.type) {
|
||||
case "MemberExpression":
|
||||
return this.isSimpleReference(expression.object);
|
||||
return (
|
||||
!expression.computed && this.isSimpleReference(expression.object)
|
||||
);
|
||||
case "Identifier":
|
||||
return true;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user