Accessing ThisBinding from Smalltalk

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

Accessing ThisBinding from Smalltalk

Sean P. DeNigris
Administrator
While translating the following JS to Smalltalk, I found some great info in the wiki [1] on accessing "this"!

Path.map(“#/:myprop).to(function() {
    console.log(this.params.myprop);
});

became:

(Path map: '#/:myprop') to: [ :this | console log: this params myprop ] currySelf.

Thanks for that great advice :)

[1] https://github.com/amber-smalltalk/amber/wiki/Accessing-this-recipe
Cheers,
Sean