diff options
| author | Lars Knoll <lars.knoll@qt.io> | 2018-03-15 16:40:36 +0100 |
|---|---|---|
| committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-26 20:26:56 +0000 |
| commit | 7e854bc568b662a068a1aea60da03653bc08a235 (patch) | |
| tree | 7bee92ba2c7837f0837cc698fa2e3cbe44d5f201 /src/qml/jsruntime/qv4functionobject.cpp | |
| parent | c68dc99c92480b7794d4866602fc8a6fb0439a7a (diff) | |
| download | qtdeclarative-7e854bc568b662a068a1aea60da03653bc08a235.tar.gz | |
Clean up handling of the 'caller' property
This brings it closer in line with the ES8 spec. Also
remove a couple of tests testing the 'caller' property
of non strict functions, as it's not mandated by the
spec and we never set it.
Change-Id: Icece8a03989c474df1eae0e4e77b356e49575b32
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 390e0d5161..1a26fc857c 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -277,7 +277,6 @@ void FunctionPrototype::init(ExecutionEngine *engine, Object *ctor) defineDefaultProperty(QStringLiteral("apply"), method_apply, 2); defineDefaultProperty(QStringLiteral("call"), method_call, 1); defineDefaultProperty(QStringLiteral("bind"), method_bind, 1); - } ReturnedValue FunctionPrototype::method_toString(const FunctionObject *b, const Value *thisObject, const Value *, int) @@ -424,14 +423,6 @@ void Heap::ScriptFunction::init(QV4::ExecutionContext *scope, Function *function f->init(name, true); Q_ASSERT(internalClass && internalClass->find(s.engine->id_length()) == Index_Length); setProperty(s.engine, Index_Length, Primitive::fromInt32(f->formalParameterCount())); - - if (function->isStrict()) { - ScopedProperty pd(s); - pd->value = s.engine->thrower(); - pd->set = s.engine->thrower(); - f->insertMember(s.engine->id_caller(), pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); - f->insertMember(s.engine->id_arguments(), pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); - } } Heap::InternalClass *ScriptFunction::classForConstructor() const |
