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 <[email protected]> on
behalf of Phil Bouchard <[email protected]>
Sent: Tuesday, July 11, 2017 1:49:05 PM
To: [email protected]
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
[email protected]
http://lists.qt-project.org/mailman/listinfo/development
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development