From 7b0cb855edcfdeb04e7d0d1c2545958877481ecc Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 3 May 2018 15:59:35 +0200 Subject: name anonymous functions that way Function and Generator objects created through the Functon or GeneratorObject constructors are supposed to have the name "anonymous" (ref. section 19.2.1.1.1 in the ES8 spec) Change-Id: I1eff4abce882b9508f8e161de1de9efaca1a5129 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4functionobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4functionobject.cpp') diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 6382a6e862..c556bdb008 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -229,7 +229,7 @@ QQmlRefPointer FunctionCtor::parse(ExecutionEngin if (engine->hasException) return nullptr; - QString function = (t == Type_Function ? QLatin1String("function(") : QLatin1String("function*(")) + arguments + QLatin1String("){") + body + QLatin1Char('}'); + QString function = (t == Type_Function ? QLatin1String("function anonymous(") : QLatin1String("function* anonymous(")) + arguments + QLatin1String("){") + body + QLatin1Char('}'); QQmlJS::Engine ee; QQmlJS::Lexer lexer(&ee); -- cgit v1.2.3