aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4generatorobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-06-19 13:28:26 +0200
committerLars Knoll <lars.knoll@qt.io>2018-06-25 07:36:48 +0000
commit1596112e146b28541bcee412ed159cdea7e692d0 (patch)
tree29e858041496256c9c9c700fca4fb7220d78d46e /src/qml/jsruntime/qv4generatorobject.cpp
parent3823e9b94f849f8344b81250fac708ac2eaccd16 (diff)
Add Proxy support for prototype handling
Cleanup get/setPrototypeOf and fix some smaller incompatibilities in the default implementation for Object. Add the methods to the vtable and reimplement them according to spec for ProxyObjects. Clean up the Object.prototype.get/setPrototypeOf/__proto__ methods and fix a smaller bug in the Reflect API for those methods. Change-Id: I6e438753332ec4db963d6cdcf86f340ff212777a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4generatorobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4generatorobject.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4generatorobject.cpp b/src/qml/jsruntime/qv4generatorobject.cpp
index a29eef513c..1c4c970c2e 100644
--- a/src/qml/jsruntime/qv4generatorobject.cpp
+++ b/src/qml/jsruntime/qv4generatorobject.cpp
@@ -78,9 +78,9 @@ Heap::FunctionObject *GeneratorFunction::create(ExecutionContext *context, Funct
Scope scope(context);
Scoped<GeneratorFunction> g(scope, context->engine()->memoryManager->allocate<GeneratorFunction>(context, function));
ScopedObject proto(scope, scope.engine->newObject());
- proto->setPrototype(scope.engine->generatorPrototype());
+ proto->setPrototypeOf(scope.engine->generatorPrototype());
g->defineDefaultProperty(scope.engine->id_prototype(), proto, Attr_NotConfigurable|Attr_NotEnumerable);
- g->setPrototype(ScopedObject(scope, scope.engine->generatorFunctionCtor()->get(scope.engine->id_prototype())));
+ g->setPrototypeOf(ScopedObject(scope, scope.engine->generatorFunctionCtor()->get(scope.engine->id_prototype())));
return g->d();
}
@@ -104,7 +104,7 @@ ReturnedValue GeneratorFunction::call(const FunctionObject *f, const Value *this
Scope scope(gf);
Scoped<GeneratorObject> g(scope, scope.engine->memoryManager->allocManaged<GeneratorObject>(requiredMemory, scope.engine->classes[EngineBase::Class_GeneratorObject]));
- g->setPrototype(ScopedObject(scope, gf->get(scope.engine->id_prototype())));
+ g->setPrototypeOf(ScopedObject(scope, gf->get(scope.engine->id_prototype())));
Heap::GeneratorObject *gp = g->d();
gp->stack.size = stackSize;
@@ -160,7 +160,7 @@ void GeneratorPrototype::init(ExecutionEngine *engine, Object *ctor)
ctorProto->defineDefaultProperty(engine->symbol_toStringTag(), (v = engine->newIdentifier(QStringLiteral("GeneratorFunction"))), Attr_ReadOnly_ButConfigurable);
ctorProto->defineDefaultProperty(engine->id_prototype(), (v = this), Attr_ReadOnly_ButConfigurable);
- setPrototype(engine->iteratorPrototype());
+ setPrototypeOf(engine->iteratorPrototype());
defineDefaultProperty(QStringLiteral("constructor"), ctorProto, Attr_ReadOnly_ButConfigurable);
defineDefaultProperty(QStringLiteral("next"), method_next, 1);
defineDefaultProperty(QStringLiteral("return"), method_return, 1);