diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-18 09:44:59 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-06-25 07:36:38 +0000 |
commit | 4f5d83acf78c7e3e3f4b89190d6109a4c8fa574d (patch) | |
tree | a4b4503804c6861c5348ee0e9a16db78c46496bc | |
parent | 12319279538be50f83db3c2a1e68ccde8fd99814 (diff) |
Fix length properties of global constructors
Change-Id: I4e9e1635f404082b0e8b333dc13a33d27e4f4b50
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/qml/jsruntime/qv4booleanobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4globalobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4numberobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4proxy.cpp | 1 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4stringobject.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qml/ecmascripttests/TestExpectations | 5 |
6 files changed, 5 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4booleanobject.cpp b/src/qml/jsruntime/qv4booleanobject.cpp index eb83f902db..80b95a71d4 100644 --- a/src/qml/jsruntime/qv4booleanobject.cpp +++ b/src/qml/jsruntime/qv4booleanobject.cpp @@ -66,7 +66,7 @@ void BooleanPrototype::init(ExecutionEngine *engine, Object *ctor) { Scope scope(engine); ScopedObject o(scope); - ctor->defineReadonlyProperty(engine->id_length(), Primitive::fromInt32(1)); + ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(1)); ctor->defineReadonlyProperty(engine->id_prototype(), (o = this)); defineDefaultProperty(QStringLiteral("constructor"), (o = ctor)); defineDefaultProperty(engine->id_toString(), method_toString); diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index 47a6734eda..95f65c47c0 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -335,7 +335,7 @@ void Heap::EvalFunction::init(QV4::ExecutionContext *scope) Scope s(scope); Heap::FunctionObject::init(scope, s.engine->id_eval()); ScopedFunctionObject f(s, this); - f->defineReadonlyProperty(s.engine->id_length(), Primitive::fromInt32(1)); + f->defineReadonlyConfigurableProperty(s.engine->id_length(), Primitive::fromInt32(1)); } ReturnedValue EvalFunction::evalCall(const Value *, const Value *argv, int argc, bool directCall) const diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp index f58ff45801..de24ec8181 100644 --- a/src/qml/jsruntime/qv4numberobject.cpp +++ b/src/qml/jsruntime/qv4numberobject.cpp @@ -95,7 +95,7 @@ void NumberPrototype::init(ExecutionEngine *engine, Object *ctor) Scope scope(engine); ScopedObject o(scope); ctor->defineReadonlyProperty(engine->id_prototype(), (o = this)); - ctor->defineReadonlyProperty(engine->id_length(), Primitive::fromInt32(1)); + ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(1)); ctor->defineReadonlyProperty(QStringLiteral("NaN"), Primitive::fromDouble(qt_qnan())); ctor->defineReadonlyProperty(QStringLiteral("NEGATIVE_INFINITY"), Primitive::fromDouble(-qInf())); diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp index 7bde34f880..310e6b4dac 100644 --- a/src/qml/jsruntime/qv4proxy.cpp +++ b/src/qml/jsruntime/qv4proxy.cpp @@ -318,6 +318,7 @@ void Heap::Proxy::init(QV4::ExecutionContext *ctx) Scope scope(ctx); Scoped<QV4::Proxy> ctor(scope, this); ctor->defineDefaultProperty(QStringLiteral("revocable"), QV4::Proxy::method_revocable, 2); + ctor->defineReadonlyConfigurableProperty(scope.engine->id_length(), Primitive::fromInt32(2)); } ReturnedValue Proxy::callAsConstructor(const FunctionObject *f, const Value *argv, int argc) diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index d35012d11e..b1ae5a1ce5 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -219,7 +219,7 @@ void StringPrototype::init(ExecutionEngine *engine, Object *ctor) setProperty(scope.engine, Heap::StringObject::LengthPropertyIndex, Primitive::fromInt32(0)); ctor->defineReadonlyProperty(engine->id_prototype(), (o = this)); - ctor->defineReadonlyProperty(engine->id_length(), Primitive::fromInt32(1)); + ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(1)); ctor->defineDefaultProperty(QStringLiteral("fromCharCode"), StringCtor::method_fromCharCode, 1); ctor->defineDefaultProperty(QStringLiteral("fromCodePoint"), StringCtor::method_fromCodePoint, 1); diff --git a/tests/auto/qml/ecmascripttests/TestExpectations b/tests/auto/qml/ecmascripttests/TestExpectations index 5b8ef52865..1b46c01fbf 100644 --- a/tests/auto/qml/ecmascripttests/TestExpectations +++ b/tests/auto/qml/ecmascripttests/TestExpectations @@ -567,9 +567,6 @@ built-ins/Object/entries/primitive-symbols.js fails built-ins/Object/entries/symbols-omitted.js fails built-ins/Object/entries/tamper-with-global-object.js fails built-ins/Object/entries/tamper-with-object-keys.js fails -built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-191.js fails -built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-194.js fails -built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-201.js fails built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-212.js fails built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-213.js fails built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-214.js fails @@ -856,7 +853,6 @@ built-ins/Proxy/isExtensible/return-same-result-from-target.js fails built-ins/Proxy/isExtensible/trap-is-not-callable-realm.js fails built-ins/Proxy/isExtensible/trap-is-not-callable.js fails built-ins/Proxy/isExtensible/trap-is-undefined.js fails -built-ins/Proxy/length.js fails built-ins/Proxy/ownKeys/call-parameters-object-getownpropertynames.js fails built-ins/Proxy/ownKeys/call-parameters-object-getownpropertysymbols.js fails built-ins/Proxy/ownKeys/call-parameters-object-keys.js fails @@ -1965,7 +1961,6 @@ built-ins/WeakSet/prototype/prototype-attributes.js fails built-ins/WeakSet/symbol-disallowed-as-weakset-key.js fails built-ins/WeakSet/undefined-newtarget.js fails built-ins/WeakSet/weakset.js fails -built-ins/eval/length-non-configurable.js fails built-ins/global/global-object.js fails built-ins/global/property-descriptor.js fails built-ins/isFinite/toprimitive-not-callable-throws.js fails |