[Development] JS Engine: callAsConstructor vs. virtualCallAsConstructor

Valery Kotov kotov.valery at gmail.com
Thu Aug 2 15:44:53 CEST 2018


Hello all,

I have a question about recent introduction of "virtual" functions in
JavaScript engine.

Now objects have both virtualCallAsConstructor function and
callAsConstructor functions.
Unfortunately, distinction between those is a little bit unclear to me. Is
virtualCallAsConstructor is actually what is called when object is created
on JS side (via new call)? Shall virtuallCallAsConstructor now be used when
an JS Object is needed to be created from C++ side?

I'm also a little bit puzzled about signature:
static ReturnedValue virtualCallAsConstructor(const FunctionObject *f,
const Value *argv, int argc, const Value *);

What is the last const Value*? Shall I pass args as last the last arguments?

Sincerely yours,
Valery Kotov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20180802/92225d60/attachment.html>


More information about the Development mailing list