nau / jscala

Scala macro that produces JavaScript from Scala code.
MIT License
205 stars 25 forks source link

Implement a way to re-use declarations across different JScala snippets #7

Closed nau closed 11 years ago

nau commented 11 years ago

https://groups.google.com/forum/#!topic/jscala-user/GTuhNZ8Esn4

nau commented 11 years ago

Fixed with #11 You can define your code inside a top-level object and use it.

object L { def f(x: Int): Int = ??? }
javascript { L.f(3) }

will generate

f(3);