diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-02 11:06:32 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-02 12:36:43 (GMT) |
commit | bdaf37f74e69f74c8fec23739e4dad23121af415 (patch) | |
tree | c84fb1a1698c926af083751d4d2112a0bcd48941 /src/declarative/qml/qmlscriptparser.cpp | |
parent | 8491b0476a221cf136b412bda532662a69063045 (diff) | |
download | Qt-bdaf37f74e69f74c8fec23739e4dad23121af415.zip Qt-bdaf37f74e69f74c8fec23739e4dad23121af415.tar.gz Qt-bdaf37f74e69f74c8fec23739e4dad23121af415.tar.bz2 |
Support parameterized synthesized methods
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r-- | src/declarative/qml/qmlscriptparser.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 1c88018..82f6a60 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -723,20 +723,19 @@ bool ProcessAST::visit(AST::UiSourceElement *node) if (AST::FunctionDeclaration *funDecl = AST::cast<AST::FunctionDeclaration *>(node->sourceElement)) { - if(funDecl->formals) { - QmlError error; - error.setDescription(QCoreApplication::translate("QmlParser","Slot declarations must be parameterless")); - error.setLine(funDecl->lparenToken.startLine); - error.setColumn(funDecl->lparenToken.startColumn); - _parser->_errors << error; - return false; + Object::DynamicSlot slot; + + AST::FormalParameterList *f = funDecl->formals; + while (f) { + slot.parameterNames << f->name->asString().toUtf8(); + f = f->finish(); } QString body = textAt(funDecl->lbraceToken, funDecl->rbraceToken); - Object::DynamicSlot slot; slot.name = funDecl->name->asString().toUtf8(); slot.body = body; obj->dynamicSlots << slot; + } else { QmlError error; error.setDescription(QCoreApplication::translate("QmlParser","QmlJS declaration outside Script element")); |