diff options
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 4b2a98bcad..29a916bd7e 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -1542,11 +1542,31 @@ bool Codegen::visit(FalseLiteral *) return false; } +bool Codegen::visit(SuperLiteral *ast) +{ + if (hasError) + return false; + + throwSyntaxError(ast->superToken, QLatin1String("Support for 'super' keyword not implemented")); + return false; +} + bool Codegen::visit(FieldMemberExpression *ast) { if (hasError) return false; + if (AST::IdentifierExpression *id = AST::cast<AST::IdentifierExpression *>(ast->base)) { + if (id->name == QLatin1String("new")) { + // new.target + if (ast->name != QLatin1String("target")) { + throwSyntaxError(ast->identifierToken, QLatin1String("Expected 'target' after 'new.'.")); + return false; + } + throwSyntaxError(ast->identifierToken, QLatin1String("Support for 'new.target' unimplemented.")); + } + } + Reference base = expression(ast->base); if (hasError) return false; |