[Development] Qt 5.9's new garbage collector documentation? + root_ptr

Simon Hausmann Simon.Hausmann at qt.io
Tue Jul 11 13:58:20 CEST 2017


bar shall be a global variable that is callable (i.e. somebody initialized it with a function closure). When invoked it shall return either a primitive value or a JavaScript object and takes one arbitrary parameter.


It is an implementation detail whether it returns the parameter provided, or "42" (either as string or number :) and the behavior may change at run-time.


So at the compilation time of this snippet, all we basically know is


    var bar;


It could be that bar was initialized to "100", in which case I think an exception would be thrown at the attempt of calling it.


Simon

________________________________
From: Development <development-bounces+simon.hausmann=qt.io at qt-project.org> on behalf of Phil Bouchard <philippeb8 at gmail.com>
Sent: Tuesday, July 11, 2017 1:49:05 PM
To: development at qt-project.org
Subject: Re: [Development] Qt 5.9's new garbage collector documentation? + root_ptr

On 07/11/2017 04:02 AM, Tim Blechmann wrote:
>> On the other hand, I have good news as I think I have found a way to
>> simulate functions that return a function.
>
> how to you cope with structures like:
>
> function foo( outObject )
> {
>     var object = {}
>     outObject.object = object
>     outObject.result = function() { return object }
>     return function() { return bar( object ) }
> }

I'm looking into stuff like that so I am mimicking a run-time stack in
my example:
https://github.com/philippeb8/root_ptr/blob/qt/example/javascript_example1.cpp

Meanwhile please define bar();


Thanks,
-Phil

_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170711/f3349dd0/attachment.html>


More information about the Development mailing list