Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save suzuki0keiichi/6070408 to your computer and use it in GitHub Desktop.
Save suzuki0keiichi/6070408 to your computer and use it in GitHub Desktop.
Scala.jsでdefがどのように変換されるか
// object宣言部は含まない
// 実体
ScalaJS.c.helloworld\ufe33HelloWorld$.prototype.hello\ufe34T = (function() {
return "hello world!"
});
// 外部からの呼び出し用
ScalaJS.c.helloworld\ufe33HelloWorld$.prototype.hello = (function() {
return this.hello\ufe34T()
});
ScalaJS.c.HelloWorld$.prototype.hello__T = (function() {
return "hello world!"
});
ScalaJS.c.HelloWorld$.prototype.hello__ = (function() {
return this.hello__T()
});
object HelloWorld {
def hello = "hello world!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment