How do I return a JavaScript object?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I return a JavaScript object?

Hannes Hirzel
Hi

I am translating a piece of JavaScript code to Smtk.

http://paperjs.org/tutorials/getting-started/using-javascript-directly/

I would like to create a JavaScript object and then pass it to Smalltalk

Something like

     newPath
     <return new paper.Path();>

But the complaint is 'too much recursion'?

What am I missing?

Regards
Hannes

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How do I return a JavaScript object?

Hannes Hirzel
Update:

The creation of the JavaScript object works, a JSProxyObject aPath is returned.

But the method call
       aPath strokeColor: 'red'.

causes too much recursion.

https://github.com/hhzl/Amber-Paper-Demo/blob/master/src/Examples-Paper.st

method Paper2>>main


On 4/23/14, H. Hirzel <[hidden email]> wrote:

> Hi
>
> I am translating a piece of JavaScript code to Smtk.
>
> http://paperjs.org/tutorials/getting-started/using-javascript-directly/
>
> I would like to create a JavaScript object and then pass it to Smalltalk
>
> Something like
>
>      newPath
>      <return new paper.Path();>
>
> But the complaint is 'too much recursion'?
>
> What am I missing?
>
> Regards
> Hannes
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.