diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-03-13 17:50:00 -0400 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-03-13 22:51:05 +0100 |
commit | 14aa03319d780d72499dacd521aba661715414cd (patch) | |
tree | d94caebb812d2767549b2cbfe2d3a2a24016aa98 /src | |
parent | 79ad61615e88c55c1f2ab5cf97b86812a04996c9 (diff) |
Implement another method in the v8 API
Change-Id: I54918914a8c9b395211ccbff891a90ab069be4a5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/v4/qv4v8.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/v4/qv4v8.cpp b/src/v4/qv4v8.cpp index fa98efe20f..7290c467a6 100644 --- a/src/v4/qv4v8.cpp +++ b/src/v4/qv4v8.cpp @@ -799,8 +799,19 @@ bool Object::Set(Handle<Value> key, Handle<Value> value, PropertyAttribute attri bool Object::Set(uint32_t index, Handle<Value> value) { - Q_UNIMPLEMENTED(); - Q_UNREACHABLE(); + QQmlJS::VM::Object *o = ConstValuePtr(this)->asObject(); + assert(o); + QQmlJS::VM::ExecutionContext *ctx = currentEngine()->current; + bool result = true; + try { + o->putIndexed(ctx, index, *ValuePtr(&value)); + // ### attribs + } catch (VM::Exception &e) { + Isolate::GetCurrent()->setException(e.value()); + e.accept(ctx); + result = false; + } + return result; } Local<Value> Object::Get(Handle<Value> key) |