Last active
December 20, 2015 04:29
-
-
Save suzuki0keiichi/6070997 to your computer and use it in GitHub Desktop.
Scala.jsでscala.js.Arrayの操作がどのように変換されるか
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // def hoge()の中身のみ貼付ける | |
| var array$jsid$11979 = [ScalaJS.modules.scala\ufe33Predef().int2Integer\ufe34I\ufe34Ljava\ufe33lang\ufe33Integer(10), ScalaJS.modules.scala\ufe33Predef().int2Integer\ufe34I\ufe34Ljava\ufe33lang\ufe33Integer(20), ScalaJS.modules.scala\ufe33Predef().int2Integer\ufe34I\ufe34Ljava\ufe33lang\ufe33Integer(30)]; | |
| array$jsid$11979[0] = ScalaJS.modules.scala\ufe33Predef().int2Integer\ufe34I\ufe34Ljava\ufe33lang\ufe33Integer(15); | |
| var num$jsid$11980 = ScalaJS.as.java\ufe33lang\ufe33Number(array$jsid$11979[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 同様にdef hoge()の中身 | |
| // パッケージ名がscala.jsからscala.scalajs.jsに変わっていた | |
| var array = [ScalaJS.modules.scala_Predef().int2Integer__I__Ljava_lang_Integer(10), ScalaJS.modules.scala_Predef().int2Integer__I__Ljava_lang_Integer(20), ScalaJS.modules.scala_Predef().int2Integer__I__Ljava_lang_Integer(30)]; | |
| array[0] = ScalaJS.modules.scala_Predef().int2Integer__I__Ljava_lang_Integer(15); | |
| var num = ScalaJS.as.java_lang_Number(array[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object HelloWorld { | |
| def hoge() { | |
| val array = scala.js.Array[Number](10, 20, 30) | |
| array.update(0, 15) | |
| val num = array(0) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment