Skip to content

Wrapping javascript constructors recipe

Herbert Vojčík edited this page Apr 28, 2014 · 6 revisions

Required Amber version: >= 0.12.0

To wrap JS constructors, you can do the following:

MyClass class >> initialize
    self javascriptConstructor: aJavaScriptFunction

More details can be found in Behavior >> javascriptConstructor: and smalltalk.setClassConstructor in the file boot.js.

See also Call-javascript-constructors-with-arguments

Clone this wiki locally