diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-19 21:29:01 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-06-26 10:03:46 +0000 |
commit | 53adb5bbc659f4ae78427b0b1925bf9732d8a6e5 (patch) | |
tree | c45d87219ef000d09c514b3800564d896ce4b95f /src/qml/jsruntime/qv4proxy.cpp | |
parent | 89f585157af905d45012dbd9c079c48491e5211d (diff) |
Unify deleteProperty and deleteIndexedProperty vtable methods
Change-Id: I25245818c6ff2104642594476cb9684bac824f29
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4proxy.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4proxy.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp index 1e0c452430..06ed889c60 100644 --- a/src/qml/jsruntime/qv4proxy.cpp +++ b/src/qml/jsruntime/qv4proxy.cpp @@ -150,7 +150,7 @@ bool ProxyObject::putIndexed(Managed *m, uint index, const Value &value) return put(m, name, value); } -bool ProxyObject::deleteProperty(Managed *m, StringOrSymbol *name) +bool ProxyObject::deleteProperty(Managed *m, Identifier id) { Scope scope(m); const ProxyObject *o = static_cast<const ProxyObject *>(m); @@ -165,20 +165,20 @@ bool ProxyObject::deleteProperty(Managed *m, StringOrSymbol *name) if (scope.hasException()) return Encode::undefined(); if (trap->isNullOrUndefined()) - return target->deleteProperty(name); + return target->deleteProperty(id); if (!trap->isFunctionObject()) return scope.engine->throwTypeError(); JSCallData cdata(scope, 3, nullptr, handler); cdata.args[0] = target; - cdata.args[1] = name; + cdata.args[1] = id.toStringOrSymbol(scope.engine); cdata.args[2] = o->d(); // ### fix receiver handling ScopedValue trapResult(scope, static_cast<const FunctionObject *>(trap.ptr)->call(cdata)); if (!trapResult->toBoolean()) return false; ScopedProperty targetDesc(scope); - PropertyAttributes attributes = target->getOwnProperty(name->toPropertyKey(), targetDesc); + PropertyAttributes attributes = target->getOwnProperty(id, targetDesc); if (attributes == Attr_Invalid) return true; if (!attributes.isConfigurable()) @@ -186,13 +186,6 @@ bool ProxyObject::deleteProperty(Managed *m, StringOrSymbol *name) return true; } -bool ProxyObject::deleteIndexedProperty(Managed *m, uint index) -{ - Scope scope(m); - ScopedString name(scope, Primitive::fromUInt32(index).toString(scope.engine)); - return deleteProperty(m, name); -} - bool ProxyObject::hasProperty(const Managed *m, Identifier id) { Scope scope(m); |