summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Haoyi <haoyi@dropbox.com>2014-11-26 04:47:10 -0800
committerLi Haoyi <haoyi@dropbox.com>2014-11-26 04:47:10 -0800
commitc4c77dba86bce7b8003d04b591ef87ec02c4d871 (patch)
tree65c4193ec27186429b5d552e14c2c5badedcc7b8
parentc00c6caa2f09645f5c0ccf8165d83dc8421a66d2 (diff)
downloadhands-on-scala-js-c4c77dba86bce7b8003d04b591ef87ec02c4d871.tar.gz
hands-on-scala-js-c4c77dba86bce7b8003d04b591ef87ec02c4d871.tar.bz2
hands-on-scala-js-c4c77dba86bce7b8003d04b591ef87ec02c4d871.zip
fix command line example
-rw-r--r--book/src/main/scalatex/book/handson/CommandLine.scalatex4
1 files changed, 2 insertions, 2 deletions
diff --git a/book/src/main/scalatex/book/handson/CommandLine.scalatex b/book/src/main/scalatex/book/handson/CommandLine.scalatex
index 478292b..ea845da 100644
--- a/book/src/main/scalatex/book/handson/CommandLine.scalatex
+++ b/book/src/main/scalatex/book/handson/CommandLine.scalatex
@@ -115,10 +115,10 @@
@hl.bash
Hello World!
- In Scala.js, (1.0).toString is 0!
+ In Scala.js, (1.0).toString is 1!
@p
- This exhibits the weirdness of integer divide-by-zero in Scala.js, which is one of the few ways in which @sect.ref("Deviations from Scala-JVM", "Scala.js deviates from Scala-JVM"). This also shows us we're really running on Scala.js: on Scala-JVM, integer divide-by-zero throws an exception rather than returning zero!
+ This exhibits the weirdness of @hl.scala{Double.toString} in Scala.js, which is one of the few ways in which @sect.ref("Deviations from Scala-JVM", "Scala.js deviates from Scala-JVM"). This also shows us we're really running on Scala.js: on Scala-JVM, @hl.scala{(1.0).toString} returns @hl.scala{"1.0"} rather than @hl.scala{"1"}!
@p
One thing you may be wondering is: when you run a Scala.js program in the terminal, how does it execute the output Javascript? What about the DOM? and Ajax calls? Can it access the filesystem? The answer to all these questions is "it depends": it turns out there are multiple ways you can run Scala.js from the command-line: