aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4generatorobject_p.h3
-rw-r--r--tests/auto/qml/ecmascripttests/TestExpectations1
3 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 04fbe2d1e3..a2afeb87d7 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -521,7 +521,7 @@ void Heap::ScriptFunction::init(QV4::ExecutionContext *scope, Function *function
ScopedString name(s, n ? n->d() : function->name());
if (name)
f->setName(name);
- if (makeConstructor)
+ if (makeConstructor && !function->isArrowFunction())
f->createDefaultPrototypeProperty(Heap::FunctionObject::Index_ProtoConstructor);
Q_ASSERT(internalClass && internalClass->find(s.engine->id_length()->propertyKey()) == Index_Length);
diff --git a/src/qml/jsruntime/qv4generatorobject_p.h b/src/qml/jsruntime/qv4generatorobject_p.h
index 55e6091ad5..c3b8e84154 100644
--- a/src/qml/jsruntime/qv4generatorobject_p.h
+++ b/src/qml/jsruntime/qv4generatorobject_p.h
@@ -73,6 +73,9 @@ struct GeneratorFunctionCtor : FunctionObject {
};
struct GeneratorFunction : ScriptFunction {
+ void init(QV4::ExecutionContext *scope, Function *function, QV4::String *name = nullptr) {
+ ScriptFunction::init(scope, function, name, false);
+ }
};
struct MemberGeneratorFunction : MemberFunction {
diff --git a/tests/auto/qml/ecmascripttests/TestExpectations b/tests/auto/qml/ecmascripttests/TestExpectations
index ea3cf60c7a..9a61cb36a3 100644
--- a/tests/auto/qml/ecmascripttests/TestExpectations
+++ b/tests/auto/qml/ecmascripttests/TestExpectations
@@ -655,7 +655,6 @@ language/expressions/arrow-function/lexical-new.target.js fails
language/expressions/arrow-function/lexical-super-call-from-within-constructor.js fails
language/expressions/arrow-function/lexical-supercall-from-immediately-invoked-arrow.js fails
language/expressions/arrow-function/lexical-this.js fails
-language/expressions/arrow-function/prototype-rules.js fails
language/expressions/arrow-function/scope-body-lex-distinct.js sloppyFails
language/expressions/arrow-function/scope-param-elem-var-close.js sloppyFails
language/expressions/arrow-function/scope-param-elem-var-open.js sloppyFails