Sfoglia il codice sorgente

Updated Makefile in st dir so that it works completely. Removed -L option to jtalkc that did not work. Removed bad-merge-leftover from Kernel-Tests.st

Göran Krampe 12 anni fa
parent
commit
3053b36af2
59 ha cambiato i file con 7242 aggiunte e 7947 eliminazioni
  1. 3 18
      bin/jtalkc
  2. 2 0
      bin/server
  3. 209 162
      css/jtalk.css
  4. 0 161
      examples/nodejs/benchfib/Benchfib.js
  5. 0 6409
      examples/nodejs/benchfib/Program.js
  6. 0 232
      examples/nodejs/pystone/Pystone.js
  7. BIN
      examples/presentation/esug2011/images/asterix.png
  8. BIN
      examples/presentation/esug2011/images/background_box.png
  9. BIN
      examples/presentation/esug2011/images/background_header.png
  10. BIN
      examples/presentation/esug2011/images/balloon.jpg
  11. BIN
      examples/presentation/esug2011/images/balloon_header.png
  12. BIN
      examples/presentation/esug2011/images/devices.jpg
  13. BIN
      examples/presentation/esug2011/images/enyo.png
  14. BIN
      examples/presentation/esug2011/images/ide_star_wars.png
  15. BIN
      examples/presentation/esug2011/images/nodejs.png
  16. BIN
      examples/presentation/esug2011/images/terminal.png
  17. BIN
      examples/presentation/esug2011/images/webos.png
  18. 17 0
      examples/presentation/index.html
  19. 520 0
      examples/presentation/js/Presentation.deploy.js
  20. 741 0
      examples/presentation/js/Presentation.js
  21. 1155 0
      examples/presentation/st/Presentation.st
  22. 18 0
      examples/trysmalltalk/index.html
  23. 121 110
      examples/trysmalltalk/js/TrySmalltalk.deploy.js
  24. 267 180
      examples/trysmalltalk/js/TrySmalltalk.js
  25. 964 0
      examples/trysmalltalk/st/TrySmalltalk.st
  26. 6 0
      ide.html
  27. BIN
      images/off.png
  28. BIN
      images/offHover.png
  29. BIN
      images/sprite.png
  30. BIN
      images/tinylogo.png
  31. 16 9
      js/Benchfib.js
  32. 11 11
      js/Canvas.deploy.js
  33. 19 19
      js/Canvas.js
  34. 0 11
      js/Compiler.deploy.js
  35. 2 18
      js/Compiler.js
  36. 2 2
      js/Examples.js
  37. 61 29
      js/IDE.deploy.js
  38. 101 59
      js/IDE.js
  39. 8 11
      js/JQuery-Tests.deploy.js
  40. 17 14
      js/JQuery-Tests.js
  41. 80 80
      js/JQuery.deploy.js
  42. 128 128
      js/JQuery.js
  43. 221 2
      js/Kernel-Tests.deploy.js
  44. 294 5
      js/Kernel-Tests.js
  45. 150 7
      js/Kernel.deploy.js
  46. 247 38
      js/Kernel.js
  47. 33 33
      js/SUnit.deploy.js
  48. 51 51
      js/SUnit.js
  49. 11 1
      js/jtalk.js
  50. 226 0
      server/FileServer.deploy.js
  51. 301 0
      server/FileServer.js
  52. 561 0
      server/FileServer.st
  53. 8 0
      server/Makefile
  54. 291 53
      server/server.js
  55. 89 48
      st/IDE.st
  56. 185 10
      st/Kernel-Tests.st
  57. 80 21
      st/Kernel.st
  58. 26 15
      st/Makefile
  59. 0 0
      st/TrySmalltalk.st

+ 3 - 18
bin/jtalkc

@@ -15,7 +15,7 @@ popd >/dev/null
 
 function usage {
 	cat <<ENDOFHELP
-Usage: $0 [-L level] [-l lib1,lib2...] [-i file] [-m class] [-M file]
+Usage: $0 [-l lib1,lib2...] [-i file] [-m class] [-M file]
           [-o] [-O|-A] [-d] [-s suffix] [-S suffix] [file1 [file2 ...]] [Program]
 
    Will compile Jtalk files - either separately or into a runnable complete
@@ -37,16 +37,6 @@ Usage: $0 [-L level] [-l lib1,lib2...] [-i file] [-m class] [-M file]
    a .js file. Otherwise a <Program>.js file is linked together based on
    the options:
 
-  -L level
-     Add libraries to a predefined level (default is KERNEL) of environment
-     where level is:
-
-        KERNEL    - a reasonable level for server side programs or libraries.
-        COMPILER  - if you need to compile, import or export Jtalk code.
-        CANVAS    - if you need HTML DOM manipulation, typical for client side.
-        JQUERY    - if you want JQuery stuff on top of Canvas.
-        IDE       - if you are extending the IDE with new tools etc.
-
   -l library1,library2
      Additionally add listed libraries (no spaces or .js) in listed order.
 
@@ -109,12 +99,8 @@ if [ -z $1 ] ; then
 fi
 
 # Define our predefined library combinations
-BOOT="boot"
-KERNEL="$BOOT Kernel"
+KERNEL="boot Kernel"
 COMPILER="$KERNEL parser Compiler"
-CANVAS="$KERNEL Canvas"
-JQUERY="$CANVAS JQuery"
-IDE="$JQUERY IDE SUnit Examples"
 
 # Predefined initializer
 INITIALIZER="$JTALK/js/init.js"
@@ -134,9 +120,8 @@ DEPLOY=false
 NODECOMPILE=nodecompile
 
 # Read options and shift them away
-while getopts "L:l:i:m:M:oOAds:S:h?" o; do
+while getopts "l:i:m:M:oOAds:S:h?" o; do
 case "$o" in
-   L) BASE=${!OPTARG};;  # If OPTARG is "KERNEL" this sets BASE to $KERNEL.
    l) LOAD=$OPTARG;;
    i) INIT=$OPTARG;;
    m) MAIN=$OPTARG;;

+ 2 - 0
bin/server

@@ -0,0 +1,2 @@
+#!/bin/bash
+node server/server.js

+ 209 - 162
css/jtalk.css

@@ -2,80 +2,132 @@ body.jtalkBody {
     margin-bottom: 350px;
 }
 
-#jtalkTabs {
-    position: fixed;
-    font-family: helvetica,arial,sans;
-    font-size: 12px;
-    line-height: 1;
-    z-index: 1001;
-    bottom: 0;
-    left: 0;
-    right: 0;
+#jtalkTabs, #jtalk .jt_tabs {
     margin: 0;
-    padding: 0 0 3px 0;
-    height: 20px;
-    background: transparent;
-}
-#jtalkTabs li {
-    list-style-type: none;
-    display: inline;
-    background: #c8c8c8;
+    padding: 0;
+    background: url("../images/sprite.png") #DBD9C9 0 -27px;
+    height: 22px;
+    width: 100%;
+    list-style: none;
     font-weight: bold;
-    color: #414141;
-    padding: 4px;
-    border: 1px solid #acacac;
+}
+
+#jtalkTabs li, #jtalk .jt_tabs li {
+    padding: 0 1px;
     cursor: pointer;
-    line-height: 14px;
-    margin: 0;
+    color: #565656;
 }
 
-#jtalkTabs li.selected {
-    background: #dbdbdb;
-    border-top: 0 none;
-    padding: 5px 4px;
-    color: #222;
+#jtalk .ltab, #jtalk .rtab, #jtalk .mtab {
+    height: 22px;
+    float: left;
 }
 
-#jtalkTabs li span.close {
-    margin-left: 3px;
-    margin-right: 5px;
+#jtalk .ltab, #jtalk .rtab {
+    width: 8px;
 }
 
-#jtalkTabs li span.close:hover {
-    color: #e72a2a;
+#jtalk .rtab {
+    margin-right: 1px;
 }
 
-#jtalkTabs li.closeAll {
-    -moz-border-radius: 10px;
-    -webkit-border-radius: 10px;
-    border-radius: 10px;
-    background: #ef3b3b;
-    color: #e3e3e3;
-    font-weight: bold;
-    border: 1px solid #ac1616;
-    margin: 4px;
-    padding: 2px 6px;
-    font-size: 10px;
+#jtalk .mtab {
+    line-height: 20px;
+}
+
+#jtalkTabs li:hover .ltab,
+#jtalk .jt_tabs li:hover .ltab {
+    background: url("../images/sprite.png") -16px -96px;
 }
 
-#jtalkTabs li.closeAll:hover {		
-    background: #e72a2a;
+#jtalkTabs li:hover .mtab,
+#jtalk .jt_tabs li:hover .mtab {
+    background: url("../images/sprite.png") 0 -73px;
+}
+
+#jtalkTabs li:hover .rtab,
+#jtalk .jt_tabs li:hover .rtab {
+    background: url("../images/sprite.png") -24px -96px;
+}
+
+#jtalkTabs li.selected,
+#jtalk .jt_tabs li.selected {
+    color: #111;
+}
+
+#jtalkTabs li.selected .ltab,
+#jtalk .jt_tabs li.selected .ltab {
+    background: url("../images/sprite.png") 0px -96px;
+}
+
+#jtalkTabs li.selected .mtab,
+#jtalk .jt_tabs li.selected .mtab {
+    background: url("../images/sprite.png") 0 -50px;
+}
+
+#jtalkTabs li.selected .rtab,
+#jtalk .jt_tabs li.selected .rtab {
+    background: url("../images/sprite.png") -8px -96px;
+}
+
+#jtalkTabs li .close {
+    margin-right: 5px;
+    color: #aaa;
 }
 
 #jtalk {
        position: fixed;
-       bottom: 27px;
+       bottom: 0;
        left: 0;
        right: 0;
        height: 330px;
        z-index: 1000;
 }
 
+#jtalk, #jtalk button, #jtalk input, #jtalk select {
+       font-family: Lucida Grande, Tahoma, sans-serif;
+       font-size: 11px;
+}
+
+#jtalk #logo {
+    position: absolute;
+    top: 3px;
+    left: 8px;
+    width: 22px;
+    height: 20px;
+    background: url("../images/tinylogo.png") top left no-repeat;
+}
+
+#jtalk #jt_toolbar {
+    height: 27px;
+    background: url("../images/sprite.png") 0 0;
+}
+
+#jtalk #jt_toolbar input {
+    margin-left: 50px;
+    width: 250px;
+}
+
+#jtalk #jt_toolbar #jt_close {
+    position: absolute;
+    right: 4px;
+    top: 6px;
+    width: 16px;
+    height: 16px;
+    background: url('../images/off.png');
+    cursor: pointer;
+}
+
+#jtalk #jt_toolbar #jt_close:hover {
+    background: url('../images/offHover.png');
+}
+
+
 #jtalk .ui-resizable-handle {
-    background-color: #a8a8a8;
+    background-color: transparent;
     top: 0;
     cursor: row-resize;
-    height: 4px;
+    height: 5px;
     left: 0;
     position: absolute;
     right: 0;
@@ -83,35 +135,35 @@ body.jtalkBody {
 }
 
 .jtalkTool {
-    width: 98%;
-    background: #dbdbdb;
-    border-style: solid;
-    border-width: 1px;
-    border-color: #a8a8a8;
-    color: @dark;
-    font-family: Arial, Helvetica, sans;
-    font-size: 12px;
-    line-height: 1.5em;
-    padding: 15px 1%;
+    width: 100%;
+    color: #333;
+    line-height: 1.3em;
+    padding: 0;
+    margin: 0;
     position: absolute;
     bottom: 0;
     left: 0;
-    top: 4px;
+    top: 49px;
     z-index: 1000;
+    background: white;
 }
 
 .jtalkTool .jt_box {
-    width: 98%;
+    width: 100%;
     margin: 0;
     position: absolute;
-    top: 15px;
-    bottom: 45px;
+    top: 0;
+    bottom: 27px;
 }
 
 .jtalkTool .jt_buttons {
     position: absolute;
-    width: 98%;
-    bottom: 15px;    
+    bottom: 0;
+    left: 0;
+    right: 0;
+    height: 27px;
+    line-height: 27px;
+    background: url("../images/sprite.png") 0 0 repeat;
 }
 
 .jtalkTool .jt_buttons .right {
@@ -122,36 +174,65 @@ body.jtalkBody {
     font-weight: bold;
 }
 
+
+.jtalkTool button {
+    border: 1px solid transparent;
+    background: transparent;
+    padding: 2px 4px;
+    margin-left: 4px;
+    cursor: pointer;
+}
+
+.jtalkTool button:hover {
+    border-top: 1px solid #fff;
+    border-left: 1px solid #fff;
+    border-right: 1px solid #bbb;
+    border-bottom: 1px solid #bbb;
+}
+
+.jtalkTool  button:active {
+    border-top: 1px solid #bbb;
+    border-left: 1px solid #bbb;
+    border-right: 1px solid #fff;
+    border-bottom: 1px solid #fff;
+    background: #ddd;
+}
+
+.jtalkTool select, #jtalk input {
+    border-top: 1px solid #bbb;
+    border-left: 1px solid #bbb;
+    border-right: 1px solid #fff;
+    border-bottom: 1px solid #fff;
+    background: #fff;
+    margin-top: 0;
+    margin-bottom: 0;
+    padding-top: 0;
+    padding-bottom: 0;
+}
+
 .jtalkTool li {
     margin: 0;
     padding: 0;
 }
     
-.jtalkTool .jt_buttons button,
-.jtalkTool .jt_buttons select {
-    font-size: 12px;
-}
-
 .jtalkTool .source {
     height: 100%;
 }
 
 .jtalkTool textarea,
 .jtalkTool input {
-    border: 1px solid;
-    border-color: #a8a8a8;
+    border: 0 none;
     font-family: Arial, Helvetica, sans;
-    line-height: 1.2em;
-    font-size: 13px;
+    line-height: 1.3em;
+    font-size: 12px;
     position: relative;
     padding: 0;
 }
 
 .jtalkTool .CodeMirror {
-    border: 1px solid;
-    border-color: #a8a8a8;
+    border: 0 none;
     font-family: Arial, Helvetica, sans;
-    font-size: 13px;
+    font-size: 12px;
     line-height: 1.3em;
     height: 100%;
     background: white;
@@ -177,42 +258,28 @@ body.jtalkBody {
 
 .jtalkTool .jt_commit {
     position: absolute;
-    top: 140px;
+    top: 129px;
     left: 0;
-    font-size: 12px;
+    z-index: 1;
 }
 
 .jtalkTool .jt_column {
-    width: 24%;
+    width: 25%;
     padding: 0;
     margin: 0;
     float: left;
-    border: 1px solid;
-    border-color: #a8a8a8;
+    outline: 1px solid #aaa;
+    border: 0 none;
     height: 130px;
-    overflow-y: scroll;
+    overflow-y: auto;
     background: #fff;
+    color: #111;
     position: absolute;
     top: 0;
 }
 
-.jtalkTool .jt_column.value {
-    left: 25.2%;
-    width: 74.8%;
-}
-
-.jtalkTool .jt_column.browser {
-    top: 30px;
-}
-
-.jtalkTool .jt_column.categories {
-    left: 0%;
-    height: 105px;
-}
-
 .jtalkTool .jt_column.classes {
-    height: 105px;
-    left: 25.2%
+    left: 25%
 }
 
 .jtalkTool .jt_column.classes ul {
@@ -225,18 +292,18 @@ body.jtalkBody {
 }
 
 .jtalkTool .jt_column.protocols {
-    left: 50.4%
+    left: 50%
 }
 
 .jtalkTool .jt_column.methods {
-    left: 75.6%
+    left: 75%
 }
 
 .jtalkTool .jt_column li {
     list-style-type: none;
     padding-left: 5px;
     cursor: pointer;
-    color: #333;
+    color: #111;
     font-weight: bold;
 }
 
@@ -250,46 +317,18 @@ body.jtalkBody {
     color: white;
 }
 
-.jtalkTool .jt_tabs {
-    top: 136px;
+#jtalk .jtalkTool .jt_tabs {
+    top: 130px;
     position: absolute;
-    left: 25.2%;
-    padding: 0;
-    margin: 0;
-}
-
-.jtalkTool .jt_tabs li {
-    color: #666;
-    font-weight: bold;
-    cursor: pointer;
-    list-style-type: none;
-    float: left;
-    padding: 2px 4px;
-    margin-right: 2px;
-    background: #ccc;
-    border: 1px solid #a8a8a8;
-    -moz-border-radius-bottomleft: 8px;
-    -moz-border-radius-bottomright: 8px;
-    -webkit-border-bottom-left-radius: 8px;
-    -webkit-border-bottom-right-radius: 8px;
-    border-bottom-left-radius: 8px;
-    border-bottom-right-radius: 8px;
-    height: 20px;
-    line-height: 18px;
 }
 
-.jtalkTool .jt_tabs li.selected,
-.jtalkTool .jt_tabs li.selected:hover {
-    background: white;
-    border: 1px solid #b3b3b3;
-    border-top: 1px solid white;
-    color: #222;
+#jtalk .jtalkTool .jt_tabs.jt_browser {
+    padding-left: 25%;
 }
 
-
 .jtalkTool .jt_sourceCode {
     position: absolute;
-    top: 175px;
+    top: 152px;
     bottom: 0;
     left: 0;
     right: 0;
@@ -303,39 +342,42 @@ body.jtalkBody {
 /* Debugger & inspector */
 
 .jtalkTool .jt_box .label {
-	width: 98%;
+	width: 100%;
 	font-weight: bold;
 	text-align: center;
 	position: absolute;
-	line-height: 1.2em;
+	line-height: 1.5em;
 	font-size: 16px;
 	color: red;
+	background: url("../images/sprite.png") top left repeat;
+	height: 27px;
 }
 
 .jtalkTool .jt_box .jt_column.debugger {
-    top: 175px;
+    top: 158px;
 }
 
 .jtalkTool .jt_box .jt_column.debugger.contexts {
-    top: 30px;
+    top: 27px;
     width: 100%;
 }
 
 .jtalkTool .jt_sourceCode.debugger {
     width: 60%;
+    top: 158px;
 }
 
 .jtalkTool .jt_box .jt_column.debugger.variables {
     width: 10%;
-    left: 61%;
+    left: 60%;
     bottom: 0;
     position: absolute;
     height: auto;
 }
 
 .jtalkTool .jt_box .jt_column.debugger.inspector {
-    width: 28%;
-    left: 72%;
+    width: 30%;
+    left: 70%;
     bottom: 0;
     position: absolute;
     height: auto;
@@ -343,12 +385,17 @@ body.jtalkBody {
 
 .jtalkTool .jt_button.debugger.inspect {
     position: absolute;
-    left: 61%;
+    left: 60%;
+}
+
+.jtalkTool .jt_column.value {
+    left: 25%;
+    width: 75%;
 }
 
 .jtalkTool .jt_buttons.inspector {
     position: absolute;
-    top: 140px;
+    top: 130px;
 }
 
 
@@ -361,18 +408,18 @@ body.jtalkBody {
 .jtalkTool .jt_box .jt_column.implementors,
 .jtalkTool .jt_box .jt_column.senders,
 .jtalkTool .jt_box .jt_column.referenced_classes {
-	top: 30px;
-	height: 100%;
-	bottom: 0px;
-	width: 33%;
+	top: 20px;
+	height: auto;
+	bottom: 0;
+	width: 33.333%;
 }
 
 .jtalkTool .jt_box .jt_column.senders {
-	left: 33.6%
+	left: 33.333%
 }
 
 .jtalkTool .jt_box .jt_column.referenced_classes {
-        left: 67.3%
+        left: 66.67%
 }
 
 .jtalkTool .jt_box .jt_column.implementors .column_label, 
@@ -416,10 +463,10 @@ body.jtalkBody {
 
 .jtalkTool .sunit.status {
 	position: absolute;
-	left: 50.4%;
-	width: 49%;
+	left: 50%;
+	width: 50%;
+	outline: 1px solid #aaa;
 	background: white;
-	border: 1px solid #a8a8a8;
 	height: 40px
 }
 
@@ -440,11 +487,11 @@ body.jtalkBody {
 
 .jtalkTool .progress_bar {
 	position: absolute;
-	left: 50.4%;
-	width: 49%;
-	top: 50px;
-	border: 1px solid #a8a8a8;
+	left: 50%;
+	width: 50%;
+	top: 40px;
 	background: white;
+	outline: 1px solid #aaa;
 	min-height: 20px
 }
 
@@ -453,17 +500,17 @@ body.jtalkBody {
 	min-height: 20px;
 }
 
-.jtalkTool .jt_column.sunit.methods {
-	left: 50.4%;
+.jtalkTool .jt_column.results.sunit {
+	left: 50%;
 	height: auto;
-        width: 49%;
-        top: 80px;
+        width: 50%;
+        top: 62px;
         bottom: 0;
 }
 
-.jtalkTool .jt_column.sunit.methods .errors {
+.jtalkTool .jt_column.sunit.results .errors {
     color: red;
 }
 
-.jtalkTool .jt_column.sunit.methods ul {padding: 0; margin: 0}
+/*.jtalkTool .jt_column.sunit.results ul {padding: 0; margin: 0}*/
 

+ 0 - 161
examples/nodejs/benchfib/Benchfib.js

@@ -1,161 +0,0 @@
-smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib');
-
-smalltalk.addMethod(
-'_main',
-smalltalk.method({
-selector: 'main',
-category: 'not yet classified',
-fn: function (){
-var self=this;
-var result=nil;
-result=smalltalk.send((0), "_tinyBenchmarks", []);
-smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(unescape("0%20tinyBenchmarks%20%3D%3E%20"), "__comma", [smalltalk.send(result, "_asString", [])])]);
-result=smalltalk.send((0), "_jstinyBenchmarks", []);
-smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(unescape("0%20jstinyBenchmarks%20%3D%3E%20"), "__comma", [smalltalk.send(result, "_asString", [])])]);
-return self;},
-source: unescape('main%0A%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%200%20tinyBenchmarks.%0A%09console%20log%3A%20%270%20tinyBenchmarks%20%3D%3E%20%27%20%2C%20result%20asString.%0A%09result%20%3A%3D%200%20jstinyBenchmarks.%0A%09console%20log%3A%20%270%20jstinyBenchmarks%20%3D%3E%20%27%20%2C%20result%20asString'),
-messageSends: ["tinyBenchmarks", "log:", unescape("%2C"), "asString", "jstinyBenchmarks"],
-referencedClasses: []
-}),
-smalltalk.Benchfib.klass);
-
-
-smalltalk.addMethod(
-'_benchFib',
-smalltalk.method({
-selector: 'benchFib',
-category: '*Benchfib',
-fn: function (){
-var self=this;
-return (($receiver = self < (2)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (1);})() : (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (1);}), (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
-return self;},
-source: unescape('benchFib%0A%09%22Handy%20send-heavy%20benchmark%22%0A%09%22%28result%20//%20seconds%20to%20run%29%20%3D%20approx%20calls%20per%20second%22%0A%09%22%20%7C%20r%20t%20%7C%0A%09%20%20t%20%3A%3D%20Time%20millisecondsToRun%3A%20%5Br%20%3A%3D%2026%20benchFib%5D.%0A%09%20%20%28r%20*%201000%29%20//%20t%22%0A%09%22138000%20on%20a%20Mac%208100/100%22%0A%09%5E%20self%20%3C%202%0A%09%09ifTrue%3A%20%5B1%5D%20%0A%09%09ifFalse%3A%20%5B%28self-1%29%20benchFib%20+%20%28self-2%29%20benchFib%20+%201%5D'),
-messageSends: ["ifTrue:ifFalse:", unescape("%3C"), unescape("+"), "benchFib", unescape("-")],
-referencedClasses: []
-}),
-smalltalk.Number);
-
-smalltalk.addMethod(
-'_benchmark',
-smalltalk.method({
-selector: 'benchmark',
-category: '*Benchfib',
-fn: function (){
-var self=this;
-var size=nil;
-var flags=nil;
-var prime=nil;
-var k=nil;
-var count=nil;
-size=(8190);
-smalltalk.send((1), "_to_do_", [self, (function(iter){count=(0);flags=smalltalk.send((smalltalk.Array || Array), "_new", []);smalltalk.send(size, "_timesRepeat_", [(function(){return smalltalk.send(flags, "_add_", [true]);})]);return smalltalk.send((1), "_to_do_", [size, (function(i){return (($receiver = smalltalk.send(flags, "_at_", [i])).klass === smalltalk.Boolean) ? ($receiver ? (function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);})]);})]);
-return count;
-return self;},
-source: unescape('benchmark%20%20%22Handy%20bytecode-heavy%20benchmark%22%0A%09%22%28500000%20//%20time%20to%20run%29%20%3D%20approx%20bytecodes%20per%20second%22%0A%09%225000000%20//%20%28Time%20millisecondsToRun%3A%20%5B10%20benchmark%5D%29%20*%201000%22%0A%09%223059000%20on%20a%20Mac%208100/100%22%0A%20%20%20%20%7C%20size%20flags%20prime%20k%20count%20%7C%0A%20%20%20%20size%20%3A%3D%208190.%0A%20%20%20%201%20to%3A%20self%20do%3A%0A%20%20%20%20%20%20%20%20%5B%3Aiter%20%7C%0A%20%20%20%20%20%20%20%20count%20%3A%3D%200.%0A%20%20%20%20%20%20%20%20flags%20%3A%3D%20Array%20new.%0A%20%20%20%20%20%20%20%20size%20timesRepeat%3A%20%5B%20flags%20add%3A%20true%5D.%0A%20%20%20%20%20%20%20%201%20to%3A%20size%20do%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%5B%3Ai%20%7C%20%28flags%20at%3A%20i%29%20ifTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bprime%20%3A%3D%20i+1.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20i%20+%20prime.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bk%20%3C%3D%20size%5D%20whileTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bflags%20at%3A%20k%20put%3A%20false.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20k%20+%20prime%5D.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20count%20%3A%3D%20count%20+%201%5D%5D%5D.%0A%20%20%20%20%5E%20count'),
-messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "at:", unescape("+"), "whileTrue:", unescape("%3C%3D"), "at:put:"],
-referencedClasses: [smalltalk.Array]
-}),
-smalltalk.Number);
-
-smalltalk.addMethod(
-'_tinyBenchmarks',
-smalltalk.method({
-selector: 'tinyBenchmarks',
-category: '*Benchfib',
-fn: function (){
-var self=this;
-var t1=nil;
-var t2=nil;
-var r=nil;
-var n1=nil;
-var n2=nil;
-n1=(1);
-(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_benchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
-n2=(28);
-(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_benchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
-return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
-return self;},
-source: unescape('tinyBenchmarks%0A%09%22Report%20the%20results%20of%20running%20the%20two%20tiny%20Squeak%20benchmarks.%0A%09ar%209/10/1999%3A%20Adjusted%20to%20run%20at%20least%201%20sec%20to%20get%20more%20stable%20results%22%0A%09%220%20tinyBenchmarks%22%0A%09%22On%20a%20292%20MHz%20G3%20Mac%3A%2022727272%20bytecodes/sec%3B%20984169%20sends/sec%22%0A%09%22On%20a%20400%20MHz%20PII/Win98%3A%20%2018028169%20bytecodes/sec%3B%201081272%20sends/sec%22%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20benchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2028.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20benchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23benchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),
-messageSends: ["whileTrue:", "millisecondsToRun:", "benchmark", unescape("%3C"), unescape("*"), "benchFib", unescape("+"), unescape("%2C"), "printString", unescape("/")],
-referencedClasses: [smalltalk.Date]
-}),
-smalltalk.Number);
-
-smalltalk.addMethod(
-'_jsbenchFib',
-smalltalk.method({
-selector: 'jsbenchFib',
-category: '*Benchfib',
-fn: function (){
-var self=this;
-if (this < 2) {
-return 1;
-} else {
-return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;};
-return self;},
-source: unescape('jsbenchFib%0A%20%0A%09%3Cif%20%28this%20%3C%202%29%20%7B%0Areturn%201%3B%0A%7D%20else%20%7B%0Areturn%20%28this-1%29._jsbenchFib%28%29%20+%20%28this-2%29._jsbenchFib%28%29%20+%201%3B%7D%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Number);
-
-smalltalk.addMethod(
-'_jsbenchmark',
-smalltalk.method({
-selector: 'jsbenchmark',
-category: '*Benchfib',
-fn: function (){
-var self=this;
-
-var size = 8190;
-var count;
-for (var z=0;z<this;z++) {
-  count = 0;
-  var flags = new Array();
-  for (var p=0; p<size; p++) {
-    flags[p] = true;
-  }
-  for (var i=1;i<=size;i++) {
-    if (flags[i-1]) {
-      var prime = i+1;
-      var k = i + prime;
-      while (k <= size) {
-        flags[k-1] = false;
-        k = k + prime;
-      }
-      count = count + 1;
-    }
-  }
-}
-return count;
-return self;},
-source: unescape('jsbenchmark%0A%0A%3C%0Avar%20size%20%3D%208190%3B%0Avar%20count%3B%0Afor%20%28var%20z%3D0%3Bz%3Cthis%3Bz++%29%20%7B%0A%20%20count%20%3D%200%3B%0A%20%20var%20flags%20%3D%20new%20Array%28%29%3B%0A%20%20for%20%28var%20p%3D0%3B%20p%3Csize%3B%20p++%29%20%7B%0A%20%20%20%20flags%5Bp%5D%20%3D%20true%3B%0A%20%20%7D%0A%20%20for%20%28var%20i%3D1%3Bi%3C%3Dsize%3Bi++%29%20%7B%0A%20%20%20%20if%20%28flags%5Bi-1%5D%29%20%7B%0A%20%20%20%20%20%20var%20prime%20%3D%20i+1%3B%0A%20%20%20%20%20%20var%20k%20%3D%20i%20+%20prime%3B%0A%20%20%20%20%20%20while%20%28k%20%3C%3D%20size%29%20%7B%0A%20%20%20%20%20%20%20%20flags%5Bk-1%5D%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20k%20%3D%20k%20+%20prime%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20count%20%3D%20count%20+%201%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0Areturn%20count%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Number);
-
-smalltalk.addMethod(
-'_jstinyBenchmarks',
-smalltalk.method({
-selector: 'jstinyBenchmarks',
-category: '*Benchfib',
-fn: function (){
-var self=this;
-var t1=nil;
-var t2=nil;
-var r=nil;
-var n1=nil;
-var n2=nil;
-n1=(1);
-(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_jsbenchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
-n2=(28);
-(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_jsbenchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
-return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
-return self;},
-source: unescape('jstinyBenchmarks%0A%09%220%20jstinyBenchmarks%22%0A%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20jsbenchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2028.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20jsbenchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23jsbenchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),
-messageSends: ["whileTrue:", "millisecondsToRun:", "jsbenchmark", unescape("%3C"), unescape("*"), "jsbenchFib", unescape("+"), unescape("%2C"), "printString", unescape("/")],
-referencedClasses: [smalltalk.Date]
-}),
-smalltalk.Number);
-

File diff suppressed because it is too large
+ 0 - 6409
examples/nodejs/benchfib/Program.js


File diff suppressed because it is too large
+ 0 - 232
examples/nodejs/pystone/Pystone.js


BIN
examples/presentation/esug2011/images/asterix.png


BIN
examples/presentation/esug2011/images/background_box.png


BIN
examples/presentation/esug2011/images/background_header.png


BIN
examples/presentation/esug2011/images/balloon.jpg


BIN
examples/presentation/esug2011/images/balloon_header.png


BIN
examples/presentation/esug2011/images/devices.jpg


BIN
examples/presentation/esug2011/images/enyo.png


BIN
examples/presentation/esug2011/images/ide_star_wars.png


BIN
examples/presentation/esug2011/images/nodejs.png


BIN
examples/presentation/esug2011/images/terminal.png


BIN
examples/presentation/esug2011/images/webos.png


+ 17 - 0
examples/presentation/index.html

@@ -0,0 +1,17 @@
+<html>
+<head>
+<title>JTalk - Presentation</title>
+<script src="../../js/jtalk.js" type="text/javascript"></script>
+</head>
+<body>
+
+<script type="text/javascript"> 
+	loadJtalk({
+		files: ['Presentation.js'],
+		prefix: 'examples/presentation/js',
+		ready: function() {smalltalk.Browser._openOn_(smalltalk.ESUG2011Presentation)} 
+	}); 
+</script>
+
+</body>
+</html>

File diff suppressed because it is too large
+ 520 - 0
examples/presentation/js/Presentation.deploy.js


File diff suppressed because it is too large
+ 741 - 0
examples/presentation/js/Presentation.js


+ 1155 - 0
examples/presentation/st/Presentation.st

@@ -0,0 +1,1155 @@
+Widget subclass: #Slide
+	instanceVariableNames: 'presentation'
+	category: 'Presentation'!
+
+!Slide methodsFor: 'accessing'!
+
+presentation
+	^presentation
+!
+
+presentation: aPresentation
+	presentation := aPresentation
+!
+
+id
+	self subclassResponsibility
+!
+
+cssClass
+	^'slide'
+!
+
+backgroundColor
+	^'#555'
+! !
+
+!Slide methodsFor: 'actions'!
+
+show
+	document location hash: self id.
+	self backgroundColor ifNotNil: [
+		(window jQuery: '#slides') animate: (Dictionary with: 'backgroundColor' -> self backgroundColor) duration: 500].
+	(window jQuery: '.slide') hide: self presentation slideTransition options: #() duration: 300.
+	(window jQuery: '#', self id) show: self presentation slideTransition options: #() duration: 300.
+! !
+
+!Slide methodsFor: 'rendering'!
+
+renderOn: html
+	html div class: self cssClass; id: self id; with: [
+		self renderSlideOn: html.
+		self renderMetaOn: html]
+!
+
+renderSlideOn: html
+!
+
+renderMetaOn: html
+	html div 
+		id: 'meta';
+		with: [
+			html p class: 'title'; with: self presentation title.
+			html p class: 'description'; with: self presentation description.
+			html a class: 'author'; with: self presentation author; href: 'mailto:', self presentation email.
+			html a class: 'url'; with: self presentation url; href: self presentation url]
+! !
+
+!Slide class methodsFor: 'instance creation'!
+
+on: aPresentation
+	^self new
+		presentation: aPresentation;
+		yourself
+! !
+
+Widget subclass: #Presentation
+	instanceVariableNames: 'currentSlide slides'
+	category: 'Presentation'!
+
+!Presentation methodsFor: 'accessing'!
+
+title
+	^'Slides'
+!
+
+author
+	^'John Smith'
+!
+
+url
+	^'http://jtalk-project.org'
+!
+
+description
+	^'A presentation written in Jtalk'
+!
+
+email
+	^'john@smith.com'
+!
+
+slides
+	slides ifNil: [self initSlides].
+	^slides
+!
+
+slideClasses
+	^self subclassResponsibility
+!
+
+currentSlide
+	^currentSlide
+!
+
+currentSlide: aSlide
+	currentSlide := aSlide
+!
+
+slideTransition
+	^'fade'
+!
+
+style
+	"Should return a CSS style"
+	^ ''
+! !
+
+!Presentation methodsFor: 'actions'!
+
+reload
+	'#slides' asJQuery remove.
+	'#tools' asJQuery remove.
+	'body' asJQuery append: self.
+	self checkHash
+!
+
+setup
+	Presentation setCurrent: self.
+	JQuery documentReady: [
+		'body' asJQuery append: self.
+		self 
+			setKeybindings;
+			checkHashChange;
+			checkHash].
+!
+
+nextSlide
+	| next |
+	self currentSlide ifNotNil: [
+		next := self slides 
+			at: (self slides indexOf: self currentSlide) + 1
+			ifAbsent: [nil].
+		next ifNotNil: [currentSlide := next. next show]]
+!
+
+showCurrentSlide
+	self currentSlide ifNotNil: [
+		'.slide' asJQuery hide.
+		('#', self currentSlide id) asJQuery show]
+!
+
+previousSlide
+	| next |
+	self currentSlide ifNotNil: [
+		next := self slides 
+			at: (self slides indexOf: self currentSlide) - 1
+			ifAbsent: [nil].
+		next ifNotNil: [currentSlide := next. next show]]
+!
+
+setKeybindings
+	JQuery document on: 'keyup' do: [:e || node |
+		node := e target nodeName asLowercase.
+		(node = 'textarea' or: [node = 'input']) ifFalse: [
+			e keyCode = 39 ifTrue: [self nextSlide].
+			e keyCode = 37 ifTrue: [self previousSlide]]]
+!
+
+checkHashChange
+	JQuery window on: 'hashchange' do: [self checkHash]
+!
+
+checkHash
+	| hash slide |
+	hash := document location hash  replace: '^#' with: ''.
+	slide := self slides detect:  [:each | each id = hash] ifNone: [nil].
+	slide ifNotNil: [
+		self currentSlide = slide ifFalse: [
+			self currentSlide: slide.
+			slide show]]
+! !
+
+!Presentation methodsFor: 'initialization'!
+
+initSlides
+	slides := self slideClasses collect: [:each | each on: self]
+! !
+
+!Presentation methodsFor: 'rendering'!
+
+renderOn: html
+	html style
+		type: 'text/css';
+		with: self style.
+	html div 
+		id: 'tools';
+		with: [self renderToolsOn: html].
+	html div 
+		id: 'slides';
+		with: [self renderSlidesOn: html]
+!
+
+renderSlidesOn: html
+	self slides do: [:each | 
+		each renderOn: html].
+	currentSlide ifNil: [currentSlide := self slides first].
+	self showCurrentSlide
+!
+
+renderToolsOn: html
+	html a 
+		with: 'IDE';
+		onClick: [TabManager current open].
+	html a
+		with: 'Reload';
+		onClick: [self reload].
+	html a
+		with: '←';
+		onClick: [self previousSlide].
+	html a
+		with: '→';
+		onClick: [self nextSlide]
+! !
+
+Presentation class instanceVariableNames: 'current'!
+
+!Presentation class methodsFor: 'initialization'!
+
+initialize
+	self isConcrete ifTrue: [self setup]
+!
+
+setup
+	self new setup
+!
+
+setCurrent: aSlides
+	current := aSlides
+!
+
+current
+	^current
+! !
+
+!Presentation class methodsFor: 'testing'!
+
+isConcrete
+	^false
+! !
+
+Presentation subclass: #ESUG2011Presentation
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!ESUG2011Presentation methodsFor: 'accessing'!
+
+title
+	^'Jtalk'
+!
+
+description
+	^'ESUG 2011, Edinburgh'
+!
+
+author
+	^'Nicolas Petton'
+!
+
+email
+	^'nico@objectfusion.fr'
+!
+
+url
+	^'http://jtalk-project.org'
+!
+
+slideClasses
+	^Array new
+		add: IntroSlide;
+		add: AboutSlide;
+		add: WhatIsJtalkSlide;
+		add: JtalkFeaturesSlide;
+		add: WorkspaceSlide;
+		add: IDESlide;
+		add: CountersSlide;
+		add: JtalkAndJavascriptSlide;
+		add: JtalkAndJavascriptSlide2;
+		add: JtalkAndJavascriptSlide3;
+		add: JtalkAndJavascriptSlide4;
+		add: JtalkAndCLI;
+		add: JtalkAndNode;
+		add: JtalkAndNode2;
+		add: JtalkAndNode3;
+		add: JtalkAndWebOS;
+		add: JtalkAndEnyo;
+		add: ContributionsSlide;
+		yourself
+!
+
+style
+	^'
+body {
+    font-family: Helvetica,Arial,sans;
+}
+
+#slides {
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    background: #555;
+}
+
+.slide {
+    background: #fff;
+    color: #444;
+    text-align: left;
+    font-size: 20px;
+    line-height: 1.8em;
+    height: 500px;
+    width: 700px;
+    padding: 60px;
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    margin-left: -420px;
+    margin-top: -320px;
+    box-shadow: 0 0 20px #111;
+    -moz-box-shadow: 0 0 20px #111;
+    -webkit-box-shadow: 0 0 20px #111;
+}
+
+.slide.transparent {
+    background: transparent;
+    box-shadow: 0 0 0 none;
+    -moz-box-shadow: 0 0 0 transparent;
+    -webkit-box-shadow: 0 0 0 transparent;
+    color: #fff !!important;
+}
+
+.slide.black {
+    background: black;
+    background-image: -webkit-gradient(
+	linear,
+	left bottom,
+	left top,
+	color-stop(0.38, rgb(79,79,79)),
+	color-stop(0.69, rgb(33,33,33)),
+	color-stop(0.86, rgb(4,4,4))
+    );
+    background-image: -moz-linear-gradient(
+	center bottom,
+	rgb(79,79,79) 38%,
+	rgb(33,33,33) 69%,
+	rgb(4,4,4) 86%
+    );
+    color: #fff !!important;
+}
+
+.slide.black h1, .slide.black h2, .slide.black h3,
+.slide.transparent h1, .slide.transparent h2, .slide.transparent h3 {
+    color: #fff;
+    text-shadow: 0 1px 4px #aaa;
+}
+
+.slide.black a, .slide.transparent a {
+    color: #ccc;
+}
+
+.slide.white {
+    color: #333 !!important;
+}
+
+.slide.white h1, .slide.white h2, .slide.white h3 {
+    color: #333;
+}
+
+.slide.white a {
+    color: #333;
+}
+
+
+.slide h1, .slide h2, .slide h3 {
+    color: #333;
+    /* text-align: center; */
+}
+
+.slide h1 {
+    font-family: "Droid Sans";
+    font-size: 36px;
+    text-shadow: 0 1px 4px #aaa;
+    margin-top: 30px;
+    margin-bottom: 50px;
+}
+
+/* .slide ul, .slide li { */
+/*     padding: 0; */
+/*     margin: 0; */
+/* } */
+
+.slide button {
+    font-size: 18px;
+}
+
+.slide a {
+    color: #555;
+    text-decoration: none;
+    cursor: pointer;
+}
+
+.slide a:hover {
+    color: #fff;
+    background: #555;
+}
+
+.slide .right {
+    text-align: right;
+}
+
+.slide .section.center {
+    text-align: center;
+    display: table-cell;
+    vertical-align: middle;
+    width: 700px;
+    height: 500px;
+}
+
+.slide code {
+    font-family: "Droid Sans Mono";
+    color: #444;
+    border: 1px solid #ddd;
+    background: #eee;
+    border-radius: 4px;
+    padding: 2px;
+    font-size: 16px;
+}
+
+.slide .code2 {
+    font-family: "Droid Sans Mono";
+    line-height: 1.2em;
+    color: #444;
+    padding: 2px;
+    font-size: 16px;
+}
+
+
+.slide .CodeMirror {
+    width: 500px;
+    height: 300px;
+    text-align: left;
+}
+
+.slide .CodeMirror-scroll {
+    text-align: left;
+}
+
+.slide .fancy {
+    margin-top: 30px;
+    -webkit-transform: rotate(-10deg);
+    -moz-transform: rotate(-10deg);
+    transform: rotate(-10deg);
+    color: red;
+}
+
+.slide .comment {
+    opacity: 0.6;
+    font-weight: normal;
+}
+
+.slide .red {
+    color: red;
+}
+
+.slide .blue {
+    color: blue;
+}
+
+.slide#WhatIsJtalk {
+    background: white url("esug2011/images/balloon.jpg") 650px 50px no-repeat;
+}
+
+.slide#ide {
+    background: black url("esug2011/images/ide_star_wars.png") center center no-repeat;
+}
+
+.slide#JtalkAndCLI {
+    background: white url("esug2011/images/terminal.png") 620px 20px no-repeat;
+}
+
+.slide#JtalkAndNode {
+    background: white url("esug2011/images/nodejs.png") 580px 40px no-repeat;
+}
+.slide#JtalkAndNode2 {
+    background: white url("esug2011/images/nodejs.png") 580px 40px no-repeat;
+}
+
+.slide#JtalkAndNode3 {
+    background: white url("esug2011/images/nodejs.png") 580px 40px no-repeat;
+}
+
+.slide#JtalkAndWebOS {
+    background: white url("esug2011/images/devices.jpg") 380px 280px no-repeat;
+}
+
+.slide#JtalkAndEnyo {
+    background: white url("esug2011/images/enyo.png") 130px 150px no-repeat;
+}
+
+.slide#links {
+    background: white url("esug2011/images/asterix.png") 30px 130px no-repeat;
+}
+
+.slide#links .section {
+    margin-left: 250px;
+    margin-top: 200px;
+    font-family: "Droid Sans";
+    font-size: 26px;
+    font-weight: bold;
+}
+
+
+#meta {
+    position: absolute;
+    font-size: 12px;
+    opacity: 0.6;
+    bottom: 0;
+    right: 0;
+    z-index: 2;
+    background: #333;
+    text-align: right;
+    padding: 0 10px;
+    line-height: 1.8em;
+    color: #eee;
+    border-top-left-radius: 5px;
+}
+
+#meta:hover {
+    opacity: 0.8;
+}
+
+#meta p {
+    display: inline;
+    padding: 0 5px;
+}
+
+#meta a {
+    //background: #ccc;
+    color: #ccc;
+    text-decoration: none;
+    padding: 0 5px;
+}
+
+#tools {
+    z-index: 1;
+    position: fixed;
+    top: 0;
+    left: 50%;
+    margin-left: -150px;
+    width: 300px;
+    padding: 5px;
+    border-radius: 5px;
+    -moz-border-radius: 5px;
+    -webkit-border-radius: 5px;
+    background: #333;
+    opacity: 0.3;
+    color: #eee;
+}
+
+#tools a {
+    font-weight: bold;
+    color: #eee;
+    text-decoration: none;
+    cursor: pointer;
+    padding: 0 2px;
+    font-size: 14px;
+}
+
+#tools:hover {
+    opacity: 0.8;
+}
+
+.slide {
+    
+}
+'
+! !
+
+ESUG2011Presentation class instanceVariableNames: 'current'!
+
+!ESUG2011Presentation class methodsFor: 'testing'!
+
+isConcrete
+	^true
+! !
+
+Slide subclass: #IntroSlide
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!IntroSlide methodsFor: 'accessing'!
+
+id
+	^'intro'
+!
+
+cssClass
+	^'slide black'
+! !
+
+!IntroSlide methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html div class: 'section center'; with: [
+		html h1 with: 'Jtalk, the Smalltalk for Web developers'.
+		html p with: self presentation author, ' & Göran Krampe - ', self presentation description.
+		html p with: [
+			html a
+				with: self presentation email;
+				href: 'mailto:', self presentation email].
+		html p with: [
+			html a
+				with: 'goran@krampe.se';
+				href: 'mailto:goran@krampe.se'].
+		
+          	html p with: [
+			html a
+				with: 'objectfusion.fr';
+				href: 'http://www.objectfusion.fr']]
+! !
+
+Slide subclass: #WhatIsJtalkSlide
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!WhatIsJtalkSlide methodsFor: 'accessing'!
+
+id
+	^'WhatIsJtalk'
+! !
+
+!WhatIsJtalkSlide methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html div class: 'section center'; with: [
+		html h1 with: 'Jtalk in a nutshell'.
+		html h2 with: 'Jtalk is an implementation of Smalltalk'.
+		html h2 with: 'Jtalk runs on top of the JavaScript runtime'.
+		html h2 with: 'Jtalk is an opensource project (MIT)'.
+		html h2 class: 'fancy'; with: 'Jtalk is cool!!']
+! !
+
+Slide subclass: #JtalkFeaturesSlide
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkFeaturesSlide methodsFor: 'accessing'!
+
+id
+	^'features'
+! !
+
+!JtalkFeaturesSlide methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html h1 with: 'Jtalk features'.
+	html ul with: [
+		html li with: 'Jtalk is (mostly) written in itself, including the parser & compiler'.
+		html li with: 'Full Smalltalk object system, including classes & metaclasses, etc'.
+		html li with: 'Core libraries (streams, collections, RegExp, etc)'.
+		html li with: 'Web related libraries: HTML Canvas, DOM manipulation'.
+		html li with: 'Full featured IDE'.
+		html li with: [
+			html with:'Advanced Smalltalk features, including '.
+			html code with: '#doesNotUnderstand:'.
+			html with: ' support and '.
+			html code with: 'thisContext']]
+! !
+
+Slide subclass: #AboutSlide
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!AboutSlide methodsFor: 'accessing'!
+
+id
+	^'about'
+!
+
+cssClass
+	^'slide transparent white'
+!
+
+backgroundColor
+	^'white'
+! !
+
+!AboutSlide methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html div class: 'section center'; with: [
+		html h1 with: 'About this presentation'.
+		html p with: 'This presentation is entirely written in Jtalk and is licensed under CC BY-SA.'.
+		html p with: [
+			html with: 'Press '.
+			html code with: '←'.
+			html with: ' to move backward and '.
+			html code with: ' →'.
+			html with: ' to move forward.'].
+		html p with: [
+			html with: 'Open a '.
+			html button 
+				with: 'browser';
+				onClick: [Browser openOn: Presentation].
+			html with: ' to edit the source code.']]
+! !
+
+Slide subclass: #JtalkAndJavascriptSlide3
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndJavascriptSlide3 methodsFor: 'accessing'!
+
+id
+	^'jtalkAndJs3'
+!
+
+backgroundColor
+	^'#08C'
+! !
+
+!JtalkAndJavascriptSlide3 methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html h1 with: [
+		html with: 'Smalltalk '.
+		html span class: 'red'; with: '♥'.
+		html with: ' JavaScript'].
+	html h2 with: 'Smalltalk ⇒ JavaScript'.
+	html ol with: [
+		html li 
+			with: 'Unary messages begin with an underscore: ';
+			with: [html code with: 'yourself'];
+			with: ' becomes ';
+			with: [html code with: '_yourself()'].
+		html li 
+			with: 'Binary messages are prefixed with 2 underscores: ';
+			with: [html code with: '3@4'];
+			with: ' becomes ';
+			with: [html code with: '(3).__at(4)'].
+		html li 
+			with: 'Keyword message follow the same rules as unary messages, with a final underscore: ';
+			with: [html code with: 'aDictionary at: 3 put: 4'];
+			with: ' becomes ';
+			with: [html code with: 'aDictionary._at_put_(3, 4)']]
+! !
+
+Slide subclass: #JtalkAndJavascriptSlide2
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndJavascriptSlide2 methodsFor: 'accessing'!
+
+id
+	^'jtalkAndJs2'
+!
+
+backgroundColor
+	^'#08C'
+! !
+
+!JtalkAndJavascriptSlide2 methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html h1 with: [
+		html with: 'Smalltalk '.
+		html span class: 'red'; with: '♥'.
+		html with: ' JavaScript'].
+	html h2 with: 'Jtalk maps one to one with the JavaScript equivalent:'.
+	html ul with: [
+		html li with: 'String ⇔ String'.
+		html li with: 'Number ⇔ Number'.
+		html li with: 'BlockClosure ⇔ function'.
+		html li with: 'Dictionary ⇔ Object'.
+		html li with: 'Error ⇔ Error'.
+		html li with: 'etc.']
+! !
+
+Slide subclass: #JtalkAndJavascriptSlide
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndJavascriptSlide methodsFor: 'accessing'!
+
+id
+	^'jtalkAndJs'
+!
+
+cssClass
+	^'slide transparent'
+!
+
+backgroundColor
+	^'#08C'
+! !
+
+!JtalkAndJavascriptSlide methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html div class: 'section center'; with: [
+		html h1 with: [
+			html with: 'Smalltalk '.
+			html span class: 'red'; with: '♥'.
+			html with: ' JavaScript']]
+! !
+
+Slide subclass: #WorkspaceSlide
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!WorkspaceSlide methodsFor: 'accessing'!
+
+id
+	^'workspace'
+!
+
+backgroundColor
+	^'#18bd7d'
+!
+
+renderSlideOn: html
+	| workspace |
+	workspace := SourceArea new.
+	html div class: 'section center'; with: [
+		html h1 with: 'Give Jtalk a try!!'.
+		workspace renderOn: html.
+		html div with: [
+			html button
+				with: 'DoIt';
+				onClick: [workspace doIt].
+			html button
+				with: 'PrintIt';
+				onClick: [workspace printIt].
+			html button
+				with: 'InspectIt';
+				onClick: [workspace inspectIt]]]
+! !
+
+Slide subclass: #CountersSlide
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!CountersSlide methodsFor: 'accessing'!
+
+id
+	^'counters'
+!
+
+backgroundColor
+	^'#18bd7d'
+! !
+
+!CountersSlide methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html div class: 'section center'; with: [
+		html h1 with: 'The counter example'.
+		html div with: [
+			2 timesRepeat: [Counter new renderOn: html]]]
+! !
+
+Slide subclass: #JtalkAndJavascriptSlide4
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndJavascriptSlide4 methodsFor: 'accessing'!
+
+id
+	^'jtalkAndJs4'
+!
+
+backgroundColor
+	^'#08C'
+! !
+
+!JtalkAndJavascriptSlide4 methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html h1 with: [
+		html with: 'JavaScript '.
+		html span class: 'red'; with: '♥'.
+		html with: ' Smalltalk too!! ';
+		with: [html span class: 'comment'; with: '(how cute)']].
+	html h2 with: 'JavaScript ⇒ Smalltalk'.
+	html ol with: [
+		html li 
+			with: [html code with: 'someUser.name'];
+			with: ' becomes ';
+			with: [html code with: 'someUser name'].
+		html li 
+			with: [html code with: 'someUser name = "John"'];
+			with: ' becomes ';
+			with: [html code with: 'someUser name: ''John'''].
+		html li 
+			with: [html code with: 'console.log(''hello world'')'];
+			with: ' becomes ';
+			with: [html code with: 'console log: ''hello world'''].
+		html li 
+			with: [html code with: 'window.jQuery(''foo'').css(''background'', ''red'')'];
+			with: ' becomes ';
+			with: [html br];
+			with: [html code with: '(window jQuery: ''foo'') css: ''background'' color: ''red''']]
+! !
+
+Slide subclass: #IDESlide
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!IDESlide methodsFor: 'accessing'!
+
+id
+	^'ide'
+!
+
+backgroundColor
+	^'black'
+!
+
+cssClass
+	^'slide transparent'
+! !
+
+!IDESlide methodsFor: 'rendering'!
+
+renderSlideOn: html
+"	html div class: 'section center'; with: [
+		html h1 
+			with: 'The wonderful Jtalk ';
+			with: [
+				html a 
+					with: 'development tools';
+					onClick: [TabManager current open]];
+			with: '.']
+"
+! !
+
+Slide subclass: #ContributionsSlide
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!ContributionsSlide methodsFor: 'accessing'!
+
+id
+	^'links'
+! !
+
+!ContributionsSlide methodsFor: 'rendering'!
+
+renderSlideOn: html
+	html div class: 'section'; with: [
+		html p with: [
+			html a href: 'http://jtalk-project.org'; with: 'jtalk-project.org'].
+		html p with: [
+			html a href: 'https://github.com/NicolasPetton/jtalk'; with: 'github.com/NicolasPetton/jtalk'].
+		html p with: [
+			html a href: 'http://http://groups.google.com/group/jtalk-project'; with: 'groups.google.com/group/jtalk-project']]
+! !
+
+Slide subclass: #JtalkAndCLI
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndCLI methodsFor: 'not yet classified'!
+
+backgroundColor
+	^'#0A1'
+!
+
+id
+	^'JtalkAndCLI'
+!
+
+renderSlideOn: html
+	html h1 with: [
+		html with: 'Jtalk and '.
+		html span class: 'blue'; with: 'the command line'].
+
+	html h2 with: 'jtalkc - a fairly elaborate bash script that:'.
+
+	html ul with: [
+		html li with: 'Uses Node.js to run the Jtalk Compiler'.
+		html li with: 'Compiles .st files to .js'.
+		html li with: 'Links .js files into a single one'.
+		html li with: 'Adds class initilization and/or call to main'.
+		html li with: 'Optionally runs Google Closure compiler']
+! !
+
+Slide subclass: #JtalkAndNode
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndNode methodsFor: 'not yet classified'!
+
+backgroundColor
+	^'#0A1'
+!
+
+id
+	^'JtalkAndNode'
+!
+
+renderSlideOn: html
+	html h1 with: [
+		html with: 'Jtalk and '.
+		html span class: 'blue'; with: 'Node.js'].
+
+	html h2 with: 'Hello.st:'.
+	html pre with: [
+		html div class: 'code2'; with:  'Object subclass: #Hello
+        instanceVariableNames: ''''
+        category: ''Hello''!!
+
+!!Hello class methodsFor: ''main''!!
+main
+	console log: ''Hello world from JTalk in Node.js''
+!! !!']
+! !
+
+Slide subclass: #JtalkAndNode2
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndNode2 methodsFor: 'not yet classified'!
+
+backgroundColor
+	^'#0A1'
+!
+
+id
+	^'JtalkAndNode2'
+!
+
+renderSlideOn: html
+	html h1 with: [
+		html with: 'Jtalk and '.
+		html span class: 'blue'; with: 'Node.js'].
+
+	html h2 with: 'Makefile:'.
+	html pre with: [
+		html div class: 'code2'; with:  'Program.js: Hello.st
+	../../bin/jtalkc -N -m Hello Hello.st Program
+
+run: Program.js
+	./hello
+
+clean:
+	rm -f Program.js Hello.js
+'].
+html h2 with: 'hello:'.
+	html pre with: [
+		html div class: 'code2'; with:  'node Program.js $@']
+! !
+
+Slide subclass: #JtalkAndNode3
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndNode3 methodsFor: 'not yet classified'!
+
+backgroundColor
+	^'#0A1'
+!
+
+id
+	^'JtalkAndNode3'
+!
+
+renderSlideOn: html
+	html h1 with: [
+		html with: 'Jtalk and '.
+		html span class: 'blue'; with: 'Node.js'].
+
+	html h2 with: 'make clean && make run:'.
+
+	html pre with: [
+		html div class: 'code2'; with:  'rm -f Program.js Hello.js
+../../bin/jtalkc -N -m Hello Hello.st Program
+Loading libraries  /home/gokr/jtalk/js/boot.js /home/gokr/jtalk/js/Kernel.js
+/home/gokr/jtalk/js/Parser.js /home/gokr/jtalk/js/Compiler.js
+/home/gokr/jtalk/js/init.js /home/gokr/jtalk/nodejs/nodecompile.js
+and compiling ...
+Compiling in debugMode: false
+Reading file Hello.st
+Exporting category Hello as Hello.js
+Adding libraries  /home/gokr/jtalk/js/boot.js /home/gokr/jtalk/js/Kernel.js  ...
+Adding Jtalk code Hello.js ...
+Adding initializer /home/gokr/jtalk/js/init.js ...
+Adding call to Hello class >> main ...
+Writing Program.js ...
+Done.
+./hello'.
+html span class: 'blue'; with:'Hello world from JTalk in Node.js']
+! !
+
+Slide subclass: #JtalkAndWebOS
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndWebOS methodsFor: 'not yet classified'!
+
+backgroundColor
+	^'#0A1'
+!
+
+id
+	^'JtalkAndWebOS'
+!
+
+renderSlideOn: html
+	html h1 with: [
+		html with: 'Jtalk and '.
+		html span class: 'blue'; with: 'webOS'].
+
+	html h2 with: 'A really cool mobile OS based on Linux:'.
+
+	html ul with: [
+		html li with: 'The primary language in webOS is Javascript'.
+		html li with: 'The new UI framework for webOS 3.0 is called Enyo'.
+		html li with: 'Regular apps run in V8 + Webkit'.
+		html li with: 'Background services run in Node.js']
+! !
+
+Slide subclass: #JtalkAndEnyo
+	instanceVariableNames: ''
+	category: 'Presentation'!
+
+!JtalkAndEnyo methodsFor: 'not yet classified'!
+
+id
+	^'JtalkAndEnyo'
+!
+
+backgroundColor
+	^'#0A1'
+!
+
+renderSlideOn: html
+	html h1 with: [
+		html with: 'Jtalk and '.
+		html span class: 'blue'; with: 'Enyo'].
+! !
+

+ 18 - 0
examples/trysmalltalk/index.html

@@ -0,0 +1,18 @@
+<html>
+<head>
+<title>TrySmalltalk</title>
+<script src="../../js/jtalk.js" type="text/javascript"></script>
+</head>
+<body>
+<script type="text/javascript"> 
+	loadJtalk({
+		files: ['TrySmalltalk.js'],
+		prefix: 'examples/trysmalltalk/js',
+		ready: function() {
+			smalltalk.Browser._openOn_(smalltalk.ProfStef)
+			smalltalk.TrySmalltalkWidget._open();
+		}}); 
+</script>
+
+</body>
+</html>

+ 121 - 110
examples/trysmalltalk/TrySmalltalk.deploy.js → examples/trysmalltalk/js/TrySmalltalk.deploy.js

@@ -1,16 +1,4 @@
 smalltalk.addClass('TrySmalltalkWidget', smalltalk.Widget, ['workspace', 'contents', 'header'], 'TrySmalltalk');
-smalltalk.addMethod(
-'_renderOn_',
-smalltalk.method({
-selector: 'renderOn:',
-fn: function (html){
-var self=this;
-(function($rec){smalltalk.send($rec, "_class_", ["profStef"]);smalltalk.send($rec, "_with_", [(function(){return self['@header']=smalltalk.send(html, "_h2", []);})]);smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_renderOn_", [html]);})]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_renderButtonsOn_", [html]);})]);})(smalltalk.send(html, "_div", []));
-(function($rec){smalltalk.send($rec, "_widget_", [self]);return smalltalk.send($rec, "_showCurrentLesson", []);})(smalltalk.send((smalltalk.ProfStef || ProfStef), "_default", []));
-return self;}
-}),
-smalltalk.TrySmalltalkWidget);
-
 smalltalk.addMethod(
 '_workspace',
 smalltalk.method({
@@ -44,6 +32,29 @@ return self;}
 }),
 smalltalk.TrySmalltalkWidget);
 
+smalltalk.addMethod(
+'_setTitle_',
+smalltalk.method({
+selector: 'setTitle:',
+fn: function (aString){
+var self=this;
+smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [aString]);})]);
+return self;}
+}),
+smalltalk.TrySmalltalkWidget);
+
+smalltalk.addMethod(
+'_renderOn_',
+smalltalk.method({
+selector: 'renderOn:',
+fn: function (html){
+var self=this;
+(function($rec){smalltalk.send($rec, "_class_", ["profStef"]);smalltalk.send($rec, "_with_", [(function(){return self['@header']=smalltalk.send(html, "_h2", []);})]);smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(smalltalk.send(self, "_workspace", []), "_renderOn_", [html]);})]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_renderButtonsOn_", [html]);})]);})(smalltalk.send(html, "_div", []));
+(function($rec){smalltalk.send($rec, "_widget_", [self]);return smalltalk.send($rec, "_showCurrentLesson", []);})(smalltalk.send((smalltalk.ProfStef || ProfStef), "_default", []));
+return self;}
+}),
+smalltalk.TrySmalltalkWidget);
+
 smalltalk.addMethod(
 '_renderButtonsOn_',
 smalltalk.method({
@@ -57,17 +68,17 @@ return self;}
 }),
 smalltalk.TrySmalltalkWidget);
 
+
 smalltalk.addMethod(
-'_setTitle_',
+'_open',
 smalltalk.method({
-selector: 'setTitle:',
-fn: function (aString){
+selector: 'open',
+fn: function (){
 var self=this;
-smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [aString]);})]);
+smalltalk.send(smalltalk.send(self, "_new", []), "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
 return self;}
 }),
-smalltalk.TrySmalltalkWidget);
-
+smalltalk.TrySmalltalkWidget.klass);
 
 
 smalltalk.addClass('AbstractTutorial', smalltalk.Object, [], 'TrySmalltalk');
@@ -94,58 +105,58 @@ return self;}
 smalltalk.AbstractTutorial);
 
 smalltalk.addMethod(
-'_welcome',
+'_lessonAt_',
 smalltalk.method({
-selector: 'welcome',
-fn: function (){
+selector: 'lessonAt:',
+fn: function (anInteger){
 var self=this;
-return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Welcome", unescape("%22Hi%2C%20this%20is%20a%20test%20tutorial.%22")]);
+var lessonSelector=nil;
+lessonSelector=smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_at_", [anInteger]);
+return smalltalk.send(self, "_perform_", [lessonSelector]);
 return self;}
 }),
 smalltalk.AbstractTutorial);
 
 smalltalk.addMethod(
-'_testLesson',
+'_size',
 smalltalk.method({
-selector: 'testLesson',
+selector: 'size',
 fn: function (){
 var self=this;
-return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Test Lesson", unescape("%22This%20lesson%20is%20a%20test%22")]);
+return smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_size", []);
 return self;}
 }),
 smalltalk.AbstractTutorial);
 
 smalltalk.addMethod(
-'_theEnd',
+'_welcome',
 smalltalk.method({
-selector: 'theEnd',
+selector: 'welcome',
 fn: function (){
 var self=this;
-return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["The End", unescape("%22And%20that%27d%20be%20pretty%20much%20it%20%3A%29%22")]);
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Welcome", unescape("%22Hi%2C%20this%20is%20a%20test%20tutorial.%22")]);
 return self;}
 }),
 smalltalk.AbstractTutorial);
 
 smalltalk.addMethod(
-'_lessonAt_',
+'_testLesson',
 smalltalk.method({
-selector: 'lessonAt:',
-fn: function (anInteger){
+selector: 'testLesson',
+fn: function (){
 var self=this;
-var lessonSelector=nil;
-lessonSelector=smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_at_", [anInteger]);
-return smalltalk.send(self, "_perform_", [lessonSelector]);
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["Test Lesson", unescape("%22This%20lesson%20is%20a%20test%22")]);
 return self;}
 }),
 smalltalk.AbstractTutorial);
 
 smalltalk.addMethod(
-'_size',
+'_theEnd',
 smalltalk.method({
-selector: 'size',
+selector: 'theEnd',
 fn: function (){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "_tableOfContents", []), "_size", []);
+return smalltalk.send((smalltalk.Lesson || Lesson), "_title_contents_", ["The End", unescape("%22And%20that%27d%20be%20pretty%20much%20it%20%3A%29%22")]);
 return self;}
 }),
 smalltalk.AbstractTutorial);
@@ -223,115 +234,115 @@ return self;}
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_first',
+'_size',
 smalltalk.method({
-selector: 'first',
+selector: 'size',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_rewind", []);
-return smalltalk.send(self, "_currentLesson", []);
+return smalltalk.send(smalltalk.send(self, "_tutorial", []), "_size", []);
 return self;}
 }),
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_last',
+'_tutorial',
 smalltalk.method({
-selector: 'last',
+selector: 'tutorial',
 fn: function (){
 var self=this;
-self['@tutorialPosition']=smalltalk.send(self, "_size", []);
-return smalltalk.send(self, "_currentLesson", []);
+return (($receiver = self['@tutorial']) == nil || $receiver == undefined) ? (function(){return self['@tutorial']=smalltalk.send((smalltalk.SmalltalkSyntaxTutorial || SmalltalkSyntaxTutorial), "_new", []);})() : $receiver;
 return self;}
 }),
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_next',
+'_tutorial_',
 smalltalk.method({
-selector: 'next',
-fn: function (){
+selector: 'tutorial:',
+fn: function (aTutorial){
 var self=this;
-(($receiver = (($receiver = smalltalk.send(self, "_tutorialPosition", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(self, "_size", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(self, "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
-return smalltalk.send(self, "_currentLesson", []);
+self['@tutorial']=aTutorial;
 return self;}
 }),
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_previous',
+'_tutorialPosition',
 smalltalk.method({
-selector: 'previous',
+selector: 'tutorialPosition',
 fn: function (){
 var self=this;
-(($receiver = (($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver >(1) : smalltalk.send($receiver, "__gt", [(1)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);})]);
-return smalltalk.send(self, "_currentLesson", []);
+return (($receiver = self['@tutorialPosition']) == nil || $receiver == undefined) ? (function(){smalltalk.send(self, "_rewind", []);return self['@tutorialPosition'];})() : $receiver;
 return self;}
 }),
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_rewind',
+'_tutorialPosition_',
 smalltalk.method({
-selector: 'rewind',
-fn: function (){
+selector: 'tutorialPosition:',
+fn: function (aTutorialPosition){
 var self=this;
-self['@tutorialPosition']=(1);
+self['@tutorialPosition']=aTutorialPosition;
 return self;}
 }),
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_size',
+'_first',
 smalltalk.method({
-selector: 'size',
+selector: 'first',
 fn: function (){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "_tutorial", []), "_size", []);
+smalltalk.send(self, "_rewind", []);
+return smalltalk.send(self, "_currentLesson", []);
 return self;}
 }),
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_tutorial',
+'_last',
 smalltalk.method({
-selector: 'tutorial',
+selector: 'last',
 fn: function (){
 var self=this;
-return (($receiver = self['@tutorial']) == nil || $receiver == undefined) ? (function(){return self['@tutorial']=smalltalk.send((smalltalk.SmalltalkSyntaxTutorial || SmalltalkSyntaxTutorial), "_new", []);})() : $receiver;
+self['@tutorialPosition']=smalltalk.send(self, "_size", []);
+return smalltalk.send(self, "_currentLesson", []);
 return self;}
 }),
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_tutorial_',
+'_next',
 smalltalk.method({
-selector: 'tutorial:',
-fn: function (aTutorial){
+selector: 'next',
+fn: function (){
 var self=this;
-self['@tutorial']=aTutorial;
+(($receiver = (($receiver = smalltalk.send(self, "_tutorialPosition", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(self, "_size", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(self, "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
+return smalltalk.send(self, "_currentLesson", []);
 return self;}
 }),
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_tutorialPosition',
+'_previous',
 smalltalk.method({
-selector: 'tutorialPosition',
+selector: 'previous',
 fn: function (){
 var self=this;
-return (($receiver = self['@tutorialPosition']) == nil || $receiver == undefined) ? (function(){smalltalk.send(self, "_rewind", []);return self['@tutorialPosition'];})() : $receiver;
+(($receiver = (($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver >(1) : smalltalk.send($receiver, "__gt", [(1)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return self['@tutorialPosition']=(($receiver = self['@tutorialPosition']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);})]);
+return smalltalk.send(self, "_currentLesson", []);
 return self;}
 }),
 smalltalk.TutorialPlayer);
 
 smalltalk.addMethod(
-'_tutorialPosition_',
+'_rewind',
 smalltalk.method({
-selector: 'tutorialPosition:',
-fn: function (aTutorialPosition){
+selector: 'rewind',
+fn: function (){
 var self=this;
-self['@tutorialPosition']=aTutorialPosition;
+self['@tutorialPosition']=(1);
 return self;}
 }),
 smalltalk.TutorialPlayer);
@@ -350,18 +361,6 @@ return self;}
 }),
 smalltalk.ProfStef);
 
-smalltalk.addMethod(
-'_first',
-smalltalk.method({
-selector: 'first',
-fn: function (){
-var self=this;
-smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_first", []);
-return smalltalk.send(self, "_showCurrentLesson", []);
-return self;}
-}),
-smalltalk.ProfStef);
-
 smalltalk.addMethod(
 '_progress',
 smalltalk.method({
@@ -396,50 +395,62 @@ return self;}
 smalltalk.ProfStef);
 
 smalltalk.addMethod(
-'_next',
+'_widget_',
 smalltalk.method({
-selector: 'next',
+selector: 'widget:',
+fn: function (aWidget){
+var self=this;
+self['@widget']=aWidget;
+return self;}
+}),
+smalltalk.ProfStef);
+
+smalltalk.addMethod(
+'_showCurrentLesson',
+smalltalk.method({
+selector: 'showCurrentLesson',
 fn: function (){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_next", []);
-return smalltalk.send(self, "_showCurrentLesson", []);
+var lesson=nil;
+lesson=smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_currentLesson", []);
+smalltalk.send(self['@widget'], "_contents_", [smalltalk.send(lesson, "_contents", [])]);
+smalltalk.send(self['@widget'], "_setTitle_", [smalltalk.send(smalltalk.send(smalltalk.send(lesson, "_title", []), "__comma", [" "]), "__comma", [smalltalk.send(self, "_progress", [])])]);
 return self;}
 }),
 smalltalk.ProfStef);
 
 smalltalk.addMethod(
-'_previous',
+'_first',
 smalltalk.method({
-selector: 'previous',
+selector: 'first',
 fn: function (){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_previous", []);
+smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_first", []);
 return smalltalk.send(self, "_showCurrentLesson", []);
 return self;}
 }),
 smalltalk.ProfStef);
 
 smalltalk.addMethod(
-'_widget_',
+'_next',
 smalltalk.method({
-selector: 'widget:',
-fn: function (aWidget){
+selector: 'next',
+fn: function (){
 var self=this;
-self['@widget']=aWidget;
+smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_next", []);
+return smalltalk.send(self, "_showCurrentLesson", []);
 return self;}
 }),
 smalltalk.ProfStef);
 
 smalltalk.addMethod(
-'_showCurrentLesson',
+'_previous',
 smalltalk.method({
-selector: 'showCurrentLesson',
+selector: 'previous',
 fn: function (){
 var self=this;
-var lesson=nil;
-lesson=smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_currentLesson", []);
-smalltalk.send(self['@widget'], "_contents_", [smalltalk.send(lesson, "_contents", [])]);
-smalltalk.send(self['@widget'], "_setTitle_", [smalltalk.send(smalltalk.send(smalltalk.send(lesson, "_title", []), "__comma", [" "]), "__comma", [smalltalk.send(self, "_progress", [])])]);
+smalltalk.send(smalltalk.send(self, "_tutorialPlayer", []), "_previous", []);
+return smalltalk.send(self, "_showCurrentLesson", []);
 return self;}
 }),
 smalltalk.ProfStef);
@@ -447,23 +458,23 @@ smalltalk.ProfStef);
 
 smalltalk.ProfStef.klass.iVarNames = ['instance'];
 smalltalk.addMethod(
-'_first',
+'_default',
 smalltalk.method({
-selector: 'first',
+selector: 'default',
 fn: function (){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "_default", []), "_first", []);
+return (($receiver = self['@instance']) == nil || $receiver == undefined) ? (function(){return self['@instance']=smalltalk.send(self, "_new", []);})() : $receiver;
 return self;}
 }),
 smalltalk.ProfStef.klass);
 
 smalltalk.addMethod(
-'_default',
+'_first',
 smalltalk.method({
-selector: 'default',
+selector: 'first',
 fn: function (){
 var self=this;
-return (($receiver = self['@instance']) == nil || $receiver == undefined) ? (function(){return self['@instance']=smalltalk.send(self, "_new", []);})() : $receiver;
+return smalltalk.send(smalltalk.send(self, "_default", []), "_first", []);
 return self;}
 }),
 smalltalk.ProfStef.klass);

File diff suppressed because it is too large
+ 267 - 180
examples/trysmalltalk/js/TrySmalltalk.js


+ 964 - 0
examples/trysmalltalk/st/TrySmalltalk.st

@@ -0,0 +1,964 @@
+Widget subclass: #TrySmalltalkWidget
+	instanceVariableNames: 'workspace contents header'
+	category: 'TrySmalltalk'!
+
+!TrySmalltalkWidget methodsFor: 'accessing'!
+
+workspace
+	^ workspace ifNil: [
+          	workspace := SourceArea new]
+!
+
+contents: aString
+	self workspace val: aString
+!
+
+contents
+	^self workspace val
+!
+
+setTitle: aString
+	header contents: [:html | html with: aString]
+! !
+
+!TrySmalltalkWidget methodsFor: 'rendering'!
+
+renderOn: html
+	html div 
+		class: 'profStef'; 
+		with: [header := html h2];
+		with: [self workspace renderOn: html];
+		with: [self renderButtonsOn: html].
+          ProfStef default 
+		widget: self;
+		showCurrentLesson
+!
+
+renderButtonsOn: html
+    html button
+	with: 'DoIt';
+	title: 'ctrl+d';
+	onClick: [self workspace doIt].
+    html button
+	with: 'PrintIt';
+	title: 'ctrl+p';
+	onClick: [self workspace printIt].
+    html button
+	with: 'InspectIt';
+	title: 'ctrl+i';
+	onClick: [self workspace inspectIt]
+! !
+
+!TrySmalltalkWidget class methodsFor: 'initialize'!
+
+open
+	self new appendToJQuery: 'body' asJQuery.
+! !
+
+Object subclass: #AbstractTutorial
+	instanceVariableNames: ''
+	category: 'TrySmalltalk'!
+!AbstractTutorial commentStamp!
+Parent class of all ProfStef tutorials.
+
+To create your own tutorial:
+- subclass AbstractTutorial
+- implement a few methods which returns a Lesson instance
+- implement tutorial which returns a Collection of selectors to the methods you've created.!
+
+!AbstractTutorial methodsFor: 'accessing'!
+
+indexOfLesson: aSelector
+	^self tableOfContents indexOf: aSelector.
+!
+
+tableOfContents
+^ #(
+  'welcome'
+  'testLesson'
+  'theEnd'
+)
+!
+
+lessonAt: anInteger
+	| lessonSelector |
+	lessonSelector := self tableOfContents at: anInteger.
+	^ self perform: lessonSelector.
+!
+
+size
+	^ self tableOfContents size
+! !
+
+!AbstractTutorial methodsFor: 'pages'!
+
+welcome
+	^ Lesson
+		title: 'Welcome' 
+		contents: '"Hi, this is a test tutorial."'
+!
+
+testLesson
+	^ Lesson
+		title: 'Test Lesson' 
+		contents: '"This lesson is a test"'
+!
+
+theEnd
+	^ Lesson
+		title: 'The End' 
+		contents: '"And that''d be pretty much it :)"'
+! !
+
+Object subclass: #Lesson
+	instanceVariableNames: 'title contents'
+	category: 'TrySmalltalk'!
+
+!Lesson methodsFor: 'accessing'!
+
+contents
+	^ contents ifNil: [contents := '']
+!
+
+contents: aString
+	contents := aString
+!
+
+title: aString
+	title := aString
+!
+
+title
+	^ title ifNil: [title := '']
+! !
+
+!Lesson class methodsFor: 'instance creation'!
+
+title: aTitle contents: someContents
+	^ (self new)
+		title: aTitle;
+		contents: someContents
+! !
+
+Object subclass: #TutorialPlayer
+	instanceVariableNames: 'tutorialPosition tutorial'
+	category: 'TrySmalltalk'!
+!TutorialPlayer commentStamp!
+I can navigate through an AbstractTutorial subclass. With #next and #previous you can go forward and backward through the tutorial.!
+
+!TutorialPlayer methodsFor: 'accessing'!
+
+currentLesson
+	^ self tutorial lessonAt: self tutorialPosition.
+!
+
+size
+	^ self tutorial size
+!
+
+tutorial
+	^ tutorial  ifNil: [tutorial := SmalltalkSyntaxTutorial new]
+!
+
+tutorial: aTutorial
+	tutorial := aTutorial
+!
+
+tutorialPosition 
+	^ tutorialPosition  ifNil: [
+		self rewind.
+		tutorialPosition.
+	].
+!
+
+tutorialPosition: aTutorialPosition 
+	tutorialPosition := aTutorialPosition
+! !
+
+!TutorialPlayer methodsFor: 'navigation'!
+
+first
+	self rewind.
+	^ self currentLesson
+!
+
+last
+	tutorialPosition := self size.
+	^ self currentLesson
+!
+
+next
+	self tutorialPosition < self size
+		ifTrue: [tutorialPosition := tutorialPosition + 1].
+	^ self currentLesson
+!
+
+previous
+	tutorialPosition >  1 ifTrue: [tutorialPosition := tutorialPosition  - 1].
+	^ self currentLesson
+!
+
+rewind
+	tutorialPosition := 1.
+! !
+
+Object subclass: #ProfStef
+	instanceVariableNames: 'tutorialPlayer widget'
+	category: 'TrySmalltalk'!
+!ProfStef commentStamp!
+A ProfStef is the Smalltalk teacher. To start the tutorial, evaluate:
+ProfStef go.
+
+To go to the next lesson evaluate:
+ProfStef next.
+
+To execute your own tutorial:
+ProfStef goOn: MyOwnTutorial
+
+To see a table of contents with all defined tutorials:
+ProfStef contents!
+
+!ProfStef methodsFor: 'accessing'!
+
+tutorialPlayer
+	^ tutorialPlayer ifNil: [tutorialPlayer := TutorialPlayer new]
+!
+
+progress
+	^ '(', self tutorialPositionString, '/', self tutorialSizeString, ')'.
+!
+
+tutorialPositionString
+	^ self tutorialPlayer tutorialPosition asString.
+!
+
+tutorialSizeString
+	^ self tutorialPlayer size asString
+!
+
+widget: aWidget
+	widget := aWidget
+!
+
+showCurrentLesson
+	| lesson |
+	lesson := self tutorialPlayer currentLesson.
+	widget contents: lesson contents.
+	widget setTitle: lesson title , ' ' , self progress.
+! !
+
+!ProfStef methodsFor: 'navigation'!
+
+first
+	self tutorialPlayer first.
+	^ self showCurrentLesson.
+!
+
+next
+	self tutorialPlayer next.
+	^ self showCurrentLesson.
+!
+
+previous
+	self tutorialPlayer previous.
+	^ self showCurrentLesson.
+! !
+
+ProfStef class instanceVariableNames: 'instance'!
+
+!ProfStef class methodsFor: 'initialize'!
+
+default 
+	^ instance ifNil: [instance := self new]
+! !
+
+!ProfStef class methodsFor: 'navigation'!
+
+first
+	^ self default first.
+!
+
+previous
+	^ self default previous.
+!
+
+next
+	^ self default next.
+!
+
+go
+	self first.
+! !
+
+AbstractTutorial subclass: #SmalltalkSyntaxTutorial
+	instanceVariableNames: ''
+	category: 'TrySmalltalk'!
+!SmalltalkSyntaxTutorial commentStamp!
+The default ProfStef tutorial to learn Smalltalk syntax!
+
+!SmalltalkSyntaxTutorial methodsFor: 'contents'!
+
+tableOfContents
+^ #(	'welcome'
+	'doingVSPrinting'
+	'printing'
+
+	'basicTypesNumbers'
+	"'basicTypesCharacters'"
+	'basicTypesString'
+	"'basicTypesSymbol'"
+	'basicTypesArray'
+	'basicTypesDynamicArray'
+
+	'messageSyntaxUnary'
+	'messageSyntaxBinary'
+	'messageSyntaxKeyword'
+	'messageSyntaxExecutionOrder'
+	'messageSyntaxExecutionOrderParentheses'
+	'mathematicalPrecedence'
+	'messageSyntaxCascade'
+	'messageSyntaxCascadeShouldNotBeHere'
+
+	'blocks'
+	'blocksAssignation'
+	'conditionals'
+	'loops'
+	'iterators'
+
+	'instanciation'
+
+	'reflection'
+	'reflectionContinued'
+	"'pharoEnvironment'"
+
+	"'debugger'"
+	'theEnd' )
+! !
+
+!SmalltalkSyntaxTutorial methodsFor: 'pages'!
+
+basicTypesArray
+	^ Lesson
+title: 'Basic types: Array' 
+contents: 
+'"Literal arrays are created at parse time:"
+
+#(1 2 3).
+
+#( 1 2 3 #(4 5 6)) size.
+
+#(1 2 4) isEmpty.
+
+#(1 2 3) first.
+
+#(''hello'' ''Javascript'') at: 2 put: ''Smalltalk''; yourself.
+
+ProfStef next.'
+!
+
+basicTypesCharacters
+	^ Lesson
+title: 'Basic types: Characters' 
+contents: 
+'"A Character can be instantiated using $ operator:"
+
+$A.
+
+$A class.
+
+$B charCode.
+
+Character cr.
+
+Character space.
+
+"You can print all 256 characters of the ASCII extended set:"
+
+Character allByteCharacters.
+
+ProfStef next.'
+!
+
+basicTypesDynamicArray
+	^ Lesson
+title: 'Basic types: Dynamic Array' 
+contents: 
+'"Dynamic Arrays are created at execution time:"
+
+{ (2+3) . (6*6) }.
+
+{ (2+3) . (6*6) . ''hello'', '' Stef''} size.
+
+
+{ ProfStef } first next.'
+!
+
+basicTypesNumbers
+	^ Lesson
+title: 'Basic types: Numbers' 
+contents: 
+'"You now know how to execute Smalltalk code. 
+
+Now let''s talk about basic objects.
+
+1, 2, 100, 2/3 ... are Numbers, and respond to many messages evaluating mathematical expressions.
+Evaluate these ones:"
+
+2.
+
+(1/3).
+
+(1/3) + (4/5).
+
+(18/5) rounded.
+
+1 class.
+
+1 negated.
+
+1 negated negated.
+
+(1 + 3) odd.
+
+ProfStef next.'
+!
+
+basicTypesString
+	^ Lesson
+title: 'Basic types: Strings' 
+contents: 
+'"A String is a collection of characters. Use single quotes to create a String object. Print these expressions:"
+
+''ProfStef''.
+
+''ProfStef'' size.
+
+''abc'' asUppercase.
+
+''Hello World'' reversed. 
+
+"You can access each character using at: message"
+
+''ProfStef'' at: 1.
+
+"String concatenation uses the comma operator:"
+
+''ProfStef'', '' is cool''.
+
+ProfStef next.'
+!
+
+basicTypesSymbol
+	^ Lesson
+title: 'Basic types: Symbols' 
+contents: 
+'"A Symbol is a String which is guaranteed to be globally unique. 
+
+There is one and only one Symbol #ProfStef. There may be several ''ProfStef'' String objects.
+
+(Message == returns true if the two objects are the SAME)"
+
+''ProfStef'' asSymbol.
+
+#ProfStef asString.
+
+(2 asString) == (2 asString).
+
+(2 asString) asSymbol == (2 asString) asSymbol.
+
+
+(Smalltalk at: #ProfStef) next.'
+!
+
+blocks
+	^ Lesson
+title: 'Blocks' 
+contents: 
+'"Cascade is cool !! Let''s talk about blocks.
+
+Blocks are anonymous methods that can be stored into variables and executed on demand.
+
+Blocks are delimited by square brackets: []"
+
+[Transcript open].
+
+"does not open a Transcript because the block is not executed.
+
+Here is a block that adds 2 to its argument (its argument is named x):"
+
+[:x | x+2].
+
+"We can execute a block by sending it value messages."
+
+[:x | x+2] value: 5.
+
+[Transcript open] value.
+
+[:x | x+2] value: 10.
+
+[:x :y| x + y] value:3 value:5.
+
+[ProfStef next] value.'
+!
+
+blocksAssignation
+	^ Lesson
+title: 'Block assignation' 
+contents: 
+'"Blocks can be assigned to a variable then executed later.
+
+Note that |b| is the declaration of a variable named ''b'' and that '':='' assigns a value to a variable.
+
+Select the three lines then Print It:"
+
+|b|
+b := [:x | x+2].
+b value: 12.
+
+
+ProfStef next.'
+!
+
+conditionals
+	^ Lesson
+title: 'Conditionals' 
+contents: 
+'"Conditionals are just messages sent to Boolean objects"
+
+1 < 2
+  ifTrue: [100]
+  ifFalse: [42].
+
+"Here the message is ifTrue:ifFalse
+
+Try this:"
+
+Transcript open.
+
+3 > 10 
+	ifTrue: [Transcript show: ''maybe there''''s a bug ....'']
+	ifFalse: [Transcript show: ''No : 3 is less than 10''].
+
+3 = 3 ifTrue: [ProfStef next].'.
+!
+
+debugger
+	^ Lesson
+title: 'Debugger' 
+contents: '"The Debugger may be the most famous tool of Smalltalk environments. It will open as soon as an unmanaged Exception occurs. 
+
+The following code will open the debugger.
+
+***This should be rethought completely***"
+
+
+ '
+!
+
+doingVSPrinting 
+	^ Lesson
+title: 'Doing VS Printing: Doing' 
+contents: 
+'"Cool !! (I like to say Cooool :) ). You''ve just executed a Smalltalk expression. More precisely, you sent the message ''next'' to
+ProfStef class (it''s me !!).
+
+Note you can run this tutorial again by evaluating: ''ProfStef go''. 
+''ProfStef previous'' returns to the previous lesson.
+
+You can also Do It using the keyboard shortcut ''CTRL d''
+
+Try to evaluate this expression:"
+
+window alert: ''hello world!!''.
+
+"Then go to the next lesson:"
+
+ProfStef next.'
+!
+
+instanciation
+	^ Lesson
+title: 'Instanciation' 
+contents: 
+'"Objects are instances of their class. Usually, we send the message #new to a class for creating an instance of this class.
+
+For example, let''s create an instance of the class Array:"
+
+Array new
+	add: ''Some text'';
+	add: 3.;
+	yourself.
+
+"See the array we''ve created? Actually, #(''Some text'' 3) is just a shorthand for instantiating arrays."
+
+"If we use a variable to keep track of this object, we''ll be able to do stuff with it."
+
+"The following code must be ran all at one, as the ''anArray'' variable will cease to exist once the execution finishes:"
+
+|anArray|
+
+anArray := Array new
+	add: ''Some text'';
+	add: 3;
+	yourself;
+
+Transcript show: anArray; cr.
+
+anArray remove: 3.
+
+Transcript show: anArray; cr.
+
+anArray add: ''Some more text!!''.
+
+Transcript show: anArray; cr.
+	
+"I''ll put myself in an instance of a class named Dictionary and go to the next lesson:"
+
+((Dictionary new add: (''move on!!'' -> ProfStef)) at: ''move on!!'') next'
+!
+
+iterators
+	^ Lesson
+title: 'Iterators' 
+contents: 
+'"The message do: is sent to a collection of objects (Array, Dictionary, String, etc), evaluating the block for each element.
+
+Here we want to print all the numbers on the Transcript (a console)"
+
+#(11 38 3 -2 10) do: [:each |
+     Transcript show: each printString; cr].
+
+"Some other really nice iterators"
+
+#(11 38 3 -2 10) collect: [:each | each negated].
+
+#(11 38 3 -2 10) collect: [:each | each odd].
+
+#(11 38 3 -2 10) select: [:each | each odd].
+
+#(11 38 3 -2 10) select: [:each | each > 10].
+
+#(11 38 3 -2 10) reject: [:each | each > 10].
+
+#(11 38 3 -2 10) 
+     do: [:each | Transcript show: each printString]
+     separatedBy: [Transcript show: ''.''].
+
+
+(Smalltalk current classes select: [:eachClass | eachClass name = ''ProfStef'']) do: [:eachProfstef | eachProfstef next].'
+!
+
+loops
+	^ Lesson
+title: 'Loops' 
+contents: 
+'"Loops are high-level collection iterators, implemented as regular methods."
+
+"Basic loops:
+  to:do:
+  to:by:do"
+
+1 to: 100 do:
+  [:i | Transcript show: i asString; cr ].
+
+1 to: 100 by: 3 do: [:i | Transcript show: i asString; cr].
+
+100 to: 0 by: -2 do: 
+    [:i | Transcript show: i asString; cr].
+
+1 to: 1 do: [:i | ProfStef next].'
+!
+
+mathematicalPrecedence
+	^ Lesson
+title: 'Mathematical precedence'
+contents: 
+'"Traditional precedence rules from mathematics do not follow in Smalltalk."
+
+2 * 10 + 2.
+
+"Here the message * is sent to 2, which answers 20, then 20 receive the message +
+
+Remember that all messages always follow a simple left-to-right precedence rule, * without exceptions *."
+
+2 + 2 * 10.
+
+2 + (2 * 10).
+
+8 - 5 / 2.
+
+(8 - 5) / 2.
+
+8 - (5 / 2).
+
+ProfStef next.'
+!
+
+messageSyntaxBinary
+	^ Lesson
+title: 'Message syntax: Binary messages' 
+contents: 
+'"Binary messages have the following form:
+    anObject + anotherObject"
+
+3 * 2.
+
+Date today year = 2011.
+
+false | false.
+
+true & true.
+
+true & false.
+
+10 @ 100.
+
+10 <= 12.
+
+''ab'', ''cd''.
+
+ProfStef next.'
+!
+
+messageSyntaxCascade
+	^ Lesson
+title: 'Message syntax: Cascade' 
+contents: 
+'"; is the cascade operator. It''s useful to send message to the SAME receiver
+Open a Transcript (console):"
+
+Transcript open.
+
+"Then:"
+
+Transcript show: ''hello''.
+Transcript show: ''Smalltalk''.
+Transcript cr.
+
+"is equivalent to:"
+
+Transcript 
+	   show: ''hello'';
+	   show: ''Smalltalk'' ;
+	   cr.
+
+"You can close the development tools by clicking on the red circle with a cross at the bottom left of the website.
+Try to go to the next lesson with a cascade of two ''next'' messages:"
+
+ProfStef'.
+!
+
+messageSyntaxCascadeShouldNotBeHere
+	^ Lesson
+title: 'Lost ?' 
+contents: 
+'"Hey, you should not be here !!!! 
+
+Go back and use a cascade !!"
+
+ProfStef previous.'.
+!
+
+messageSyntaxExecutionOrder
+	^ Lesson
+title: 'Message syntax: Execution order' 
+contents: 
+'"Unary messages are executed first, then binary messages and finally keyword messages:
+    Unary > Binary > Keywords"
+
+2.5 + 3.8 rounded.
+
+3 max: 2 + 2.
+  
+(0@0) class.
+
+0@0 x: 100.
+
+(0@0 x: 100) class.
+
+"Between messages of similar precedence, expressions are executed from left to right"
+
+-12345 negated asString reversed.
+
+ProfStef next.'
+!
+
+messageSyntaxExecutionOrderParentheses
+	^ Lesson
+title: 'Message syntax: Parentheses'
+contents: 
+'"Use parentheses to change order of evaluation"
+
+(2.5 + 3.8) rounded.
+
+(3 max: 2) + 2.
+
+ProfStef next.'
+!
+
+messageSyntaxKeyword
+	^ Lesson
+title: 'Message syntax: Keyword messages' 
+contents: 
+'"Keyword Messages are messages with arguments. They have the following form:
+    anObject akey: anotherObject akey2: anotherObject2"
+
+''Web development is a good deal of pain'' copyFrom: 1 to: 30
+
+"The message is copyFrom:to: sent to the String ''Web development is a good deal of pain''"
+
+1 max: 3.
+
+Array with: ''hello'' with: 2 with: Smalltalk.
+
+"The message is with:with:with: implemented on class Array. Note you can also write"
+
+Array
+	with: ''Hi there!!''
+	with: 2
+	with: Smalltalk.
+	
+ProfStef perform: ''next''.'
+!
+
+messageSyntaxUnary
+	^ Lesson
+title: 'Message syntax: Unary messages' 
+contents: 
+'"Messages are sent to objects. There are three types of message: Unary, Binary and Keyword.
+
+Unary messages have the following form:
+    anObject aMessage 
+
+You''ve already sent unary messages. For example:"
+
+1 class.
+
+false not.
+
+Date today.
+
+Number pi.
+
+"And of course: "
+
+ProfStef next.'
+!
+
+pharoEnvironment
+	^ Lesson
+title: 'Pharo environment' 
+contents: 
+'"Every Smalltalk system is full of objects. There are windows, text, numbers, dates, colors, points and much more. You can interact with objects in a much more direct way than is possible with other programming languages.
+
+Every object understands the message ''explore''. As a result, you get an Explorer window that shows details about the object."
+
+Date today explore.
+
+"This shows that the date object consists of a point in time (start) and a duration (one day long)."
+
+ProfStef explore.
+
+"You see, ProfStef class has a lot of objects. Let''s take a look at my code:"
+
+ProfStef browse.
+
+ProfStef next.'
+!
+
+printing 
+	^ Lesson
+title: 'Doing VS Printing: Printing' 
+contents: 
+'"Now you''re a Do It master !! Let''s talk about printing. It''s a Do It which prints the result next to the expression you''ve selected.
+For example, select the text below, and click on ''PrintIt'':"
+
+1 + 2.
+
+"As with ''DoIt'', there is also a shortcut to execute this command.
+
+Try CTRL-p on the following expressions:"
+
+Date today.
+
+"The result is selected, so you can erase it using the backspace key. Try it !!"
+
+Date today asDateString.
+
+Date today asTimeString.
+
+ProfStef next.'
+!
+
+reflection
+	^ Lesson
+title: 'Reflection' 
+contents: 
+'"You can inspect and change the system at runtime.
+
+Take a look at the source code of the method #and: of the class Boolean:"
+
+(Boolean methodDictionary at: ''and:'') source.
+
+"Or all the methods it sends:"
+
+(Boolean methodDictionary at: ''and:'') messageSends.
+
+"Here''s all the methods I implement:"
+
+ProfStef methodDictionary.
+
+"Let''s create a new method to go to the next lesson:"
+
+|newMethod|
+newMethod := Compiler new load: ''goToNextLesson ProfStef next.'' forClass: ProfStef.
+ProfStef class addCompiledMethod: newMethod
+
+"Wow!! I can''t wait to use my new method!!"
+
+ProfStef goToNextLesson.'
+!
+
+reflectionContinued
+	^ Lesson
+title: 'Reflection continued' 
+contents: 
+'"So cool, isn''t it ?  Before going further, let''s remove this method:"
+
+ProfStef class methodAt: #goToNextLesson.
+
+ProfStef class removeCompiledMethod: (ProfStef class methodAt: #goToNextLesson).
+
+ProfStef class methodAt: #goToNextLesson.
+
+
+"Then move forward:"
+
+ProfStef perform:#next'
+!
+
+theEnd
+	^ Lesson
+title: 'Tutorial done !!' 
+contents: 
+'"This tutorial is done. Enjoy programming Smalltalk with JTalk. 
+
+You can run this tutorial again by evaluating: ProfStef go.
+
+See you soon !!"
+'
+!
+
+welcome
+	^ Lesson
+title: 'Welcome' 
+contents: 
+' "Hello!! I''m Professor Stef. 
+
+You must want me to help you learn Smalltalk.
+
+So let''s go to the first lesson.  Select the text below and click on the ''DoIt'' button"
+
+ProfStef next.'
+! !
+

+ 6 - 0
ide.html

@@ -55,6 +55,12 @@ t: 0; border: 0;" src="./ide/fork_me.png" alt="Fork me on GitHub"></a>
       <p>Jtalk is an implementation of the  <a href="http://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> language that runs on top of the <a href="http://en.wikipedia.org/wiki/Javascript">JavaScript</a> runtime. It is designed to make client-side development faster and easier.</p>
       <p>Jtalk is written in itself, including the parser and compiler. Jtalk compiles into efficient JavaScript, mapping one-to-one with the equivalent JavaScript. There is no interpretation at runtime.</p>
       <p>Try a <button onclick="smalltalk.Browser._open()"> Class browser</button> right now!</p>
+			<p>You may want to look at sample applications:
+			<ul>
+			  <li><a href="examples/trysmalltalk/index.html">Try Smalltalk in your web browser</a></li>
+				<li><a href="examples/presentation/index.html">JTalk slides</a></li>
+			</ul>
+			</p>
     </div>
     <div class="right"><img src="./ide/screen2.png"></div>
     <div class="clear"></div>

BIN
images/off.png


BIN
images/offHover.png


BIN
images/sprite.png


BIN
images/tinylogo.png


+ 16 - 9
js/Benchfib.js

@@ -9,8 +9,9 @@ fn: function (){
 var self=this;
 var result=nil;
 result=smalltalk.send((0), "_tinyBenchmarks", []);
-smalltalk.send(console, "_log_", [(typeof ($receiver = unescape("0%20tinyBenchmarks%20%3D%3E%20")) === 'string') ? [$receiver, result].join("") : smalltalk.send($receiver, "__comma", [result])]);
+smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(unescape("0%20tinyBenchmarks%20%3D%3E%20"), "__comma", [result])]);
 return self;},
+args: [],
 source: unescape('main%0A%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%200%20tinyBenchmarks.%0A%09console%20log%3A%20%270%20tinyBenchmarks%20%3D%3E%20%27%20%2C%20result'),
 messageSends: ["tinyBenchmarks", "log:", unescape("%2C")],
 referencedClasses: []
@@ -27,6 +28,7 @@ fn: function (){
 var self=this;
 return (($receiver = self < (2)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (1);})() : (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (1);}), (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
 return self;},
+args: [],
 source: unescape('benchFib%20%0A%09%22Handy%20send-heavy%20benchmark%22%0A%09%22%28result%20//%20seconds%20to%20run%29%20%3D%20approx%20calls%20per%20second%22%0A%09%22%20%7C%20r%20t%20%7C%0A%09%20%20t%20%3A%3D%20Time%20millisecondsToRun%3A%20%5Br%20%3A%3D%2026%20benchFib%5D.%0A%09%20%20%28r%20*%201000%29%20//%20t%22%0A%09%22138000%20on%20a%20Mac%208100/100%22%0A%09%5E%20self%20%3C%202%20%0A%09%09ifTrue%3A%20%5B1%5D%20%0A%09%09ifFalse%3A%20%5B%28self-1%29%20benchFib%20+%20%28self-2%29%20benchFib%20+%201%5D'),
 messageSends: ["ifTrue:ifFalse:", unescape("%3C"), unescape("+"), "benchFib", unescape("-")],
 referencedClasses: []
@@ -46,10 +48,11 @@ var prime=nil;
 var k=nil;
 var count=nil;
 size=(8190);
-smalltalk.send((1), "_to_do_", [self, (function(iter){count=(0);flags=smalltalk.send(smalltalk.Array, "_new", []);smalltalk.send(size, "_timesRepeat_", [(function(){return smalltalk.send(flags, "_add_", [true]);})]);return smalltalk.send((1), "_to_do_", [size, (function(i){return (($receiver = smalltalk.send(flags, "_at_", [i])).klass === smalltalk.Boolean) ? ($receiver ? (function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);})]);})]);
+smalltalk.send((1), "_to_do_", [self, (function(iter){count=(0);flags=smalltalk.send((smalltalk.Array || Array), "_new", []);smalltalk.send(size, "_timesRepeat_", [(function(){return smalltalk.send(flags, "_add_", [true]);})]);return smalltalk.send((1), "_to_do_", [size, (function(i){return (($receiver = smalltalk.send(flags, "_at_", [i])).klass === smalltalk.Boolean) ? ($receiver ? (function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);})]);})]);
 return count;
 return self;},
-source: unescape('benchmark%20%0A%09%22Handy%20bytecode-heavy%20benchmark%22%0A%09%22%28500000%20//%20time%20to%20run%29%20%3D%20approx%20bytecodes%20per%20second%22%0A%09%225000000%20//%20%28Time%20millisecondsToRun%3A%20%5B10%20benchmark%5D%29%20*%201000%22%0A%09%223059000%20on%20a%20Mac%208100/100%22%0A%20%20%20%20%7C%20size%20flags%20prime%20k%20count%20%7C%0A%20%20%20%20size%20%3A%3D%208190.%0A%20%20%20%201%20to%3A%20self%20do%3A%0A%20%20%20%20%20%20%20%20%5B%3Aiter%20%7C%0A%20%20%20%20%20%20%20%20count%20%3A%3D%200.%0A%20%20%20%20%20%20%20%20flags%20%3A%3D%20Array%20new.%0A%20%20%20%20%20%20%20%20size%20timesRepeat%3A%20%5B%20flags%20add%3A%20true%5D.%0A%20%20%20%20%20%20%20%201%20to%3A%20size%20do%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%5B%3Ai%20%7C%20%28flags%20at%3A%20i%29%20ifTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bprime%20%3A%3D%20i+1.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20i%20+%20prime.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bk%20%3C%3D%20size%5D%20whileTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bflags%20at%3A%20k%20put%3A%20false.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20k%20+%20prime%5D.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20count%20%3A%3D%20count%20+%201%5D%5D%5D.%0A%20%20%20%20%5E%20count%0A'),
+args: [],
+source: unescape('benchmark%20%0A%09%22Handy%20bytecode-heavy%20benchmark%22%0A%09%22%28500000%20//%20time%20to%20run%29%20%3D%20approx%20bytecodes%20per%20second%22%0A%09%225000000%20//%20%28Time%20millisecondsToRun%3A%20%5B10%20benchmark%5D%29%20*%201000%22%0A%09%223059000%20on%20a%20Mac%208100/100%22%0A%20%20%20%20%7C%20size%20flags%20prime%20k%20count%20%7C%0A%20%20%20%20size%20%3A%3D%208190.%0A%20%20%20%201%20to%3A%20self%20do%3A%0A%20%20%20%20%20%20%20%20%5B%3Aiter%20%7C%0A%20%20%20%20%20%20%20%20count%20%3A%3D%200.%0A%20%20%20%20%20%20%20%20flags%20%3A%3D%20Array%20new.%0A%20%20%20%20%20%20%20%20size%20timesRepeat%3A%20%5B%20flags%20add%3A%20true%5D.%0A%20%20%20%20%20%20%20%201%20to%3A%20size%20do%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%5B%3Ai%20%7C%20%28flags%20at%3A%20i%29%20ifTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bprime%20%3A%3D%20i+1.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20i%20+%20prime.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bk%20%3C%3D%20size%5D%20whileTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bflags%20at%3A%20k%20put%3A%20false.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20k%20+%20prime%5D.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20count%20%3A%3D%20count%20+%201%5D%5D%5D.%0A%20%20%20%20%5E%20count'),
 messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "at:", unescape("+"), "whileTrue:", unescape("%3C%3D"), "at:put:"],
 referencedClasses: [smalltalk.Array]
 }),
@@ -68,12 +71,13 @@ var r=nil;
 var n1=nil;
 var n2=nil;
 n1=(1);
-(function(){while((function(){t1=smalltalk.send(smalltalk.Date, "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_benchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
+(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_benchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
 n2=(16);
-(function(){while((function(){t2=smalltalk.send(smalltalk.Date, "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_benchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
+(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_benchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
 return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
 return self;},
-source: unescape('tinyBenchmarks%20%0A%09%22Report%20the%20results%20of%20running%20the%20two%20tiny%20Squeak%20benchmarks.%0A%09ar%209/10/1999%3A%20Adjusted%20to%20run%20at%20least%201%20sec%20to%20get%20more%20stable%20results%22%0A%09%220%20tinyBenchmarks%22%0A%09%22On%20a%20292%20MHz%20G3%20Mac%3A%2022727272%20bytecodes/sec%3B%20984169%20sends/sec%22%0A%09%22On%20a%20400%20MHz%20PII/Win98%3A%20%2018028169%20bytecodes/sec%3B%201081272%20sends/sec%22%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20benchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2016.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20benchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23benchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27%0A'),
+args: [],
+source: unescape('tinyBenchmarks%20%0A%09%22Report%20the%20results%20of%20running%20the%20two%20tiny%20Squeak%20benchmarks.%0A%09ar%209/10/1999%3A%20Adjusted%20to%20run%20at%20least%201%20sec%20to%20get%20more%20stable%20results%22%0A%09%220%20tinyBenchmarks%22%0A%09%22On%20a%20292%20MHz%20G3%20Mac%3A%2022727272%20bytecodes/sec%3B%20984169%20sends/sec%22%0A%09%22On%20a%20400%20MHz%20PII/Win98%3A%20%2018028169%20bytecodes/sec%3B%201081272%20sends/sec%22%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20benchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2016.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20benchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23benchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),
 messageSends: ["whileTrue:", "millisecondsToRun:", "benchmark", unescape("%3C"), unescape("*"), "benchFib", unescape("+"), unescape("%2C"), "printString", unescape("/")],
 referencedClasses: [smalltalk.Date]
 }),
@@ -91,6 +95,7 @@ return 1;
 } else {
 return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;};
 return self;},
+args: [],
 source: unescape('jsbenchFib%0A%20%0A%09%3Cif%20%28this%20%3C%202%29%20%7B%0Areturn%201%3B%0A%7D%20else%20%7B%0Areturn%20%28this-1%29._jsbenchFib%28%29%20+%20%28this-2%29._jsbenchFib%28%29%20+%201%3B%7D%3E'),
 messageSends: [],
 referencedClasses: []
@@ -127,6 +132,7 @@ for (var z=0;z<this;z++) {
 }
 return count;
 return self;},
+args: [],
 source: unescape('jsbenchmark%0A%0A%3C%0Avar%20size%20%3D%208190%3B%0Avar%20count%3B%0Afor%20%28var%20z%3D0%3Bz%3Cthis%3Bz++%29%20%7B%0A%20%20count%20%3D%200%3B%0A%20%20var%20flags%20%3D%20new%20Array%28%29%3B%0A%20%20for%20%28var%20p%3D0%3B%20p%3Csize%3B%20p++%29%20%7B%0A%20%20%20%20flags%5Bp%5D%20%3D%20true%3B%0A%20%20%7D%0A%20%20for%20%28var%20i%3D1%3Bi%3C%3Dsize%3Bi++%29%20%7B%0A%20%20%20%20if%20%28flags%5Bi-1%5D%29%20%7B%0A%20%20%20%20%20%20var%20prime%20%3D%20i+1%3B%0A%20%20%20%20%20%20var%20k%20%3D%20i%20+%20prime%3B%0A%20%20%20%20%20%20while%20%28k%20%3C%3D%20size%29%20%7B%0A%20%20%20%20%20%20%20%20flags%5Bk-1%5D%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20k%20%3D%20k%20+%20prime%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20count%20%3D%20count%20+%201%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0Areturn%20count%3E'),
 messageSends: [],
 referencedClasses: []
@@ -146,11 +152,12 @@ var r=nil;
 var n1=nil;
 var n2=nil;
 n1=(1);
-smalltalk.send((function(){t1=smalltalk.send(smalltalk.Date, "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_jsbenchmark", []);})]);return smalltalk.send(t1, "__lt", [(1000)]);}), "_whileTrue_", [(function(){return n1=smalltalk.send(n1, "__star", [(2)]);})]);
+(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_jsbenchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
 n2=(28);
-smalltalk.send((function(){t2=smalltalk.send(smalltalk.Date, "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_jsbenchFib", []);})]);return smalltalk.send(t2, "__lt", [(1000)]);}), "_whileTrue_", [(function(){return n2=smalltalk.send(n2, "__plus", [(1)]);})]);
-return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(n1, "__star", [(500000)]), "__star", [(1000)]), "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(r, "__star", [(1000)]), "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
+(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_jsbenchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
+return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
 return self;},
+args: [],
 source: unescape('jstinyBenchmarks%0A%09%220%20jstinyBenchmarks%22%0A%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20jsbenchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2028.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20jsbenchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23jsbenchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),
 messageSends: ["whileTrue:", "millisecondsToRun:", "jsbenchmark", unescape("%3C"), unescape("*"), "jsbenchFib", unescape("+"), unescape("%2C"), "printString", unescape("/")],
 referencedClasses: [smalltalk.Date]

+ 11 - 11
js/Canvas.deploy.js

@@ -541,6 +541,17 @@ return self;}
 }),
 smalltalk.TagBrush);
 
+smalltalk.addMethod(
+'_empty',
+smalltalk.method({
+selector: 'empty',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_empty", []);
+return self;}
+}),
+smalltalk.TagBrush);
+
 smalltalk.addMethod(
 '_at_put_',
 smalltalk.method({
@@ -807,17 +818,6 @@ return self;}
 }),
 smalltalk.TagBrush);
 
-smalltalk.addMethod(
-'_empty',
-smalltalk.method({
-selector: 'empty',
-fn: function (){
-var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_empty", []);
-return self;}
-}),
-smalltalk.TagBrush);
-
 
 smalltalk.addMethod(
 '_fromString_canvas_',

+ 19 - 19
js/Canvas.js

@@ -60,7 +60,7 @@ return self;},
 args: [],
 source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20root%20ifNil%3A%20%5Broot%20%3A%3D%20TagBrush%20fromString%3A%20%27div%27%20canvas%3A%20self%5D'),
 messageSends: ["initialize", "ifNil:", "fromString:canvas:"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: []
 }),
 smalltalk.HTMLCanvas);
 
@@ -76,7 +76,7 @@ return self;},
 args: ["aJQuery"],
 source: unescape('initializeFromJQuery%3A%20aJQuery%0A%20%20%20%20root%20%3A%3D%20TagBrush%20fromJQuery%3A%20aJQuery%20canvas%3A%20self'),
 messageSends: ["fromJQuery:canvas:"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: []
 }),
 smalltalk.HTMLCanvas);
 
@@ -92,7 +92,7 @@ return self;},
 args: ["aString"],
 source: unescape('newTag%3A%20aString%0A%20%20%20%20%5ETagBrush%20fromString%3A%20aString%20canvas%3A%20self'),
 messageSends: ["fromString:canvas:"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: []
 }),
 smalltalk.HTMLCanvas);
 
@@ -781,6 +781,22 @@ referencedClasses: []
 }),
 smalltalk.TagBrush);
 
+smalltalk.addMethod(
+'_empty',
+smalltalk.method({
+selector: 'empty',
+category: 'adding',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_empty", []);
+return self;},
+args: [],
+source: unescape('empty%0A%09self%20asJQuery%20empty'),
+messageSends: ["empty", "asJQuery"],
+referencedClasses: []
+}),
+smalltalk.TagBrush);
+
 smalltalk.addMethod(
 '_at_put_',
 smalltalk.method({
@@ -1167,22 +1183,6 @@ referencedClasses: []
 }),
 smalltalk.TagBrush);
 
-smalltalk.addMethod(
-'_empty',
-smalltalk.method({
-selector: 'empty',
-category: 'adding',
-fn: function (){
-var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_empty", []);
-return self;},
-args: [],
-source: unescape('empty%0A%09self%20asJQuery%20empty'),
-messageSends: ["empty", "asJQuery"],
-referencedClasses: []
-}),
-smalltalk.TagBrush);
-
 
 smalltalk.addMethod(
 '_fromString_canvas_',

+ 0 - 11
js/Compiler.deploy.js

@@ -1796,17 +1796,6 @@ smalltalk.Compiler.klass);
 
 
 smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler');
-smalltalk.addMethod(
-'_doIt',
-smalltalk.method({
-selector: 'doIt',
-fn: function (){
-var self=this;
-return smalltalk.send((function(){return smalltalk.send((1), "_fdsfds", []);}), "_value", []);
-return self;}
-}),
-smalltalk.DoIt);
-
 
 
 smalltalk.addClass('DynamicArrayNode', smalltalk.Node, [], 'Compiler');

+ 2 - 18
js/Compiler.js

@@ -2059,7 +2059,7 @@ var self=this;
 return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_parse_", [aString]);
 return self;},
 args: ["aString"],
-source: unescape('parse%3A%20aString%0A%20%20%20%20%5ESmalltalk%20current%20parse%3A%20aString%20'),
+source: unescape('parse%3A%20aString%0A%20%20%20%20%5ESmalltalk%20current%20parse%3A%20aString'),
 messageSends: ["parse:", "current"],
 referencedClasses: [smalltalk.Smalltalk]
 }),
@@ -2175,7 +2175,7 @@ return self;},
 args: [],
 source: unescape('recompileAll%0A%09Smalltalk%20current%20classes%20do%3A%20%5B%3Aeach%20%7C%0A%09%09Transcript%20show%3A%20each%3B%20cr.%0A%09%09%5Bself%20recompile%3A%20each%5D%20valueWithTimeout%3A%20100%5D'),
 messageSends: ["do:", "classes", "current", "show:", "cr", "valueWithTimeout:", "recompile:"],
-referencedClasses: [smalltalk.Smalltalk,smalltalk.Transcript]
+referencedClasses: [smalltalk.Smalltalk]
 }),
 smalltalk.Compiler);
 
@@ -2511,22 +2511,6 @@ smalltalk.Compiler.klass);
 
 
 smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler');
-smalltalk.addMethod(
-'_doIt',
-smalltalk.method({
-selector: 'doIt',
-category: '',
-fn: function (){
-var self=this;
-return smalltalk.send((function(){return smalltalk.send((1), "_fdsfds", []);}), "_value", []);
-return self;},
-args: [],
-source: unescape('doIt%20%5E%5B1%20fdsfds%5D%20value'),
-messageSends: ["value", "fdsfds"],
-referencedClasses: []
-}),
-smalltalk.DoIt);
-
 
 
 smalltalk.addClass('DynamicArrayNode', smalltalk.Node, [], 'Compiler');

+ 2 - 2
js/Examples.js

@@ -288,7 +288,7 @@ return self;},
 args: [],
 source: unescape('newPiece%0A%09movingPiece%20%3A%3D%20TetrisPiece%20atRandom'),
 messageSends: ["atRandom"],
-referencedClasses: [smalltalk.TetrisPiece]
+referencedClasses: []
 }),
 smalltalk.Tetris);
 
@@ -375,7 +375,7 @@ return self;},
 args: ["html"],
 source: unescape('renderCanvasOn%3A%20html%0A%09%7C%20canvas%20%7C%0A%09canvas%20%3A%3D%20html%20canvas.%0A%09canvas%20at%3A%20%27width%27%20put%3A%20self%20width%20asString.%0A%09canvas%20at%3A%20%27height%27%20put%3A%20self%20height%20asString.%0A%09renderingContext%20%3A%3D%20CanvasRenderingContext%20tagBrush%3A%20canvas.%0A%09self%20redraw'),
 messageSends: ["canvas", "at:put:", "asString", "width", "height", "tagBrush:", "redraw"],
-referencedClasses: [smalltalk.CanvasRenderingContext]
+referencedClasses: []
 }),
 smalltalk.Tetris);
 

File diff suppressed because it is too large
+ 61 - 29
js/IDE.deploy.js


File diff suppressed because it is too large
+ 101 - 59
js/IDE.js


+ 8 - 11
js/JQuery-Tests.deploy.js

@@ -1,25 +1,23 @@
 smalltalk.addClass('JQueryTest', smalltalk.TestCase, ['document'], 'JQuery-Tests');
 smalltalk.addMethod(
-'_testFind',
+'_setUp',
 smalltalk.method({
-selector: 'testFind',
+selector: 'setUp',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_equals_", ["James", smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li.firstname"]), "_html", [])]);
+self['@document']=unescape("%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E");
 return self;}
-]
 }),
 smalltalk.JQueryTest);
 
 smalltalk.addMethod(
-'_setUp',
+'_testFind',
 smalltalk.method({
-selector: 'setUp',
+selector: 'testFind',
 fn: function (){
 var self=this;
-self['@document']=unescape("%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E");
+smalltalk.send(self, "_assert_equals_", ["James", smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li.firstname"]), "_html", [])]);
 return self;}
-]
 }),
 smalltalk.JQueryTest);
 
@@ -30,11 +28,10 @@ selector: 'testEach',
 fn: function (){
 var self=this;
 var classes=nil;
-classes=smalltalk.send(smalltalk.Array, "_new", []);
-smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li"]), "_each_", [(function(index, element){return smalltalk.send(classes, "_add_", [smalltalk.send(smalltalk.send(smalltalk.JQuery, "_fromElement_", [element]), "_attr_", ["class"])]);})]);
+classes=smalltalk.send((smalltalk.Array || Array), "_new", []);
+smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li"]), "_each_", [(function(index, element){return smalltalk.send(classes, "_add_", [smalltalk.send(smalltalk.send((smalltalk.JQuery || JQuery), "_fromElement_", [element]), "_attr_", ["class"])]);})]);
 smalltalk.send(self, "_assert_equals_", [smalltalk.send(["firstname", "lastname"], "_printString", []), smalltalk.send(classes, "_printString", [])]);
 return self;}
-]
 }),
 smalltalk.JQueryTest);
 

+ 17 - 14
js/JQuery-Tests.js

@@ -1,30 +1,32 @@
 smalltalk.addClass('JQueryTest', smalltalk.TestCase, ['document'], 'JQuery-Tests');
 smalltalk.addMethod(
-'_testFind',
+'_setUp',
 smalltalk.method({
-selector: 'testFind',
-category: 'tests',
+selector: 'setUp',
+category: 'running',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_equals_", ["James", smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li.firstname"]), "_html", [])]);
+self['@document']=unescape("%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E");
 return self;},
-source: unescape('testFind%0A%09self%20%0A%09%09assert%3A%20%27James%27%20%0A%09%09equals%3A%20%28document%20asJQuery%20find%3A%20%27li.firstname%27%29%20html.%20'),
-messageSends: ["assert:equals:", "html", "find:", "asJQuery"],
+args: [],
+source: unescape('setUp%0A%09document%20%3A%3D%20%27%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E%27.'),
+messageSends: [],
 referencedClasses: []
 }),
 smalltalk.JQueryTest);
 
 smalltalk.addMethod(
-'_setUp',
+'_testFind',
 smalltalk.method({
-selector: 'setUp',
-category: 'running',
+selector: 'testFind',
+category: 'tests',
 fn: function (){
 var self=this;
-self['@document']=unescape("%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E");
+smalltalk.send(self, "_assert_equals_", ["James", smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li.firstname"]), "_html", [])]);
 return self;},
-source: unescape('setUp%0A%09document%20%3A%3D%20%27%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E%27.'),
-messageSends: [],
+args: [],
+source: unescape('testFind%0A%09self%20%0A%09%09assert%3A%20%27James%27%20%0A%09%09equals%3A%20%28document%20asJQuery%20find%3A%20%27li.firstname%27%29%20html.'),
+messageSends: ["assert:equals:", "html", "find:", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.JQueryTest);
@@ -37,10 +39,11 @@ category: 'tests',
 fn: function (){
 var self=this;
 var classes=nil;
-classes=smalltalk.send(smalltalk.Array, "_new", []);
-smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li"]), "_each_", [(function(index, element){return smalltalk.send(classes, "_add_", [smalltalk.send(smalltalk.send(smalltalk.JQuery, "_fromElement_", [element]), "_attr_", ["class"])]);})]);
+classes=smalltalk.send((smalltalk.Array || Array), "_new", []);
+smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li"]), "_each_", [(function(index, element){return smalltalk.send(classes, "_add_", [smalltalk.send(smalltalk.send((smalltalk.JQuery || JQuery), "_fromElement_", [element]), "_attr_", ["class"])]);})]);
 smalltalk.send(self, "_assert_equals_", [smalltalk.send(["firstname", "lastname"], "_printString", []), smalltalk.send(classes, "_printString", [])]);
 return self;},
+args: [],
 source: unescape('testEach%0A%09%7Cclasses%7C%0A%09classes%20%3A%3D%20Array%20new.%0A%0A%09%28document%20asJQuery%20find%3A%20%27li%27%29%20each%3A%20%5B%3Aindex%20%3Aelement%7C%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%20%20%09classes%20add%3A%20%28%28JQuery%20fromElement%3Aelement%29%20attr%3A%20%27class%27%29%5D.%0A%09self%20%0A%09%09assert%3A%20%23%28%27firstname%27%20%27lastname%27%29%20printString%0A%09%09equals%3A%20classes%20printString'),
 messageSends: ["new", "each:", "find:", "asJQuery", "add:", "attr:", "fromElement:", "assert:equals:", "printString"],
 referencedClasses: [smalltalk.Array,smalltalk.JQuery]

+ 80 - 80
js/JQuery.deploy.js

@@ -353,232 +353,232 @@ return self;}
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_do_',
+'_fadeIn',
 smalltalk.method({
-selector: 'do:',
-fn: function (aBlock){
+selector: 'fadeIn',
+fn: function (){
 var self=this;
-smalltalk.send(self, "_elementsDo_", [(function(anElement){return smalltalk.send(aBlock, "_value_", [smalltalk.send((smalltalk.JQuery || JQuery), "_fromElement_", [anElement])]);})]);
+smalltalk.send(self, "_call_", ["fadeIn"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_focus',
+'_slideDown',
 smalltalk.method({
-selector: 'focus',
+selector: 'slideDown',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_call_", ["focus"]);
+smalltalk.send(self, "_call_", ["slideDown"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_show',
+'_fadeInSlow',
 smalltalk.method({
-selector: 'show',
+selector: 'fadeInSlow',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_call_", ["show"]);
+smalltalk.send(self, "_call_withArgument_", ["fadeIn", "slow"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_hide',
+'_fadeOut',
 smalltalk.method({
-selector: 'hide',
+selector: 'fadeOut',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_call_", ["hide"]);
+smalltalk.send(self, "_call_", ["fadeOut"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_remove',
+'_fadeOutSlow',
 smalltalk.method({
-selector: 'remove',
+selector: 'fadeOutSlow',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_call_", ["remove"]);
+smalltalk.send(self, "_call_withArgument_", ["fadeOut", "slow"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_on_do_',
+'_slideUp',
 smalltalk.method({
-selector: 'on:do:',
-fn: function (anEventString, aBlock){
+selector: 'slideUp',
+fn: function (){
 var self=this;
-self['@jquery'].bind(anEventString, function(e){aBlock(e, self)});
+smalltalk.send(self, "_call_", ["slideUp"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_removeEvents_',
+'_fadeOut_do_',
 smalltalk.method({
-selector: 'removeEvents:',
-fn: function (aString){
+selector: 'fadeOut:do:',
+fn: function (aString, aBlock){
 var self=this;
-smalltalk.send(self, "_call_withArgument_", ["unbind", aString]);
+self['@jquery'].fadeOut(aString, aBlock);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_initializeWithJQueryObject_',
+'_do_',
 smalltalk.method({
-selector: 'initializeWithJQueryObject:',
-fn: function (anObject){
+selector: 'do:',
+fn: function (aBlock){
 var self=this;
-self['@jquery']=anObject;
+smalltalk.send(self, "_elementsDo_", [(function(anElement){return smalltalk.send(aBlock, "_value_", [smalltalk.send((smalltalk.JQuery || JQuery), "_fromElement_", [anElement])]);})]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_call_',
+'_focus',
 smalltalk.method({
-selector: 'call:',
-fn: function (aString){
+selector: 'focus',
+fn: function (){
 var self=this;
-return self['@jquery'][aString]();
+smalltalk.send(self, "_call_", ["focus"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_call_withArgument_',
+'_show',
 smalltalk.method({
-selector: 'call:withArgument:',
-fn: function (aString, anObject){
+selector: 'show',
+fn: function (){
 var self=this;
-return self['@jquery'][aString](anObject);
+smalltalk.send(self, "_call_", ["show"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_elementsDo_',
+'_hide',
 smalltalk.method({
-selector: 'elementsDo:',
-fn: function (aBlock){
+selector: 'hide',
+fn: function (){
 var self=this;
-self['@jquery'].each(function(index, element){aBlock(element, self)});
+smalltalk.send(self, "_call_", ["hide"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_hasClass_',
+'_remove',
 smalltalk.method({
-selector: 'hasClass:',
-fn: function (aString){
+selector: 'remove',
+fn: function (){
 var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["hasClass", aString]);
+smalltalk.send(self, "_call_", ["remove"]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_find_',
+'_on_do_',
 smalltalk.method({
-selector: 'find:',
-fn: function (aSelector){
+selector: 'on:do:',
+fn: function (anEventString, aBlock){
 var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["find", aSelector]);
+self['@jquery'].bind(anEventString, function(e){aBlock(e, self)});
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_onLoadDo_',
+'_removeEvents_',
 smalltalk.method({
-selector: 'onLoadDo:',
-fn: function (aBlock){
+selector: 'removeEvents:',
+fn: function (aString){
 var self=this;
-smalltalk.send(self, "_call_withArgument_", ["load", aBlock]);
+smalltalk.send(self, "_call_withArgument_", ["unbind", aString]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_fadeIn',
+'_onLoadDo_',
 smalltalk.method({
-selector: 'fadeIn',
-fn: function (){
+selector: 'onLoadDo:',
+fn: function (aBlock){
 var self=this;
-smalltalk.send(self, "_call_", ["fadeIn"]);
+smalltalk.send(self, "_call_withArgument_", ["load", aBlock]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_slideDown',
+'_initializeWithJQueryObject_',
 smalltalk.method({
-selector: 'slideDown',
-fn: function (){
+selector: 'initializeWithJQueryObject:',
+fn: function (anObject){
 var self=this;
-smalltalk.send(self, "_call_", ["slideDown"]);
+self['@jquery']=anObject;
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_fadeInSlow',
+'_call_',
 smalltalk.method({
-selector: 'fadeInSlow',
-fn: function (){
+selector: 'call:',
+fn: function (aString){
 var self=this;
-smalltalk.send(self, "_call_withArgument_", ["fadeIn", "slow"]);
+return self['@jquery'][aString]();
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_fadeOut',
+'_call_withArgument_',
 smalltalk.method({
-selector: 'fadeOut',
-fn: function (){
+selector: 'call:withArgument:',
+fn: function (aString, anObject){
 var self=this;
-smalltalk.send(self, "_call_", ["fadeOut"]);
+return self['@jquery'][aString](anObject);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_fadeOutSlow',
+'_elementsDo_',
 smalltalk.method({
-selector: 'fadeOutSlow',
-fn: function (){
+selector: 'elementsDo:',
+fn: function (aBlock){
 var self=this;
-smalltalk.send(self, "_call_withArgument_", ["fadeOut", "slow"]);
+self['@jquery'].each(function(index, element){aBlock(element, self)});
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_slideUp',
+'_hasClass_',
 smalltalk.method({
-selector: 'slideUp',
-fn: function (){
+selector: 'hasClass:',
+fn: function (aString){
 var self=this;
-smalltalk.send(self, "_call_", ["slideUp"]);
+return smalltalk.send(self, "_call_withArgument_", ["hasClass", aString]);
 return self;}
 }),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
-'_fadeOut_do_',
+'_find_',
 smalltalk.method({
-selector: 'fadeOut:do:',
-fn: function (aString, aBlock){
+selector: 'find:',
+fn: function (aSelector){
 var self=this;
-self['@jquery'].fadeOut(aString, aBlock);
+return smalltalk.send(self, "_call_withArgument_", ["find", aSelector]);
 return self;}
 }),
 smalltalk.JQuery);

+ 128 - 128
js/JQuery.js

@@ -512,6 +512,118 @@ referencedClasses: []
 }),
 smalltalk.JQuery);
 
+smalltalk.addMethod(
+'_fadeIn',
+smalltalk.method({
+selector: 'fadeIn',
+category: 'effects',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_call_", ["fadeIn"]);
+return self;},
+args: [],
+source: unescape('fadeIn%0A%20%09self%20call%3A%20%27fadeIn%27'),
+messageSends: ["call:"],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_slideDown',
+smalltalk.method({
+selector: 'slideDown',
+category: 'effects',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_call_", ["slideDown"]);
+return self;},
+args: [],
+source: unescape('slideDown%0A%20%09self%20call%3A%20%27slideDown%27'),
+messageSends: ["call:"],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_fadeInSlow',
+smalltalk.method({
+selector: 'fadeInSlow',
+category: 'effects',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_call_withArgument_", ["fadeIn", "slow"]);
+return self;},
+args: [],
+source: unescape('fadeInSlow%0A%20%09self%20call%3A%20%27fadeIn%27%20withArgument%3A%20%27slow%27'),
+messageSends: ["call:withArgument:"],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_fadeOut',
+smalltalk.method({
+selector: 'fadeOut',
+category: 'effects',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_call_", ["fadeOut"]);
+return self;},
+args: [],
+source: unescape('fadeOut%0A%20%09self%20call%3A%20%27fadeOut%27'),
+messageSends: ["call:"],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_fadeOutSlow',
+smalltalk.method({
+selector: 'fadeOutSlow',
+category: 'effects',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_call_withArgument_", ["fadeOut", "slow"]);
+return self;},
+args: [],
+source: unescape('fadeOutSlow%0A%20%09self%20call%3A%20%27fadeOut%27%20withArgument%3A%20%27slow%27'),
+messageSends: ["call:withArgument:"],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_slideUp',
+smalltalk.method({
+selector: 'slideUp',
+category: 'effects',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_call_", ["slideUp"]);
+return self;},
+args: [],
+source: unescape('slideUp%0A%20%09self%20call%3A%20%27slideUp%27'),
+messageSends: ["call:"],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_fadeOut_do_',
+smalltalk.method({
+selector: 'fadeOut:do:',
+category: 'effects',
+fn: function (aString, aBlock){
+var self=this;
+self['@jquery'].fadeOut(aString, aBlock);
+return self;},
+args: ["aString", "aBlock"],
+source: unescape('fadeOut%3A%20aString%20do%3A%20aBlock%0A%20%20%20%20%3Cself%5B%27@jquery%27%5D.fadeOut%28aString%2C%20aBlock%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
 smalltalk.addMethod(
 '_do_',
 smalltalk.method({
@@ -624,6 +736,22 @@ referencedClasses: []
 }),
 smalltalk.JQuery);
 
+smalltalk.addMethod(
+'_onLoadDo_',
+smalltalk.method({
+selector: 'onLoadDo:',
+category: 'events',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(self, "_call_withArgument_", ["load", aBlock]);
+return self;},
+args: ["aBlock"],
+source: unescape('onLoadDo%3A%20aBlock%0A%09%22Bind%20an%20event%20handler%20to%20the%20%27load%27%20JavaScript%20event.%22%0A%09self%20call%3A%20%27load%27%20withArgument%3A%20aBlock'),
+messageSends: ["call:withArgument:"],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
 smalltalk.addMethod(
 '_initializeWithJQueryObject_',
 smalltalk.method({
@@ -720,134 +848,6 @@ referencedClasses: []
 }),
 smalltalk.JQuery);
 
-smalltalk.addMethod(
-'_onLoadDo_',
-smalltalk.method({
-selector: 'onLoadDo:',
-category: 'events',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["load", aBlock]);
-return self;},
-args: ["aBlock"],
-source: unescape('onLoadDo%3A%20aBlock%0A%09%22Bind%20an%20event%20handler%20to%20the%20%27load%27%20JavaScript%20event.%22%0A%09self%20call%3A%20%27load%27%20withArgument%3A%20aBlock'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeIn',
-smalltalk.method({
-selector: 'fadeIn',
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["fadeIn"]);
-return self;},
-args: [],
-source: unescape('fadeIn%0A%20%09self%20call%3A%20%27fadeIn%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_slideDown',
-smalltalk.method({
-selector: 'slideDown',
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["slideDown"]);
-return self;},
-args: [],
-source: unescape('slideDown%0A%20%09self%20call%3A%20%27slideDown%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeInSlow',
-smalltalk.method({
-selector: 'fadeInSlow',
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["fadeIn", "slow"]);
-return self;},
-args: [],
-source: unescape('fadeInSlow%0A%20%09self%20call%3A%20%27fadeIn%27%20withArgument%3A%20%27slow%27'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeOut',
-smalltalk.method({
-selector: 'fadeOut',
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["fadeOut"]);
-return self;},
-args: [],
-source: unescape('fadeOut%0A%20%09self%20call%3A%20%27fadeOut%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeOutSlow',
-smalltalk.method({
-selector: 'fadeOutSlow',
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["fadeOut", "slow"]);
-return self;},
-args: [],
-source: unescape('fadeOutSlow%0A%20%09self%20call%3A%20%27fadeOut%27%20withArgument%3A%20%27slow%27'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_slideUp',
-smalltalk.method({
-selector: 'slideUp',
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["slideUp"]);
-return self;},
-args: [],
-source: unescape('slideUp%0A%20%09self%20call%3A%20%27slideUp%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeOut_do_',
-smalltalk.method({
-selector: 'fadeOut:do:',
-category: 'effects',
-fn: function (aString, aBlock){
-var self=this;
-self['@jquery'].fadeOut(aString, aBlock);
-return self;},
-args: ["aString", "aBlock"],
-source: unescape('fadeOut%3A%20aString%20do%3A%20aBlock%0A%20%20%20%20%3Cself%5B%27@jquery%27%5D.fadeOut%28aString%2C%20aBlock%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
 
 smalltalk.addMethod(
 '_fromString_',

+ 221 - 2
js/Kernel-Tests.deploy.js

@@ -16,7 +16,7 @@ smalltalk.method({
 selector: 'testStreamContents',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(smalltalk.String, "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
+smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
 return self;}
 }),
 smalltalk.StringTest);
@@ -33,6 +33,21 @@ return self;}
 }),
 smalltalk.StringTest);
 
+smalltalk.addMethod(
+'_testEquality',
+smalltalk.method({
+selector: 'testEquality',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", ["hello"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", ["world"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", [smalltalk.send("hello", "_yourself", [])])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq", ["hello"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
+return self;}
+}),
+smalltalk.StringTest);
+
 
 
 smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
@@ -42,7 +57,40 @@ smalltalk.method({
 selector: 'testPrintString',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_equals_", [unescape("a%20Dictionary%28%27firstname%27%20-%3E%20%27James%27%20%2C%20%27lastname%27%20-%3E%20%27Bond%27%29"), (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send(smalltalk.Dictionary, "_new", []))]);
+smalltalk.send(self, "_assert_equals_", [unescape("a%20Dictionary%28%27firstname%27%20-%3E%20%27James%27%20%2C%20%27lastname%27%20-%3E%20%27Bond%27%29"), (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []))]);
+return self;}
+}),
+smalltalk.DictionaryTest);
+
+smalltalk.addMethod(
+'_testEquality',
+smalltalk.method({
+selector: 'testEquality',
+fn: function (){
+var self=this;
+var d1=nil;
+var d2=nil;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])])]);
+d1=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(self, "_assert_", [smalltalk.send(d1, "__eq", [d2])]);
+d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (3)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
+d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
+d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);smalltalk.send($rec, "_at_put_", [(3), (4)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
+return self;}
+}),
+smalltalk.DictionaryTest);
+
+smalltalk.addMethod(
+'_testDynamicDictionaries',
+smalltalk.method({
+selector: 'testDynamicDictionaries',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.Dictionary._fromPairs_([smalltalk.send((1), "__minus_gt", ["hello"]),smalltalk.send((2), "__minus_gt", ["world"])]), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_with_with_", [smalltalk.send((1), "__minus_gt", ["hello"]), smalltalk.send((2), "__minus_gt", ["world"])])])]);
 return self;}
 }),
 smalltalk.DictionaryTest);
@@ -64,5 +112,176 @@ return self;}
 }),
 smalltalk.BooleanTest);
 
+smalltalk.addMethod(
+'_testEquality',
+smalltalk.method({
+selector: 'testEquality',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_deny_", [(0) == false]);
+smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [false])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [""])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq", [true])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [true])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq", [false])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq", [false])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [true])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [smalltalk.send(true, "_yourself", [])])]);
+return self;}
+}),
+smalltalk.BooleanTest);
+
+smalltalk.addMethod(
+'_testLogicKeywords',
+smalltalk.method({
+selector: 'testLogicKeywords',
+fn: function (){
+var self=this;
+(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return true;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_and_", [(function(){return false;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return false;})])]);})(self);
+(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return true;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return false;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_or_", [(function(){return false;})])]);})(self);
+(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return false;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return (1) > (2);})])]);})(self);
+(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return false;})])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return (1) > (2);})])]);})(self);
+return self;}
+}),
+smalltalk.BooleanTest);
+
+smalltalk.addMethod(
+'_testIfTrueIfFalse',
+smalltalk.method({
+selector: 'testIfTrueIfFalse',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})]), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})]), "__eq", [nil])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})]), "__eq", [nil])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})]), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block2"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block2"])]);
+return self;}
+}),
+smalltalk.BooleanTest);
+
+
+
+smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testEquality',
+smalltalk.method({
+selector: 'testEquality',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [(1) == (1)]);
+smalltalk.send(self, "_assert_", [(0) == (0)]);
+smalltalk.send(self, "_deny_", [(1) == (0)]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [(1)])]);
+smalltalk.send(self, "_assert_", [(1) == smalltalk.send((1), "_yourself", [])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [smalltalk.send((1), "_yourself", [])])]);
+smalltalk.send(self, "_deny_", [(0) == false]);
+smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
+smalltalk.send(self, "_deny_", [(0) == ""]);
+return self;}
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testArithmetic',
+smalltalk.method({
+selector: 'testArithmetic',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send((1.5) + (1), "__eq", [(2.5)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)]), "__eq", [(9)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
+return self;}
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testRounded',
+smalltalk.method({
+selector: 'testRounded',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_rounded", []), "__eq", [(3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_rounded", []), "__eq", [(3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_rounded", []), "__eq", [(4)])]);
+return self;}
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testNegated',
+smalltalk.method({
+selector: 'testNegated',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__eq", [(-3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-3), "_negated", []), "__eq", [(3)])]);
+return self;}
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testComparison',
+smalltalk.method({
+selector: 'testComparison',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [(3) > (2)]);
+smalltalk.send(self, "_assert_", [(2) < (3)]);
+smalltalk.send(self, "_deny_", [(3) < (2)]);
+smalltalk.send(self, "_deny_", [(2) > (3)]);
+smalltalk.send(self, "_assert_", [(3) >= (3)]);
+smalltalk.send(self, "_assert_", [(3.1) >= (3)]);
+smalltalk.send(self, "_assert_", [(3) <= (3)]);
+smalltalk.send(self, "_assert_", [(3) <= (3.1)]);
+return self;}
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testTruncated',
+smalltalk.method({
+selector: 'testTruncated',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_truncated", []), "__eq", [(3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_truncated", []), "__eq", [(3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_truncated", []), "__eq", [(3)])]);
+return self;}
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testPrintShowingDecimalPlaces',
+smalltalk.method({
+selector: 'testPrintShowingDecimalPlaces',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
+smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
+smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
+return self;}
+}),
+smalltalk.NumberTest);
+
 
 

+ 294 - 5
js/Kernel-Tests.js

@@ -8,6 +8,7 @@ fn: function (){
 var self=this;
 smalltalk.send(self, "_assert_equals_", [unescape("hello%2Cworld"), smalltalk.send(unescape("%2C"), "_join_", [["hello", "world"]])]);
 return self;},
+args: [],
 source: unescape('testJoin%0A%09self%20assert%3A%20%27hello%2Cworld%27%20equals%3A%20%28%27%2C%27%20join%3A%20%23%28%27hello%27%20%27world%27%29%29'),
 messageSends: ["assert:equals:", "join:"],
 referencedClasses: []
@@ -21,9 +22,10 @@ selector: 'testStreamContents',
 category: 'tests',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(smalltalk.String, "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
+smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
 return self;},
-source: unescape('testStreamContents%0A%09self%20%0A%09%09assert%3A%20%27hello%20world%27%20%0A%09%09equals%3A%20%28String%20streamContents%3A%20%5B%3AaStream%7C%20aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27hello%27%3B%20space%3B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27world%27%5D%29%20'),
+args: [],
+source: unescape('testStreamContents%0A%09self%20%0A%09%09assert%3A%20%27hello%20world%27%20%0A%09%09equals%3A%20%28String%20streamContents%3A%20%5B%3AaStream%7C%20aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27hello%27%3B%20space%3B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27world%27%5D%29'),
 messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"],
 referencedClasses: [smalltalk.String]
 }),
@@ -39,12 +41,33 @@ var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send("jtalk", "_includesSubString_", ["alk"])]);
 smalltalk.send(self, "_deny_", [smalltalk.send("jtalk", "_includesSubString_", ["zork"])]);
 return self;},
+args: [],
 source: unescape('testIncludesSubString%0A%09self%20assert%3A%20%28%27jtalk%27%20includesSubString%3A%20%27alk%27%29.%0A%09self%20deny%3A%20%28%27jtalk%27%20includesSubString%3A%20%27zork%27%29.'),
 messageSends: ["assert:", "includesSubString:", "deny:"],
 referencedClasses: []
 }),
 smalltalk.StringTest);
 
+smalltalk.addMethod(
+'_testEquality',
+smalltalk.method({
+selector: 'testEquality',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", ["hello"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", ["world"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", [smalltalk.send("hello", "_yourself", [])])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq", ["hello"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
+return self;},
+args: [],
+source: unescape('testEquality%0A%09self%20assert%3A%20%27hello%27%20%3D%20%27hello%27.%0A%09self%20deny%3A%20%27hello%27%20%3D%20%27world%27.%0A%0A%09self%20assert%3A%20%27hello%27%20%20%3D%20%27hello%27%20yourself.%0A%09self%20assert%3A%20%27hello%27%20yourself%20%3D%20%27hello%27.%0A%0A%09%22test%20JS%20falsy%20value%22%0A%09self%20deny%3A%20%27%27%20%3D%200'),
+messageSends: ["assert:", unescape("%3D"), "deny:", "yourself"],
+referencedClasses: []
+}),
+smalltalk.StringTest);
+
 
 
 smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
@@ -55,14 +78,58 @@ selector: 'testPrintString',
 category: 'tests',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_equals_", [unescape("a%20Dictionary%28%27firstname%27%20-%3E%20%27James%27%20%2C%20%27lastname%27%20-%3E%20%27Bond%27%29"), (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send(smalltalk.Dictionary, "_new", []))]);
+smalltalk.send(self, "_assert_equals_", [unescape("a%20Dictionary%28%27firstname%27%20-%3E%20%27James%27%20%2C%20%27lastname%27%20-%3E%20%27Bond%27%29"), (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []))]);
 return self;},
-source: unescape('testPrintString%0A%09self%20%0A%09%09assert%3A%20%27a%20Dictionary%28%27%27firstname%27%27%20-%3E%20%27%27James%27%27%20%2C%20%27%27lastname%27%27%20-%3E%20%27%27Bond%27%27%29%27%20%0A%09%09equals%3A%20%28Dictionary%20new%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27firstname%27%20put%3A%20%27James%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27lastname%27%20put%3A%20%27Bond%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09printString%29'),
+args: [],
+source: unescape('testPrintString%0A%09self%0A%09%09assert%3A%20%27a%20Dictionary%28%27%27firstname%27%27%20-%3E%20%27%27James%27%27%20%2C%20%27%27lastname%27%27%20-%3E%20%27%27Bond%27%27%29%27%20%0A%09%09equals%3A%20%28Dictionary%20new%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27firstname%27%20put%3A%20%27James%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27lastname%27%20put%3A%20%27Bond%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09printString%29'),
 messageSends: ["assert:equals:", "at:put:", "printString", "new"],
 referencedClasses: [smalltalk.Dictionary]
 }),
 smalltalk.DictionaryTest);
 
+smalltalk.addMethod(
+'_testEquality',
+smalltalk.method({
+selector: 'testEquality',
+category: 'tests',
+fn: function (){
+var self=this;
+var d1=nil;
+var d2=nil;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])])]);
+d1=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(self, "_assert_", [smalltalk.send(d1, "__eq", [d2])]);
+d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (3)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
+d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
+d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);smalltalk.send($rec, "_at_put_", [(3), (4)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
+return self;},
+args: [],
+source: unescape('testEquality%0A%09%7C%20d1%20d2%20%7C%0A%0A%09self%20assert%3A%20Dictionary%20new%20%3D%20Dictionary%20new.%0A%09%09%0A%09d1%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%202%3B%20yourself.%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%202%3B%20yourself.%0A%09self%20assert%3A%20d1%20%3D%20d2.%0A%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%203%3B%20yourself.%0A%09self%20deny%3A%20d1%20%3D%20d2.%0A%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%202%20put%3A%202%3B%20yourself.%0A%09self%20deny%3A%20d1%20%3D%20d2.%0A%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%202%3B%20at%3A%203%20put%3A%204%3B%20yourself.%0A%09self%20deny%3A%20d1%20%3D%20d2.'),
+messageSends: ["assert:", unescape("%3D"), "new", "at:put:", "yourself", "deny:"],
+referencedClasses: [smalltalk.Dictionary]
+}),
+smalltalk.DictionaryTest);
+
+smalltalk.addMethod(
+'_testDynamicDictionaries',
+smalltalk.method({
+selector: 'testDynamicDictionaries',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.Dictionary._fromPairs_([smalltalk.send((1), "__minus_gt", ["hello"]),smalltalk.send((2), "__minus_gt", ["world"])]), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_with_with_", [smalltalk.send((1), "__minus_gt", ["hello"]), smalltalk.send((2), "__minus_gt", ["world"])])])]);
+return self;},
+args: [],
+source: unescape('testDynamicDictionaries%0A%09self%20assert%3A%20%23%7B1%20-%3E%20%27hello%27.%202%20-%3E%20%27world%27%7D%20%3D%20%28Dictionary%20with%3A%201%20-%3E%20%27hello%27%20with%3A%202%20-%3E%20%27world%27%29'),
+messageSends: ["assert:", unescape("%3D"), unescape("-%3E"), "with:with:"],
+referencedClasses: [smalltalk.Dictionary]
+}),
+smalltalk.DictionaryTest);
+
 
 
 smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
@@ -78,11 +145,233 @@ var self=this;
 (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_&", [(1) > (0)])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [false])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [(1) > (2)])]);})(self);
 (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_|", [(1) > (0)])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [false])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [(1) > (2)])]);})(self);
 return self;},
-source: unescape('testLogic%0A%0A%09%22Trivial%20logic%20table%22%0A%09self%20assert%3A%20%28true%20%26%20true%29%3B%20deny%3A%20%28true%20%26%20false%29%3B%20deny%3A%20%28false%20%26%20true%29%3B%20deny%3A%20%28false%20%26%20false%29.%0A%09self%20assert%3A%20%28true%20%7C%20true%29%3B%20assert%3A%20%28true%20%7C%20false%29%3B%20assert%3A%20%28false%20%7C%20true%29%3B%20deny%3A%20%28false%20%7C%20false%29.%0A%20%20%20%20%20%20%20%20%22Checking%20that%20expressions%20work%20fine%20too%22%0A%09self%20assert%3A%20%28true%20%26%20%281%20%3E%200%29%29%3B%20deny%3A%20%28%281%20%3E%200%29%20%26%20false%29%3B%20deny%3A%20%28%281%20%3E%200%29%20%26%20%281%20%3E%202%29%29.%0A%20%20%20%20%20%20%20%20self%20assert%3A%20%28false%20%7C%20%281%20%3E%200%29%29%3B%20assert%3A%20%28%281%20%3E%200%29%20%7C%20false%29%3B%20assert%3A%20%28%281%20%3E%200%29%20%7C%20%281%20%3E%202%29%29%20'),
+args: [],
+source: unescape('testLogic%0A%20%0A%09%22Trivial%20logic%20table%22%0A%09self%20assert%3A%20%28true%20%26%20true%29%3B%20deny%3A%20%28true%20%26%20false%29%3B%20deny%3A%20%28false%20%26%20true%29%3B%20deny%3A%20%28false%20%26%20false%29.%0A%09self%20assert%3A%20%28true%20%7C%20true%29%3B%20assert%3A%20%28true%20%7C%20false%29%3B%20assert%3A%20%28false%20%7C%20true%29%3B%20deny%3A%20%28false%20%7C%20false%29.%0A%20%20%20%20%20%20%20%20%22Checking%20that%20expressions%20work%20fine%20too%22%0A%09self%20assert%3A%20%28true%20%26%20%281%20%3E%200%29%29%3B%20deny%3A%20%28%281%20%3E%200%29%20%26%20false%29%3B%20deny%3A%20%28%281%20%3E%200%29%20%26%20%281%20%3E%202%29%29.%0A%20%20%20%20%20%20%20%20self%20assert%3A%20%28false%20%7C%20%281%20%3E%200%29%29%3B%20assert%3A%20%28%281%20%3E%200%29%20%7C%20false%29%3B%20assert%3A%20%28%281%20%3E%200%29%20%7C%20%281%20%3E%202%29%29'),
 messageSends: ["assert:", unescape("%26"), "deny:", unescape("%7C"), unescape("%3E")],
 referencedClasses: []
 }),
 smalltalk.BooleanTest);
 
+smalltalk.addMethod(
+'_testEquality',
+smalltalk.method({
+selector: 'testEquality',
+category: 'not yet classified',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_deny_", [(0) == false]);
+smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [false])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [""])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq", [true])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [true])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq", [false])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq", [false])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [true])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [smalltalk.send(true, "_yourself", [])])]);
+return self;},
+args: [],
+source: unescape('testEquality%0A%09%22We%27re%20on%20top%20of%20JS...just%20be%20sure%20to%20check%20the%20basics%21%22%0A%0A%09self%20deny%3A%200%20%3D%20false.%20%0A%09self%20deny%3A%20false%20%3D%200.%0A%09self%20deny%3A%20%27%27%20%3D%20false.%0A%09self%20deny%3A%20false%20%3D%20%27%27.%0A%0A%09self%20assert%3A%20true%20%3D%20true.%0A%09self%20deny%3A%20false%20%3D%20true.%0A%09self%20deny%3A%20true%20%3D%20false.%0A%09self%20assert%3A%20false%20%3D%20false.%0A%0A%09%22JS%20may%20do%20some%20type%20coercing%20after%20sending%20a%20message%22%0A%09self%20assert%3A%20true%20yourself%20%3D%20true.%0A%09self%20assert%3A%20true%20yourself%20%3D%20true%20yourself'),
+messageSends: ["deny:", unescape("%3D"), "assert:", "yourself"],
+referencedClasses: []
+}),
+smalltalk.BooleanTest);
+
+smalltalk.addMethod(
+'_testLogicKeywords',
+smalltalk.method({
+selector: 'testLogicKeywords',
+category: 'not yet classified',
+fn: function (){
+var self=this;
+(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return true;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_and_", [(function(){return false;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return false;})])]);})(self);
+(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return true;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return false;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_or_", [(function(){return false;})])]);})(self);
+(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return false;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return (1) > (2);})])]);})(self);
+(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return false;})])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return (1) > (2);})])]);})(self);
+return self;},
+args: [],
+source: unescape('testLogicKeywords%0A%20%0A%09%22Trivial%20logic%20table%22%0A%09self%20%0A%09%09assert%3A%20%28true%20and%3A%20%5B%20true%5D%29%3B%20%0A%09%09deny%3A%20%28true%20and%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09deny%3A%20%28false%20and%3A%20%5B%20true%20%5D%29%3B%20%0A%09%09deny%3A%20%28false%20and%3A%20%5B%20false%20%5D%29.%0A%09self%20%0A%09%09assert%3A%20%28true%20or%3A%20%5B%20true%20%5D%29%3B%20%0A%09%09assert%3A%20%28true%20or%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09assert%3A%20%28false%20or%3A%20%5B%20true%20%5D%29%3B%20%0A%09%09deny%3A%20%28false%20or%3A%20%5B%20false%20%5D%29.%0A%20%20%20%20%20%20%20%20%0A%09%22Checking%20that%20expressions%20work%20fine%20too%22%0A%09self%20%0A%09%09assert%3A%20%28true%20and%3A%20%5B%201%20%3E%200%20%5D%29%3B%20%0A%09%09deny%3A%20%28%281%20%3E%200%29%20and%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09deny%3A%20%28%281%20%3E%200%29%20and%3A%20%5B%201%20%3E%202%20%5D%29.%0A%20%20%20%20%20%20%20%20self%20%0A%09%09assert%3A%20%28false%20or%3A%20%5B%201%20%3E%200%20%5D%29%3B%20%0A%09%09assert%3A%20%28%281%20%3E%200%29%20or%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09assert%3A%20%28%281%20%3E%200%29%20or%3A%20%5B%201%20%3E%202%20%5D%29'),
+messageSends: ["assert:", "and:", "deny:", "or:", unescape("%3E")],
+referencedClasses: []
+}),
+smalltalk.BooleanTest);
+
+smalltalk.addMethod(
+'_testIfTrueIfFalse',
+smalltalk.method({
+selector: 'testIfTrueIfFalse',
+category: 'not yet classified',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})]), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})]), "__eq", [nil])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})]), "__eq", [nil])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})]), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block2"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block2"])]);
+return self;},
+args: [],
+source: unescape('testIfTrueIfFalse%0A%20%0A%09self%20assert%3A%20%28true%20ifTrue%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20%27alternative%20block%27.%0A%09self%20assert%3A%20%28true%20ifFalse%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20nil.%0A%0A%09self%20assert%3A%20%28false%20ifTrue%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20nil.%0A%09self%20assert%3A%20%28false%20ifFalse%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20%27alternative%20block%27.%0A%0A%09self%20assert%3A%20%28false%20ifTrue%3A%20%5B%27alternative%20block%27%5D%20ifFalse%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block2%27.%0A%09self%20assert%3A%20%28false%20ifFalse%3A%20%5B%27alternative%20block%27%5D%20ifTrue%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block%27.%0A%0A%09self%20assert%3A%20%28true%20ifTrue%3A%20%5B%27alternative%20block%27%5D%20ifFalse%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block%27.%0A%09self%20assert%3A%20%28true%20ifFalse%3A%20%5B%27alternative%20block%27%5D%20ifTrue%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block2%27.'),
+messageSends: ["assert:", unescape("%3D"), "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"],
+referencedClasses: []
+}),
+smalltalk.BooleanTest);
+
+
+
+smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testEquality',
+smalltalk.method({
+selector: 'testEquality',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [(1) == (1)]);
+smalltalk.send(self, "_assert_", [(0) == (0)]);
+smalltalk.send(self, "_deny_", [(1) == (0)]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [(1)])]);
+smalltalk.send(self, "_assert_", [(1) == smalltalk.send((1), "_yourself", [])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [smalltalk.send((1), "_yourself", [])])]);
+smalltalk.send(self, "_deny_", [(0) == false]);
+smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
+smalltalk.send(self, "_deny_", [(0) == ""]);
+return self;},
+args: [],
+source: unescape('testEquality%0A%09self%20assert%3A%201%20%3D%201.%0A%09self%20assert%3A%200%20%3D%200.%0A%09self%20deny%3A%201%20%3D%200.%0A%0A%09self%20assert%3A%201%20yourself%20%3D%201.%0A%09self%20assert%3A%201%20%3D%201%20yourself.%0A%09self%20assert%3A%201%20yourself%20%3D%201%20yourself.%0A%09%0A%09self%20deny%3A%200%20%3D%20false.%0A%09self%20deny%3A%20false%20%3D%200.%0A%09self%20deny%3A%20%27%27%20%3D%200.%0A%09self%20deny%3A%200%20%3D%20%27%27'),
+messageSends: ["assert:", unescape("%3D"), "deny:", "yourself"],
+referencedClasses: []
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testArithmetic',
+smalltalk.method({
+selector: 'testArithmetic',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send((1.5) + (1), "__eq", [(2.5)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)]), "__eq", [(9)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
+return self;},
+args: [],
+source: unescape('testArithmetic%0A%09%0A%09%22We%20rely%20on%20JS%20here%2C%20so%20we%20won%27t%20test%20complex%20behavior%2C%20just%20check%20if%20%0A%09message%20sends%20are%20corrects%22%0A%0A%09self%20assert%3A%201.5%20+%201%20%3D%202.5.%0A%09self%20assert%3A%202%20-%201%20%3D%201.%0A%09self%20assert%3A%20-2%20-%201%20%3D%20-3.%0A%09self%20assert%3A%2012%20/%202%20%3D%206.%0A%09self%20assert%3A%203%20*%204%20%3D%2012.%0A%0A%09%22Simple%20parenthesis%20and%20execution%20order%22%0A%0A%09self%20assert%3A%201%20+%202%20*%203%20%3D%209.%0A%09self%20assert%3A%201%20+%20%282%20*%203%29%20%3D%207'),
+messageSends: ["assert:", unescape("%3D"), unescape("+"), unescape("-"), unescape("/"), unescape("*")],
+referencedClasses: []
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testRounded',
+smalltalk.method({
+selector: 'testRounded',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_rounded", []), "__eq", [(3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_rounded", []), "__eq", [(3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_rounded", []), "__eq", [(4)])]);
+return self;},
+args: [],
+source: unescape('testRounded%0A%09%0A%09self%20assert%3A%203%20rounded%20%3D%203.%0A%09self%20assert%3A%203.212%20rounded%20%3D%203.%0A%09self%20assert%3A%203.51%20rounded%20%3D%204'),
+messageSends: ["assert:", unescape("%3D"), "rounded"],
+referencedClasses: []
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testNegated',
+smalltalk.method({
+selector: 'testNegated',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__eq", [(-3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-3), "_negated", []), "__eq", [(3)])]);
+return self;},
+args: [],
+source: unescape('testNegated%0A%09self%20assert%3A%203%20negated%20%3D%20-3.%0A%09self%20assert%3A%20-3%20negated%20%3D%203'),
+messageSends: ["assert:", unescape("%3D"), "negated"],
+referencedClasses: []
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testComparison',
+smalltalk.method({
+selector: 'testComparison',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [(3) > (2)]);
+smalltalk.send(self, "_assert_", [(2) < (3)]);
+smalltalk.send(self, "_deny_", [(3) < (2)]);
+smalltalk.send(self, "_deny_", [(2) > (3)]);
+smalltalk.send(self, "_assert_", [(3) >= (3)]);
+smalltalk.send(self, "_assert_", [(3.1) >= (3)]);
+smalltalk.send(self, "_assert_", [(3) <= (3)]);
+smalltalk.send(self, "_assert_", [(3) <= (3.1)]);
+return self;},
+args: [],
+source: unescape('testComparison%0A%0A%09self%20assert%3A%203%20%3E%202.%0A%09self%20assert%3A%202%20%3C%203.%0A%09%0A%09self%20deny%3A%203%20%3C%202.%0A%09self%20deny%3A%202%20%3E%203.%0A%0A%09self%20assert%3A%203%20%3E%3D%203.%0A%09self%20assert%3A%203.1%20%3E%3D%203.%0A%09self%20assert%3A%203%20%3C%3D%203.%0A%09self%20assert%3A%203%20%3C%3D%203.1'),
+messageSends: ["assert:", unescape("%3E"), unescape("%3C"), "deny:", unescape("%3E%3D"), unescape("%3C%3D")],
+referencedClasses: []
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testTruncated',
+smalltalk.method({
+selector: 'testTruncated',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_truncated", []), "__eq", [(3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_truncated", []), "__eq", [(3)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_truncated", []), "__eq", [(3)])]);
+return self;},
+args: [],
+source: unescape('testTruncated%0A%09%0A%09self%20assert%3A%203%20truncated%20%3D%203.%0A%09self%20assert%3A%203.212%20truncated%20%3D%203.%0A%09self%20assert%3A%203.51%20truncated%20%3D%203'),
+messageSends: ["assert:", unescape("%3D"), "truncated"],
+referencedClasses: []
+}),
+smalltalk.NumberTest);
+
+smalltalk.addMethod(
+'_testPrintShowingDecimalPlaces',
+smalltalk.method({
+selector: 'testPrintShowingDecimalPlaces',
+category: 'not yet classified',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
+smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
+smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
+return self;},
+args: [],
+source: unescape('testPrintShowingDecimalPlaces%0A%09self%20assert%3A%20%2723.00%27%20equals%3A%20%2823%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%2723.57%27%20equals%3A%20%2823.5698%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-234.56700%27%20equals%3A%28%20234.567%20negated%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%2723%27%20equals%3A%20%2823.4567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%2724%27%20equals%3A%20%2823.5567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-23%27%20equals%3A%20%2823.4567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-24%27%20equals%3A%20%2823.5567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27100000000.0%27%20equals%3A%20%28100000000%20printShowingDecimalPlaces%3A%201%29.%0A%09self%20assert%3A%20%270.98000%27%20equals%3A%20%280.98%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%27-0.98%27%20equals%3A%20%280.98%20negated%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%272.57%27%20equals%3A%20%282.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-2.57%27%20equals%3A%20%28-2.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%270.00%27%20equals%3A%20%280%20printShowingDecimalPlaces%3A%202%29.'),
+messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"],
+referencedClasses: []
+}),
+smalltalk.NumberTest);
+
 
 

+ 150 - 7
js/Kernel.deploy.js

@@ -5,7 +5,7 @@ smalltalk.method({
 selector: '=',
 fn: function (anObject){
 var self=this;
-return self == anObject;
+return smalltalk.send(self, "__eq_eq", [anObject]);
 return self;}
 }),
 smalltalk.Object);
@@ -526,6 +526,28 @@ return self;}
 }),
 smalltalk.Object);
 
+smalltalk.addMethod(
+'__eq_eq',
+smalltalk.method({
+selector: '==',
+fn: function (anObject){
+var self=this;
+return self === anObject;
+return self;}
+}),
+smalltalk.Object);
+
+smalltalk.addMethod(
+'_~~',
+smalltalk.method({
+selector: '~~',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
+return self;}
+}),
+smalltalk.Object);
+
 
 smalltalk.addMethod(
 '_initialize',
@@ -1305,8 +1327,10 @@ smalltalk.method({
 selector: '=',
 fn: function (aNumber){
 var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aNumber, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
 return Number(self) == aNumber;
-return self;}
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
 }),
 smalltalk.Number);
 
@@ -1643,6 +1667,30 @@ return self;}
 }),
 smalltalk.Number);
 
+smalltalk.addMethod(
+'__eq_eq',
+smalltalk.method({
+selector: '==',
+fn: function (aNumber){
+var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aNumber, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]);
+return Number(self) === Number(aNumber);
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
+}),
+smalltalk.Number);
+
+smalltalk.addMethod(
+'_printShowingDecimalPlaces_',
+smalltalk.method({
+selector: 'printShowingDecimalPlaces:',
+fn: function (placesDesired){
+var self=this;
+return self.toFixed(placesDesired);
+return self;}
+}),
+smalltalk.Number);
+
 
 smalltalk.addMethod(
 '_pi',
@@ -1842,8 +1890,10 @@ smalltalk.method({
 selector: '=',
 fn: function (aBoolean){
 var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
 return Boolean(self == true) == aBoolean;
-return self;}
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
 }),
 smalltalk.Boolean);
 
@@ -2008,6 +2058,19 @@ return self;}
 }),
 smalltalk.Boolean);
 
+smalltalk.addMethod(
+'__eq_eq',
+smalltalk.method({
+selector: '==',
+fn: function (aBoolean){
+var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]);
+return Boolean(self == true) === Boolean(aBoolean == true);
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
+}),
+smalltalk.Boolean);
+
 
 
 smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
@@ -2917,6 +2980,28 @@ return self;}
 }),
 smalltalk.Collection);
 
+smalltalk.addMethod(
+'_ifNotEmpty_',
+smalltalk.method({
+selector: 'ifNotEmpty:',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
+return self;}
+}),
+smalltalk.Collection);
+
+smalltalk.addMethod(
+'_ifEmpty_',
+smalltalk.method({
+selector: 'ifEmpty:',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_ifTrue_", [aBlock]);
+return self;}
+}),
+smalltalk.Collection);
+
 
 smalltalk.addMethod(
 '_streamClass',
@@ -3203,8 +3288,10 @@ smalltalk.method({
 selector: '=',
 fn: function (aString){
 var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
 return String(self) == aString;
-return self;}
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
 }),
 smalltalk.String);
 
@@ -3740,6 +3827,19 @@ return self;}
 }),
 smalltalk.String);
 
+smalltalk.addMethod(
+'__eq_eq',
+smalltalk.method({
+selector: '==',
+fn: function (aString){
+var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]);
+return String(self) === String(aString);
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
+}),
+smalltalk.String);
+
 
 smalltalk.addMethod(
 '_streamClass',
@@ -4075,6 +4175,20 @@ return self;}
 }),
 smalltalk.Array);
 
+smalltalk.addMethod(
+'__eq',
+smalltalk.method({
+selector: '=',
+fn: function (aCollection){
+var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aCollection, "_size", [])]);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
+smalltalk.send(self, "_withIndexDo_", [(function(each, i){return (($receiver = smalltalk.send(smalltalk.send(aCollection, "_at_", [i]), "__eq", [each])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);})]);
+(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
+}),
+smalltalk.Array);
+
 
 
 smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
@@ -4339,8 +4453,8 @@ selector: '=',
 fn: function (aDictionary){
 var self=this;
 try{(($receiver = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aDictionary, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
-smalltalk.send(self, "_associationsDo_", [(function(assoc){return (($receiver = smalltalk.send(smalltalk.send(aDictionary, "_at_ifAbsent_", [smalltalk.send(assoc, "_key", []), (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]), "__eq", [smalltalk.send(assoc, "_value", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);})]);
-(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
+(($receiver = smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aDictionary, "_size", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
+(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
 return self;
 } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
 }),
@@ -5545,7 +5659,7 @@ smalltalk.method({
 selector: 'current',
 fn: function (){
 var self=this;
-return self['@current'];
+return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return self['@current']=smalltalk.send(self, "_new", []);})() : $receiver;
 return self;}
 }),
 smalltalk.ErrorHandler.klass);
@@ -5636,6 +5750,24 @@ return self;}
 }),
 smalltalk.JSObjectProxy);
 
+smalltalk.addMethod(
+'_doesNotUnderstand_',
+smalltalk.method({
+selector: 'doesNotUnderstand:',
+fn: function (aMessage){
+var self=this;
+var obj=nil;
+var selector=nil;
+var arguments=nil;
+obj=smalltalk.send(self, "_jsObject", []);
+selector=smalltalk.send(aMessage, "_selector", []);
+arguments=smalltalk.send(aMessage, "_arguments", []);
+if(obj[selector]) {return smalltalk.send(obj, selector, arguments)};
+smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
+return self;}
+}),
+smalltalk.JSObjectProxy);
+
 
 smalltalk.addMethod(
 '_on_',
@@ -5748,5 +5880,16 @@ return self;}
 }),
 smalltalk.Set);
 
+smalltalk.addMethod(
+'__eq',
+smalltalk.method({
+selector: '=',
+fn: function (aCollection){
+var self=this;
+return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(self['@elements'], "__eq", [smalltalk.send(aCollection, "_asArray", [])]);})]);
+return self;}
+}),
+smalltalk.Set);
+
 
 

+ 247 - 38
js/Kernel.js

@@ -6,11 +6,11 @@ selector: '=',
 category: 'comparing',
 fn: function (anObject){
 var self=this;
-return self == anObject;
+return smalltalk.send(self, "__eq_eq", [anObject]);
 return self;},
 args: ["anObject"],
-source: unescape('%3D%20anObject%0A%09%3Creturn%20self%20%3D%3D%20anObject%3E%20'),
-messageSends: [],
+source: unescape('%3D%20anObject%0A%09%5Eself%20%3D%3D%20anObject'),
+messageSends: [unescape("%3D%3D")],
 referencedClasses: []
 }),
 smalltalk.Object);
@@ -187,7 +187,7 @@ return self;},
 args: ["anObject"],
 source: unescape('-%3E%20anObject%0A%09%5EAssociation%20key%3A%20self%20value%3A%20anObject'),
 messageSends: ["key:value:"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.Association]
 }),
 smalltalk.Object);
 
@@ -377,7 +377,7 @@ var self=this;
 try{aBlock()} catch(e) {anotherBlock(e)};
 return self;},
 args: ["aBlock", "anotherBlock"],
-source: unescape('try%3A%20aBlock%20catch%3A%20anotherBlock%0A%09%3Ctry%7BaBlock%28%29%7D%20catch%28e%29%20%7BanotherBlock%28e%29%7D%3E%20'),
+source: unescape('try%3A%20aBlock%20catch%3A%20anotherBlock%0A%09%3Ctry%7BaBlock%28%29%7D%20catch%28e%29%20%7BanotherBlock%28e%29%7D%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -683,7 +683,7 @@ return self;},
 args: ["aMessage"],
 source: unescape('doesNotUnderstand%3A%20aMessage%0A%09MessageNotUnderstood%20new%0A%09%09receiver%3A%20self%3B%0A%09%09message%3A%20aMessage%3B%0A%09%09signal'),
 messageSends: ["receiver:", "message:", "signal", "new"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.MessageNotUnderstood]
 }),
 smalltalk.Object);
 
@@ -750,12 +750,44 @@ smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smallt
 return result;
 return self;},
 args: ["aString", "aBlock"],
-source: unescape('log%3A%20aString%20block%3A%20aBlock%0A%0A%09%7C%20result%20%7C%0A%09console%20log%3A%20%20aString%2C%20%20%27%20time%3A%20%27%2C%20%28Date%20millisecondsToRun%3A%20%5Bresult%20%3A%3D%20aBlock%20value%5D%29%20printString.%0A%09%5Eresult%0A%0A'),
+source: unescape('log%3A%20aString%20block%3A%20aBlock%0A%0A%09%7C%20result%20%7C%0A%09console%20log%3A%20%20aString%2C%20%20%27%20time%3A%20%27%2C%20%28Date%20millisecondsToRun%3A%20%5Bresult%20%3A%3D%20aBlock%20value%5D%29%20printString.%0A%09%5Eresult'),
 messageSends: ["log:", unescape("%2C"), "printString", "millisecondsToRun:", "value"],
 referencedClasses: [smalltalk.Date]
 }),
 smalltalk.Object);
 
+smalltalk.addMethod(
+'__eq_eq',
+smalltalk.method({
+selector: '==',
+category: 'comparing',
+fn: function (anObject){
+var self=this;
+return self === anObject;
+return self;},
+args: ["anObject"],
+source: unescape('%3D%3D%20anObject%0A%09%3Creturn%20self%20%3D%3D%3D%20anObject%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Object);
+
+smalltalk.addMethod(
+'_~~',
+smalltalk.method({
+selector: '~~',
+category: 'comparing',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
+return self;},
+args: ["anObject"],
+source: unescape('%7E%7E%20anObject%0A%09%5E%28self%20%3D%3D%20anObject%29%20%3D%20false'),
+messageSends: [unescape("%3D"), unescape("%3D%3D")],
+referencedClasses: []
+}),
+smalltalk.Object);
+
 
 smalltalk.addMethod(
 '_initialize',
@@ -900,7 +932,7 @@ code=smalltalk.send((smalltalk.String || String), "_streamContents_", [(function
 return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_messageText_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Parse error on line ", "__comma", [row]), "__comma", [" column "]), "__comma", [col]), "__comma", [" : "]), "__comma", [message]), "__comma", [unescape("%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A")]), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", [code])]);
 return self;},
 args: ["anException", "aString"],
-source: unescape('parseError%3A%20anException%20parsing%3A%20aString%0A%09%7C%20row%20col%20message%20lines%20badLine%20code%20%7C%0A%09%3Crow%20%3D%20anException.line%3B%0A%09col%20%3D%20anException.column%3B%0A%09message%20%3D%20anException.message%3B%3E.%0A%09lines%20%3A%3D%20aString%20lines.%0A%09badLine%20%3A%3D%20lines%20at%3A%20row.%0A%09badLine%20%3A%3D%20%28badLine%20copyFrom%3A%201%20to%3A%20col%20-%201%29%2C%20%27%20%3D%3D%3D%3E%27%2C%20%28badLine%20copyFrom%3A%20%20col%20to%3A%20badLine%20size%29.%0A%09lines%20at%3A%20row%20put%3A%20badLine.%0A%09code%20%3A%3D%20String%20streamContents%3A%20%5B%3As%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20lines%20withIndexDo%3A%20%5B%3Al%20%3Ai%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20nextPutAll%3A%20i%20asString%2C%20%27%3A%20%27%2C%20l%2C%20String%20lf%5D%5D.%0A%09%5E%20Error%20new%20messageText%3A%20%28%27Parse%20error%20on%20line%20%27%20%2C%20row%20%2C%20%27%20column%20%27%20%2C%20col%20%2C%20%27%20%3A%20%27%20%2C%20message%20%2C%20%27%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A%27%20%2C%20String%20lf%2C%20code%29'),
+source: unescape('parseError%3A%20anException%20parsing%3A%20aString%0A%09%7C%20row%20col%20message%20lines%20badLine%20code%20%7C%0A%09%3Crow%20%3D%20anException.line%3B%0A%09col%20%3D%20anException.column%3B%0A%09message%20%3D%20anException.message%3B%3E.%0A%09lines%20%3A%3D%20aString%20lines.%0A%09badLine%20%3A%3D%20lines%20at%3A%20row.%0A%09badLine%20%3A%3D%20%28badLine%20copyFrom%3A%201%20to%3A%20col%20-%201%29%2C%20%27%20%3D%3D%3D%3E%27%2C%20%28badLine%20copyFrom%3A%20%20col%20to%3A%20badLine%20size%29.%0A%09lines%20at%3A%20row%20put%3A%20badLine.%0A%09code%20%3A%3D%20String%20streamContents%3A%20%5B%3As%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20lines%20withIndexDo%3A%20%5B%3Al%20%3Ai%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20nextPutAll%3A%20i%20asString%2C%20%27%3A%20%27%2C%20l%2C%20String%20lf%5D%5D.%0A%09%5E%20Error%20new%20messageText%3A%20%28%27Parse%20error%20on%20line%20%27%20%2C%20row%20%2C%20%27%20column%20%27%20%2C%20col%20%2C%20%27%20%3A%20%27%20%2C%20message%20%2C%20%27%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A%27%20%2C%20String%20lf%2C%20code%29'),
 messageSends: ["lines", "at:", unescape("%2C"), "copyFrom:to:", unescape("-"), "size", "at:put:", "streamContents:", "withIndexDo:", "nextPutAll:", "asString", "lf", "messageText:", "new"],
 referencedClasses: [smalltalk.String,smalltalk.Error]
 }),
@@ -915,6 +947,7 @@ fn: function (){
 var self=this;
 return self.modules.all();
 return self;},
+args: [],
 source: unescape('modules%0A%09%3Creturn%20self.modules.all%28%29%3E'),
 messageSends: [],
 referencedClasses: []
@@ -950,6 +983,7 @@ fn: function (){
 var self=this;
 return self.moduleName || nil;
 return self;},
+args: [],
 source: unescape('name%0A%09%3Creturn%20self.moduleName%20%7C%7C%20nil%3E'),
 messageSends: [],
 referencedClasses: []
@@ -965,6 +999,7 @@ fn: function (){
 var self=this;
 return self.requires || nil;
 return self;},
+args: [],
 source: unescape('requires%0A%09%3Creturn%20self.requires%20%7C%7C%20nil%3E'),
 messageSends: [],
 referencedClasses: []
@@ -980,6 +1015,7 @@ fn: function (aString){
 var self=this;
 return self.moduleName = aString;
 return self;},
+args: ["aString"],
 source: unescape('name%3A%20aString%0A%09%3Creturn%20self.moduleName%20%3D%20aString%3E'),
 messageSends: [],
 referencedClasses: []
@@ -1155,7 +1191,7 @@ return self;},
 args: ["aString"],
 source: unescape('methodsFor%3A%20aString%0A%09%5EClassCategoryReader%20new%0A%09%20%20%20%20class%3A%20self%20category%3A%20aString%3B%0A%09%20%20%20%20yourself'),
 messageSends: ["class:category:", "yourself", "new"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.ClassCategoryReader]
 }),
 smalltalk.Behavior);
 
@@ -1235,7 +1271,7 @@ return self;},
 args: [],
 source: unescape('commentStamp%0A%20%20%20%20%5EClassCommentReader%20new%0A%09class%3A%20self%3B%0A%09yourself'),
 messageSends: ["class:", "yourself", "new"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.ClassCommentReader]
 }),
 smalltalk.Behavior);
 
@@ -1307,7 +1343,7 @@ return self;},
 args: ["aBlock"],
 source: unescape('protocolsDo%3A%20aBlock%0A%09%22Execute%20aBlock%20for%20each%20method%20category%20with%0A%09its%20collection%20of%20methods%20in%20the%20sort%20order%20of%20category%20name.%22%0A%0A%09%7C%20methodsByCategory%20%7C%0A%09methodsByCategory%20%3A%3D%20Dictionary%20new.%0A%09self%20methodDictionary%20values%20do%3A%20%5B%3Am%20%7C%0A%09%09%28methodsByCategory%20at%3A%20m%20category%20ifAbsentPut%3A%20%5BArray%20new%5D%29%0A%20%09%09%09add%3A%20m%5D.%20%0A%09self%20protocols%20do%3A%20%5B%3Acategory%20%7C%0A%09%09aBlock%20value%3A%20category%20value%3A%20%28methodsByCategory%20at%3A%20category%29%5D'),
 messageSends: ["new", "do:", "values", "methodDictionary", "add:", "at:ifAbsentPut:", "category", "protocols", "value:value:", "at:"],
-referencedClasses: [smalltalk.nil,smalltalk.Array]
+referencedClasses: [smalltalk.Dictionary,smalltalk.Array]
 }),
 smalltalk.Behavior);
 
@@ -1409,7 +1445,7 @@ return self;},
 args: ["aString", "anotherString"],
 source: unescape('compile%3A%20aString%20category%3A%20anotherString%0A%09%7C%20method%20%7C%0A%09method%20%3A%3D%20Compiler%20new%20load%3A%20aString%20forClass%3A%20self.%0A%09method%20category%3A%20anotherString.%0A%09self%20addCompiledMethod%3A%20method'),
 messageSends: ["load:forClass:", "new", "category:", "addCompiledMethod:"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.Compiler]
 }),
 smalltalk.Behavior);
 
@@ -1425,6 +1461,7 @@ fn: function (){
 var self=this;
 return (($receiver = smalltalk.send(self, "_module", [])) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_module", []), "_name", []);})();
 return self;},
+args: [],
 source: unescape('category%0A%09%5Eself%20module%20ifNil%3A%20%5B%27unclassified%27%5D%20ifNotNil%3A%20%5Bself%20module%20name%5D'),
 messageSends: ["ifNil:ifNotNil:", "module", "name"],
 referencedClasses: []
@@ -1540,6 +1577,7 @@ fn: function (){
 var self=this;
 return self.module;
 return self;},
+args: [],
 source: unescape('module%0A%09%3Creturn%20self.module%3E'),
 messageSends: [],
 referencedClasses: []
@@ -1555,6 +1593,7 @@ fn: function (aModule){
 var self=this;
 self.module = aModule;
 return self;},
+args: ["aModule"],
 source: unescape('module%3A%20aModule%0A%09%3Cself.module%20%3D%20aModule%3E'),
 messageSends: [],
 referencedClasses: []
@@ -1570,6 +1609,7 @@ fn: function (aString, aString2, aString3){
 var self=this;
 return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_module_", [self, aString, aString2, aString3]);
 return self;},
+args: ["aString", "aString2", "aString3"],
 source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20module%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20module%3A%20aString3'),
 messageSends: ["superclass:subclass:instanceVariableNames:module:", "new"],
 referencedClasses: [smalltalk.ClassBuilder]
@@ -1607,7 +1647,7 @@ return self;},
 args: ["aCollection"],
 source: unescape('instanceVariableNames%3A%20aCollection%0A%09ClassBuilder%20new%0A%09%20%20%20%20class%3A%20self%20instanceVariableNames%3A%20aCollection'),
 messageSends: ["class:instanceVariableNames:", "new"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.ClassBuilder]
 }),
 smalltalk.Metaclass);
 
@@ -1848,11 +1888,13 @@ selector: '=',
 category: 'comparing',
 fn: function (aNumber){
 var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aNumber, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
 return Number(self) == aNumber;
-return self;},
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
 args: ["aNumber"],
-source: unescape('%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20Number%28self%29%20%3D%3D%20aNumber%3E'),
-messageSends: [],
+source: unescape('%3D%20aNumber%0A%09aNumber%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%20%0A%09%3Creturn%20Number%28self%29%20%3D%3D%20aNumber%3E'),
+messageSends: ["ifFalse:", unescape("%3D"), "class"],
 referencedClasses: []
 }),
 smalltalk.Number);
@@ -2187,7 +2229,7 @@ return self;},
 args: [],
 source: unescape('atRandom%0A%20%20%20%20%5E%28Random%20new%20next%20*%20self%29%20truncated%20+%201'),
 messageSends: [unescape("+"), "truncated", unescape("*"), "next", "new"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.Random]
 }),
 smalltalk.Number);
 
@@ -2203,7 +2245,7 @@ return self;},
 args: ["aNumber"],
 source: unescape('@%20aNumber%0A%09%5EPoint%20x%3A%20self%20y%3A%20aNumber'),
 messageSends: ["x:y:"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.Point]
 }),
 smalltalk.Number);
 
@@ -2219,7 +2261,7 @@ return self;},
 args: [],
 source: unescape('asPoint%0A%09%5EPoint%20x%3A%20self%20y%3A%20self'),
 messageSends: ["x:y:"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.Point]
 }),
 smalltalk.Number);
 
@@ -2335,6 +2377,40 @@ referencedClasses: []
 }),
 smalltalk.Number);
 
+smalltalk.addMethod(
+'__eq_eq',
+smalltalk.method({
+selector: '==',
+category: 'comparing',
+fn: function (aNumber){
+var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aNumber, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]);
+return Number(self) === Number(aNumber);
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}},
+args: ["aNumber"],
+source: unescape('%3D%3D%20aNumber%0A%09aNumber%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%20%0A%09%3Creturn%20Number%28self%29%20%3D%3D%3D%20Number%28aNumber%29%3E'),
+messageSends: ["ifFalse:", unescape("%3D"), "class"],
+referencedClasses: []
+}),
+smalltalk.Number);
+
+smalltalk.addMethod(
+'_printShowingDecimalPlaces_',
+smalltalk.method({
+selector: 'printShowingDecimalPlaces:',
+category: 'printing',
+fn: function (placesDesired){
+var self=this;
+return self.toFixed(placesDesired);
+return self;},
+args: ["placesDesired"],
+source: unescape('printShowingDecimalPlaces%3A%20placesDesired%0A%09%3Creturn%20self.toFixed%28placesDesired%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Number);
+
 
 smalltalk.addMethod(
 '_pi',
@@ -2620,11 +2696,13 @@ selector: '=',
 category: 'comparing',
 fn: function (aBoolean){
 var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
 return Boolean(self == true) == aBoolean;
-return self;},
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
 args: ["aBoolean"],
-source: unescape('%3D%20aBoolean%0A%09%3Creturn%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%3E'),
-messageSends: [],
+source: unescape('%3D%20aBoolean%0A%09aBoolean%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%3Creturn%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%3E'),
+messageSends: ["ifFalse:", unescape("%3D"), "class"],
 referencedClasses: []
 }),
 smalltalk.Boolean);
@@ -2799,7 +2877,7 @@ smalltalk.addMethod(
 '_asJSONObject',
 smalltalk.method({
 selector: 'asJSONObject',
-category: 'comparing',
+category: 'converting',
 fn: function (){
 var self=this;
 return self;
@@ -2855,6 +2933,24 @@ referencedClasses: []
 }),
 smalltalk.Boolean);
 
+smalltalk.addMethod(
+'__eq_eq',
+smalltalk.method({
+selector: '==',
+category: 'comparing',
+fn: function (aBoolean){
+var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]);
+return Boolean(self == true) === Boolean(aBoolean == true);
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}},
+args: ["aBoolean"],
+source: unescape('%3D%3D%20aBoolean%0A%09aBoolean%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%3Creturn%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%3D%20Boolean%28aBoolean%20%3D%3D%20true%29%3E'),
+messageSends: ["ifFalse:", unescape("%3D"), "class"],
+referencedClasses: []
+}),
+smalltalk.Boolean);
+
 
 
 smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
@@ -3706,6 +3802,7 @@ fn: function (aString, aString2, aString3){
 var self=this;
 return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_module_", [self, aString, aString2, aString3]);
 return self;},
+args: ["aString", "aString2", "aString3"],
 source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20module%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20module%3A%20aString3'),
 messageSends: ["superclass:subclass:instanceVariableNames:module:", "new"],
 referencedClasses: [smalltalk.ClassBuilder]
@@ -4159,6 +4256,38 @@ referencedClasses: [smalltalk.Set]
 }),
 smalltalk.Collection);
 
+smalltalk.addMethod(
+'_ifNotEmpty_',
+smalltalk.method({
+selector: 'ifNotEmpty:',
+category: 'testing',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
+return self;},
+args: ["aBlock"],
+source: unescape('ifNotEmpty%3A%20aBlock%0A%09self%20notEmpty%20ifTrue%3A%20aBlock.'),
+messageSends: ["ifTrue:", "notEmpty"],
+referencedClasses: []
+}),
+smalltalk.Collection);
+
+smalltalk.addMethod(
+'_ifEmpty_',
+smalltalk.method({
+selector: 'ifEmpty:',
+category: 'testing',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_ifTrue_", [aBlock]);
+return self;},
+args: ["aBlock"],
+source: unescape('ifEmpty%3A%20aBlock%0A%09self%20isEmpty%20ifTrue%3A%20aBlock.'),
+messageSends: ["ifTrue:", "isEmpty"],
+referencedClasses: []
+}),
+smalltalk.Collection);
+
 
 smalltalk.addMethod(
 '_streamClass',
@@ -4172,7 +4301,7 @@ return self;},
 args: [],
 source: unescape('streamClass%0A%09%20%20%20%20%5EStream'),
 messageSends: [],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.Stream]
 }),
 smalltalk.Collection.klass);
 
@@ -4566,11 +4695,13 @@ selector: '=',
 category: 'comparing',
 fn: function (aString){
 var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
 return String(self) == aString;
-return self;},
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
 args: ["aString"],
-source: unescape('%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3D%3D%20aString%3E'),
-messageSends: [],
+source: unescape('%3D%20aString%0A%09aString%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%3Creturn%20String%28self%29%20%3D%3D%20aString%3E'),
+messageSends: ["ifFalse:", unescape("%3D"), "class"],
 referencedClasses: []
 }),
 smalltalk.String);
@@ -5332,6 +5463,24 @@ referencedClasses: []
 }),
 smalltalk.String);
 
+smalltalk.addMethod(
+'__eq_eq',
+smalltalk.method({
+selector: '==',
+category: 'comparing',
+fn: function (aString){
+var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]);
+return String(self) === String(aString);
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}},
+args: ["aString"],
+source: unescape('%3D%3D%20aString%0A%09aString%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%3Creturn%20String%28self%29%20%3D%3D%3D%20String%28aString%29%3E'),
+messageSends: ["ifFalse:", unescape("%3D"), "class"],
+referencedClasses: []
+}),
+smalltalk.String);
+
 
 smalltalk.addMethod(
 '_streamClass',
@@ -5345,7 +5494,7 @@ return self;},
 args: [],
 source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream'),
 messageSends: [],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.StringStream]
 }),
 smalltalk.String.klass);
 
@@ -5802,6 +5951,25 @@ referencedClasses: []
 }),
 smalltalk.Array);
 
+smalltalk.addMethod(
+'__eq',
+smalltalk.method({
+selector: '=',
+category: 'comparing',
+fn: function (aCollection){
+var self=this;
+try{(($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aCollection, "_size", [])]);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
+smalltalk.send(self, "_withIndexDo_", [(function(each, i){return (($receiver = smalltalk.send(smalltalk.send(aCollection, "_at_", [i]), "__eq", [each])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);})]);
+(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
+args: ["aCollection"],
+source: unescape('%3D%20aCollection%0A%09%28self%20class%20%3D%20aCollection%20class%20and%3A%20%5B%0A%20%20%20%20%20%20%20%20%09self%20size%20%3D%20aCollection%20size%5D%29%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20withIndexDo%3A%20%5B%3Aeach%20%3Ai%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28aCollection%20at%3A%20i%29%20%3D%20each%20ifFalse%3A%20%5B%5Efalse%5D%5D.%0A%09%5Etrue'),
+messageSends: ["ifFalse:", "and:", unescape("%3D"), "class", "size", "withIndexDo:", "at:"],
+referencedClasses: []
+}),
+smalltalk.Array);
+
 
 
 smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
@@ -6177,13 +6345,13 @@ category: 'comparing',
 fn: function (aDictionary){
 var self=this;
 try{(($receiver = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aDictionary, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
-smalltalk.send(self, "_associationsDo_", [(function(assoc){return (($receiver = smalltalk.send(smalltalk.send(aDictionary, "_at_ifAbsent_", [smalltalk.send(assoc, "_key", []), (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]), "__eq", [smalltalk.send(assoc, "_value", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);})]);
-(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
+(($receiver = smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aDictionary, "_size", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
+(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
 return self;
 } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
 args: ["aDictionary"],
-source: unescape('%3D%20aDictionary%0A%09self%20class%20%3D%20aDictionary%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20associationsDo%3A%20%5B%3Aassoc%20%7C%0A%09%20%20%20%20%28aDictionary%20at%3A%20assoc%20key%20ifAbsent%3A%20%5B%5Efalse%5D%29%20%3D%20assoc%20value%20%0A%09%09ifFalse%3A%20%5B%5Efalse%5D%5D.%0A%09%5Etrue'),
-messageSends: ["ifFalse:", unescape("%3D"), "class", "associationsDo:", "at:ifAbsent:", "key", "value"],
+source: unescape('%3D%20aDictionary%0A%09self%20class%20%3D%20aDictionary%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20size%20%3D%20aDictionary%20size%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%5Eself%20associations%20%3D%20aDictionary%20associations'),
+messageSends: ["ifFalse:", unescape("%3D"), "class", "size", "associations"],
 referencedClasses: []
 }),
 smalltalk.Dictionary);
@@ -6754,6 +6922,7 @@ var newClass=nil;
 newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_module_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]);
 smalltalk.send(self, "_setupClass_", [newClass]);
 return self;},
+args: ["aClass", "aString", "aString2", "aString3"],
 source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20module%3A%20aString3%0A%09%7C%20newClass%20%7C%0A%09newClass%20%3A%3D%20self%20addSubclassOf%3A%20aClass%0A%09%09%09%09named%3A%20aString%20instanceVariableNames%3A%20%28self%20instanceVariableNamesFor%3A%20aString2%29%0A%09%09%09%09module%3A%20%28aString3%20ifNil%3A%20%5B%27unclassified%27%5D%29.%0A%09self%20setupClass%3A%20newClass'),
 messageSends: ["addSubclassOf:named:instanceVariableNames:module:", "instanceVariableNamesFor:", "ifNil:", "setupClass:"],
 referencedClasses: []
@@ -6770,6 +6939,7 @@ var self=this;
 smalltalk.addClass(aString, aClass, aCollection, moduleName);
 	    return smalltalk[aString];
 return self;},
+args: ["aClass", "aString", "aCollection", "moduleName"],
 source: unescape('addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20aCollection%20module%3A%20moduleName%0A%09%3Csmalltalk.addClass%28aString%2C%20aClass%2C%20aCollection%2C%20moduleName%29%3B%0A%09%20%20%20%20return%20smalltalk%5BaString%5D%3E'),
 messageSends: [],
 referencedClasses: []
@@ -6792,7 +6962,7 @@ return self;},
 args: [],
 source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.'),
 messageSends: ["initialize", "new"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.ChunkParser]
 }),
 smalltalk.ClassCategoryReader);
 
@@ -6845,7 +7015,7 @@ return self;},
 args: ["aString"],
 source: unescape('compileMethod%3A%20aString%0A%09%7C%20method%20%7C%0A%09method%20%3A%3D%20Compiler%20new%20load%3A%20aString%20forClass%3A%20class.%0A%09method%20category%3A%20category.%0A%09class%20addCompiledMethod%3A%20method'),
 messageSends: ["load:forClass:", "new", "category:", "addCompiledMethod:"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.Compiler]
 }),
 smalltalk.ClassCategoryReader);
 
@@ -7413,7 +7583,7 @@ return self;},
 args: [],
 source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.'),
 messageSends: ["initialize", "new"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: [smalltalk.ChunkParser]
 }),
 smalltalk.ClassCommentReader);
 
@@ -7891,11 +8061,11 @@ selector: 'current',
 category: 'accessing',
 fn: function (){
 var self=this;
-return self['@current'];
+return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return self['@current']=smalltalk.send(self, "_new", []);})() : $receiver;
 return self;},
 args: [],
-source: unescape('current%0A%09%5Ecurrent'),
-messageSends: [],
+source: unescape('current%0A%09%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20self%20new%5D'),
+messageSends: ["ifNil:", "new"],
 referencedClasses: []
 }),
 smalltalk.ErrorHandler.klass);
@@ -8021,6 +8191,29 @@ referencedClasses: [smalltalk.Dictionary]
 }),
 smalltalk.JSObjectProxy);
 
+smalltalk.addMethod(
+'_doesNotUnderstand_',
+smalltalk.method({
+selector: 'doesNotUnderstand:',
+category: 'proxy',
+fn: function (aMessage){
+var self=this;
+var obj=nil;
+var selector=nil;
+var arguments=nil;
+obj=smalltalk.send(self, "_jsObject", []);
+selector=smalltalk.send(aMessage, "_selector", []);
+arguments=smalltalk.send(aMessage, "_arguments", []);
+if(obj[selector]) {return smalltalk.send(obj, selector, arguments)};
+smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
+return self;},
+args: ["aMessage"],
+source: unescape('doesNotUnderstand%3A%20aMessage%0A%09%7C%20obj%20selector%20arguments%20%7C%0A%09obj%20%3A%3D%20self%20jsObject.%0A%09selector%20%3A%3D%20aMessage%20selector.%0A%09arguments%20%3A%3D%20aMessage%20arguments.%0A%09%3Cif%28obj%5Bselector%5D%29%20%7Breturn%20smalltalk.send%28obj%2C%20selector%2C%20arguments%29%7D%3E.%0A%09super%20doesNotUnderstand%3A%20aMessage'),
+messageSends: ["jsObject", "selector", "arguments", "doesNotUnderstand:"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy);
+
 
 smalltalk.addMethod(
 '_on_',
@@ -8178,5 +8371,21 @@ referencedClasses: []
 }),
 smalltalk.Set);
 
+smalltalk.addMethod(
+'__eq',
+smalltalk.method({
+selector: '=',
+category: 'comparing',
+fn: function (aCollection){
+var self=this;
+return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(self['@elements'], "__eq", [smalltalk.send(aCollection, "_asArray", [])]);})]);
+return self;},
+args: ["aCollection"],
+source: unescape('%3D%20aCollection%0A%09%5Eself%20class%20%3D%20aCollection%20class%20and%3A%20%5B%0A%20%20%20%20%20%20%20%20%09elements%20%3D%20aCollection%20asArray%5D'),
+messageSends: ["and:", unescape("%3D"), "class", "asArray"],
+referencedClasses: []
+}),
+smalltalk.Set);
+
 
 

+ 33 - 33
js/SUnit.deploy.js

@@ -1,4 +1,26 @@
 smalltalk.addClass('TestCase', smalltalk.Object, ['testSelector'], 'SUnit');
+smalltalk.addMethod(
+'_setTestSelector_',
+smalltalk.method({
+selector: 'setTestSelector:',
+fn: function (aSelector){
+var self=this;
+self['@testSelector']=aSelector;
+return self;}
+}),
+smalltalk.TestCase);
+
+smalltalk.addMethod(
+'_selector',
+smalltalk.method({
+selector: 'selector',
+fn: function (){
+var self=this;
+return self['@testSelector'];
+return self;}
+}),
+smalltalk.TestCase);
+
 smalltalk.addMethod(
 '_signalFailure_',
 smalltalk.method({
@@ -101,28 +123,6 @@ return self;}
 }),
 smalltalk.TestCase);
 
-smalltalk.addMethod(
-'_setTestSelector_',
-smalltalk.method({
-selector: 'setTestSelector:',
-fn: function (aSelector){
-var self=this;
-self['@testSelector']=aSelector;
-return self;}
-}),
-smalltalk.TestCase);
-
-smalltalk.addMethod(
-'_selector',
-smalltalk.method({
-selector: 'selector',
-fn: function (){
-var self=this;
-return self['@testSelector'];
-return self;}
-}),
-smalltalk.TestCase);
-
 
 smalltalk.addMethod(
 '_testSelectors',
@@ -157,17 +157,6 @@ return self;}
 }),
 smalltalk.TestCase.klass);
 
-smalltalk.addMethod(
-'_shouldInheritSelectors',
-smalltalk.method({
-selector: 'shouldInheritSelectors',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
-return self;}
-}),
-smalltalk.TestCase.klass);
-
 smalltalk.addMethod(
 '_allTestSelectors',
 smalltalk.method({
@@ -193,6 +182,17 @@ return self;}
 }),
 smalltalk.TestCase.klass);
 
+smalltalk.addMethod(
+'_shouldInheritSelectors',
+smalltalk.method({
+selector: 'shouldInheritSelectors',
+fn: function (){
+var self=this;
+return smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
+return self;}
+}),
+smalltalk.TestCase.klass);
+
 
 smalltalk.addClass('TestFailure', smalltalk.Error, [], 'SUnit');
 

+ 51 - 51
js/SUnit.js

@@ -1,4 +1,36 @@
 smalltalk.addClass('TestCase', smalltalk.Object, ['testSelector'], 'SUnit');
+smalltalk.addMethod(
+'_setTestSelector_',
+smalltalk.method({
+selector: 'setTestSelector:',
+category: 'accessing',
+fn: function (aSelector){
+var self=this;
+self['@testSelector']=aSelector;
+return self;},
+args: ["aSelector"],
+source: unescape('setTestSelector%3A%20aSelector%0A%09testSelector%20%3A%3D%20aSelector'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.TestCase);
+
+smalltalk.addMethod(
+'_selector',
+smalltalk.method({
+selector: 'selector',
+category: 'accessing',
+fn: function (){
+var self=this;
+return self['@testSelector'];
+return self;},
+args: [],
+source: unescape('selector%0A%09%5EtestSelector'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.TestCase);
+
 smalltalk.addMethod(
 '_signalFailure_',
 smalltalk.method({
@@ -9,9 +41,9 @@ var self=this;
 (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.TestFailure || TestFailure), "_new", []));
 return self;},
 args: ["aString"],
-source: unescape('signalFailure%3A%20aString%0A%09TestFailure%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal%20'),
+source: unescape('signalFailure%3A%20aString%0A%09TestFailure%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal'),
 messageSends: ["messageText:", "signal", "new"],
-referencedClasses: [smalltalk.nil]
+referencedClasses: []
 }),
 smalltalk.TestCase);
 
@@ -78,7 +110,7 @@ return self;},
 args: ["aResult"],
 source: unescape('performTestFor%3A%20aResult%0A%09%5B%5Bself%20perform%3A%20self%20selector%5D%0A%09%09on%3A%20TestFailure%20do%3A%20%5B%3Aex%20%7C%20aResult%20addFailure%3A%20self%5D%5D%0A%09%09on%3A%20Error%20do%3A%20%5B%3Aex%20%7C%20aResult%20addError%3A%20self%5D'),
 messageSends: ["on:do:", "perform:", "selector", "addFailure:", "addError:"],
-referencedClasses: [smalltalk.TestFailure,smalltalk.Error]
+referencedClasses: [smalltalk.Error]
 }),
 smalltalk.TestCase);
 
@@ -146,38 +178,6 @@ referencedClasses: []
 }),
 smalltalk.TestCase);
 
-smalltalk.addMethod(
-'_setTestSelector_',
-smalltalk.method({
-selector: 'setTestSelector:',
-category: 'accessing',
-fn: function (aSelector){
-var self=this;
-self['@testSelector']=aSelector;
-return self;},
-args: ["aSelector"],
-source: unescape('setTestSelector%3A%20aSelector%0A%09testSelector%20%3A%3D%20aSelector'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TestCase);
-
-smalltalk.addMethod(
-'_selector',
-smalltalk.method({
-selector: 'selector',
-category: 'accessing',
-fn: function (){
-var self=this;
-return self['@testSelector'];
-return self;},
-args: [],
-source: unescape('selector%0A%09%5EtestSelector'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TestCase);
-
 
 smalltalk.addMethod(
 '_testSelectors',
@@ -227,22 +227,6 @@ referencedClasses: [smalltalk.TestCase]
 }),
 smalltalk.TestCase.klass);
 
-smalltalk.addMethod(
-'_shouldInheritSelectors',
-smalltalk.method({
-selector: 'shouldInheritSelectors',
-category: 'testing',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
-return self;},
-args: [],
-source: unescape('shouldInheritSelectors%0A%09%5Eself%20%7E%3D%20self%20lookupHierarchyRoot'),
-messageSends: [unescape("%7E%3D"), "lookupHierarchyRoot"],
-referencedClasses: []
-}),
-smalltalk.TestCase.klass);
-
 smalltalk.addMethod(
 '_allTestSelectors',
 smalltalk.method({
@@ -278,6 +262,22 @@ referencedClasses: []
 }),
 smalltalk.TestCase.klass);
 
+smalltalk.addMethod(
+'_shouldInheritSelectors',
+smalltalk.method({
+selector: 'shouldInheritSelectors',
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
+return self;},
+args: [],
+source: unescape('shouldInheritSelectors%0A%09%5Eself%20%7E%3D%20self%20lookupHierarchyRoot'),
+messageSends: [unescape("%7E%3D"), "lookupHierarchyRoot"],
+referencedClasses: []
+}),
+smalltalk.TestCase.klass);
+
 
 smalltalk.addClass('TestFailure', smalltalk.Error, [], 'SUnit');
 

+ 11 - 1
js/jtalk.js

@@ -52,7 +52,16 @@
 	*/
 
 	var spec = spec || {};
+
+	// In deployment mode, only the compressed version of Kernel 
+	// and Canvas are loaded
 	deploy = spec.deploy || false;
+
+	// Specify a version string to avoid wrong browser caching
+	if(spec.version) {
+	    nocache = '?' + spec.version;
+	}
+
 	loadDependencies();
 	if(deploy) {
 	    loadJS("boot.js");
@@ -60,7 +69,6 @@
 	    loadJS("Canvas.deploy.js");
 	    loadJS("JQuery.deploy.js");
 	} else {
-
 	    loadIDEDependencies();
 	    loadCSS('jtalk.css');
 	    loadJS("boot.js");
@@ -77,6 +85,7 @@
 	    loadJS("JQuery-Tests.js");
 	}
 
+	// Load other files, possibly with another directory prefix than 'js'
 	if(spec.files) {
 	    for(var i=0; i < spec.files.length; i++) {
 		loadJS(spec.files[i], spec.prefix);
@@ -90,6 +99,7 @@
 	    if(deploy) {smalltalk.setDeploymentMode()}
 	}
 
+	// Be sure to setup & initialize smalltalk classes
 	loadJS("init.js");
     }
 

File diff suppressed because it is too large
+ 226 - 0
server/FileServer.deploy.js


File diff suppressed because it is too large
+ 301 - 0
server/FileServer.js


+ 561 - 0
server/FileServer.st

@@ -0,0 +1,561 @@
+Object subclass: #FileServer
+	instanceVariableNames: 'path http fs url port basePath sys'
+	category: 'FileServer'!
+
+!FileServer methodsFor: 'accessing'!
+
+basePath
+	^basePath ifNil: ['./']
+!
+
+basePath: aString
+	basePath := aString
+!
+
+port
+	^self class port
+! !
+
+!FileServer methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	path := self require: 'path'.
+	http := self require: 'http'.
+	fs := self require: 'fs'.
+	sys := self require: 'sys'.
+	url := self require: 'url'
+! !
+
+!FileServer methodsFor: 'private'!
+
+require: aModuleString
+	"call to the require function"
+	^require value: aModuleString
+!
+
+writeData: data toFileNamed: aFilename
+	console log: aFilename
+! !
+
+!FileServer methodsFor: 'request handling'!
+
+respondNotFoundTo: aResponse
+	aResponse 
+		writeHead: 404 options: #{'Content-Type' -> 'text/plain'};
+		write: '404 Not found';
+		end
+!
+
+handleRequest: aRequest respondTo: aResponse
+	aRequest method = 'PUT'
+		ifTrue: [self handlePUTRequest: aRequest respondTo: aResponse]
+		ifFalse: [self handleGETRequest: aRequest respondTo: aResponse]
+!
+
+handleGETRequest: aRequest respondTo: aResponse
+	| uri filename |
+	uri := (url parse: aRequest url) pathname.
+	filename := path join: self basePath with: uri.
+	path exists: filename do: [:boolean | 
+		boolean 
+			ifFalse: [self respondNotFoundTo: aResponse]
+			ifTrue: [self respondFileNamed: filename to: aResponse]]
+!
+
+handlePUTRequest: aRequest respondTo: aResponse
+	| stream |
+	stream := fs createWriteStream: '.', aRequest url.
+
+	aRequest setEncoding: 'utf8'.
+	aRequest on: #data do: [:data | stream write: data].
+
+	aRequest on: #end do: [
+		stream end.
+		self respondOKTo: aResponse]
+!
+
+respondFileNamed: aFilename to: aResponse
+	| type filename |
+
+	filename := aFilename.
+	(fs statSync: aFilename) isDirectory ifTrue: [
+        	filename := filename, 'index.html'].
+
+	fs readFile: filename do: [:ex :file |
+		ex notNil 
+			ifTrue: [self respondInternalErrorTo: aResponse]
+			ifFalse: [
+        			type := self class mimeTypeFor: filename.
+				aResponse 
+                          		writeHead: 200 options:  #{'Content-Type' -> type};
+					write: file binary: 'binary';
+                          		end]]
+!
+
+respondInternalErrorTo: aResponse
+	aResponse 
+		writeHead: 500 options: #{'Content-Type' -> 'text/plain'};
+		write: '500 Internal server error';
+		end
+!
+
+respondOKTo: aResponse
+	aResponse 
+		writeHead: 200 options: #{'Content-Type' -> 'text/plain'};
+		end
+! !
+
+!FileServer methodsFor: 'starting'!
+
+startOn: aPort
+	port := aPort.
+	self start
+!
+
+start
+	(http createServer: [:request :response |
+	 	self handleRequest: request respondTo: response]) listen: self port.
+	console log: 'Starting file server on port ', self port asString
+! !
+
+FileServer class instanceVariableNames: 'port mimeTypes'!
+
+!FileServer class methodsFor: 'accessing'!
+
+port
+	^port ifNil: [4000]
+!
+
+port: aNumber
+	port := aNumber
+!
+
+defaultMimeTypes
+	^ #{
+		'%' -> 'application/x-trash'.
+		'323' -> 'text/h323'.
+		'abw' -> 'application/x-abiword'.
+		'ai' -> 'application/postscript'.
+		'aif' -> 'audio/x-aiff'.
+		'aifc' -> 'audio/x-aiff'.
+		'aiff' -> 'audio/x-aiff'.
+		'alc' -> 'chemical/x-alchemy'.
+		'art' -> 'image/x-jg'.
+		'asc' -> 'text/plain'.
+		'asf' -> 'video/x-ms-asf'.
+		'asn' -> 'chemical/x-ncbi-asn1-spec'.
+		'aso' -> 'chemical/x-ncbi-asn1-binary'.
+		'asx' -> 'video/x-ms-asf'.
+		'au' -> 'audio/basic'.
+		'avi' -> 'video/x-msvideo'.
+		'b' -> 'chemical/x-molconn-Z'.
+		'bak' -> 'application/x-trash'.
+		'bat' -> 'application/x-msdos-program'.
+		'bcpio' -> 'application/x-bcpio'.
+		'bib' -> 'text/x-bibtex'.
+		'bin' -> 'application/octet-stream'.
+		'bmp' -> 'image/x-ms-bmp'.
+		'book' -> 'application/x-maker'.
+		'bsd' -> 'chemical/x-crossfire'.
+		'c' -> 'text/x-csrc'.
+		'c++' -> 'text/x-c++src'.
+		'c3d' -> 'chemical/x-chem3d'.
+		'cac' -> 'chemical/x-cache'.
+		'cache' -> 'chemical/x-cache'.
+		'cascii' -> 'chemical/x-cactvs-binary'.
+		'cat' -> 'application/vnd.ms-pki.seccat'.
+		'cbin' -> 'chemical/x-cactvs-binary'.
+		'cc' -> 'text/x-c++src'.
+		'cdf' -> 'application/x-cdf'.
+		'cdr' -> 'image/x-coreldraw'.
+		'cdt' -> 'image/x-coreldrawtemplate'.
+		'cdx' -> 'chemical/x-cdx'.
+		'cdy' -> 'application/vnd.cinderella'.
+		'cef' -> 'chemical/x-cxf'.
+		'cer' -> 'chemical/x-cerius'.
+		'chm' -> 'chemical/x-chemdraw'.
+		'chrt' -> 'application/x-kchart'.
+		'cif' -> 'chemical/x-cif'.
+		'class' -> 'application/java-vm'.
+		'cls' -> 'text/x-tex'.
+		'cmdf' -> 'chemical/x-cmdf'.
+		'cml' -> 'chemical/x-cml'.
+		'cod' -> 'application/vnd.rim.cod'.
+		'com' -> 'application/x-msdos-program'.
+		'cpa' -> 'chemical/x-compass'.
+		'cpio' -> 'application/x-cpio'.
+		'cpp' -> 'text/x-c++src'.
+		'cpt' -> 'image/x-corelphotopaint'.
+		'crl' -> 'application/x-pkcs7-crl'.
+		'crt' -> 'application/x-x509-ca-cert'.
+		'csf' -> 'chemical/x-cache-csf'.
+		'csh' -> 'text/x-csh'.
+		'csm' -> 'chemical/x-csml'.
+		'csml' -> 'chemical/x-csml'.
+		'css' -> 'text/css'.
+		'csv' -> 'text/comma-separated-values'.
+		'ctab' -> 'chemical/x-cactvs-binary'.
+		'ctx' -> 'chemical/x-ctx'.
+		'cu' -> 'application/cu-seeme'.
+		'cub' -> 'chemical/x-gaussian-cube'.
+		'cxf' -> 'chemical/x-cxf'.
+		'cxx' -> 'text/x-c++src'.
+		'dat' -> 'chemical/x-mopac-input'.
+		'dcr' -> 'application/x-director'.
+		'deb' -> 'application/x-debian-package'.
+		'dif' -> 'video/dv'.
+		'diff' -> 'text/plain'.
+		'dir' -> 'application/x-director'.
+		'djv' -> 'image/vnd.djvu'.
+		'djvu' -> 'image/vnd.djvu'.
+		'dl' -> 'video/dl'.
+		'dll' -> 'application/x-msdos-program'.
+		'dmg' -> 'application/x-apple-diskimage'.
+		'dms' -> 'application/x-dms'.
+		'doc' -> 'application/msword'.
+		'dot' -> 'application/msword'.
+		'dv' -> 'video/dv'.
+		'dvi' -> 'application/x-dvi'.
+		'dx' -> 'chemical/x-jcamp-dx'.
+		'dxr' -> 'application/x-director'.
+		'emb' -> 'chemical/x-embl-dl-nucleotide'.
+		'embl' -> 'chemical/x-embl-dl-nucleotide'.
+		'ent' -> 'chemical/x-pdb'.
+		'eps' -> 'application/postscript'.
+		'etx' -> 'text/x-setext'.
+		'exe' -> 'application/x-msdos-program'.
+		'ez' -> 'application/andrew-inset'.
+		'fb' -> 'application/x-maker'.
+		'fbdoc' -> 'application/x-maker'.
+		'fch' -> 'chemical/x-gaussian-checkpoint'.
+		'fchk' -> 'chemical/x-gaussian-checkpoint'.
+		'fig' -> 'application/x-xfig'.
+		'flac' -> 'application/x-flac'.
+		'fli' -> 'video/fli'.
+		'fm' -> 'application/x-maker'.
+		'frame' -> 'application/x-maker'.
+		'frm' -> 'application/x-maker'.
+		'gal' -> 'chemical/x-gaussian-log'.
+		'gam' -> 'chemical/x-gamess-input'.
+		'gamin' -> 'chemical/x-gamess-input'.
+		'gau' -> 'chemical/x-gaussian-input'.
+		'gcd' -> 'text/x-pcs-gcd'.
+		'gcf' -> 'application/x-graphing-calculator'.
+		'gcg' -> 'chemical/x-gcg8-sequence'.
+		'gen' -> 'chemical/x-genbank'.
+		'gf' -> 'application/x-tex-gf'.
+		'gif' -> 'image/gif'.
+		'gjc' -> 'chemical/x-gaussian-input'.
+		'gjf' -> 'chemical/x-gaussian-input'.
+		'gl' -> 'video/gl'.
+		'gnumeric' -> 'application/x-gnumeric'.
+		'gpt' -> 'chemical/x-mopac-graph'.
+		'gsf' -> 'application/x-font'.
+		'gsm' -> 'audio/x-gsm'.
+		'gtar' -> 'application/x-gtar'.
+		'h' -> 'text/x-chdr'.
+		'h++' -> 'text/x-c++hdr'.
+		'hdf' -> 'application/x-hdf'.
+		'hh' -> 'text/x-c++hdr'.
+		'hin' -> 'chemical/x-hin'.
+		'hpp' -> 'text/x-c++hdr'.
+		'hqx' -> 'application/mac-binhex40'.
+		'hs' -> 'text/x-haskell'.
+		'hta' -> 'application/hta'.
+		'htc' -> 'text/x-component'.
+		'htm' -> 'text/html'.
+		'html' -> 'text/html'.
+		'hxx' -> 'text/x-c++hdr'.
+		'ica' -> 'application/x-ica'.
+		'ice' -> 'x-conference/x-cooltalk'.
+		'ico' -> 'image/x-icon'.
+		'ics' -> 'text/calendar'.
+		'icz' -> 'text/calendar'.
+		'ief' -> 'image/ief'.
+		'iges' -> 'model/iges'.
+		'igs' -> 'model/iges'.
+		'iii' -> 'application/x-iphone'.
+		'inp' -> 'chemical/x-gamess-input'.
+		'ins' -> 'application/x-internet-signup'.
+		'iso' -> 'application/x-iso9660-image'.
+		'isp' -> 'application/x-internet-signup'.
+		'ist' -> 'chemical/x-isostar'.
+		'istr' -> 'chemical/x-isostar'.
+		'jad' -> 'text/vnd.sun.j2me.app-descriptor'.
+		'jar' -> 'application/java-archive'.
+		'java' -> 'text/x-java'.
+		'jdx' -> 'chemical/x-jcamp-dx'.
+		'jmz' -> 'application/x-jmol'.
+		'jng' -> 'image/x-jng'.
+		'jnlp' -> 'application/x-java-jnlp-file'.
+		'jpe' -> 'image/jpeg'.
+		'jpeg' -> 'image/jpeg'.
+		'jpg' -> 'image/jpeg'.
+		'js' -> 'application/javascript'.
+		'kar' -> 'audio/midi'.
+		'key' -> 'application/pgp-keys'.
+		'kil' -> 'application/x-killustrator'.
+		'kin' -> 'chemical/x-kinemage'.
+		'kpr' -> 'application/x-kpresenter'.
+		'kpt' -> 'application/x-kpresenter'.
+		'ksp' -> 'application/x-kspread'.
+		'kwd' -> 'application/x-kword'.
+		'kwt' -> 'application/x-kword'.
+		'latex' -> 'application/x-latex'.
+		'lha' -> 'application/x-lha'.
+		'lhs' -> 'text/x-literate-haskell'.
+		'lsf' -> 'video/x-la-asf'.
+		'lsx' -> 'video/x-la-asf'.
+		'ltx' -> 'text/x-tex'.
+		'lzh' -> 'application/x-lzh'.
+		'lzx' -> 'application/x-lzx'.
+		'm3u' -> 'audio/x-mpegurl'.
+		'm4a' -> 'audio/mpeg'.
+		'maker' -> 'application/x-maker'.
+		'man' -> 'application/x-troff-man'.
+		'mcif' -> 'chemical/x-mmcif'.
+		'mcm' -> 'chemical/x-macmolecule'.
+		'mdb' -> 'application/msaccess'.
+		'me' -> 'application/x-troff-me'.
+		'mesh' -> 'model/mesh'.
+		'mid' -> 'audio/midi'.
+		'midi' -> 'audio/midi'.
+		'mif' -> 'application/x-mif'.
+		'mm' -> 'application/x-freemind'.
+		'mmd' -> 'chemical/x-macromodel-input'.
+		'mmf' -> 'application/vnd.smaf'.
+		'mml' -> 'text/mathml'.
+		'mmod' -> 'chemical/x-macromodel-input'.
+		'mng' -> 'video/x-mng'.
+		'moc' -> 'text/x-moc'.
+		'mol' -> 'chemical/x-mdl-molfile'.
+		'mol2' -> 'chemical/x-mol2'.
+		'moo' -> 'chemical/x-mopac-out'.
+		'mop' -> 'chemical/x-mopac-input'.
+		'mopcrt' -> 'chemical/x-mopac-input'.
+		'mov' -> 'video/quicktime'.
+		'movie' -> 'video/x-sgi-movie'.
+		'mp2' -> 'audio/mpeg'.
+		'mp3' -> 'audio/mpeg'.
+		'mp4' -> 'video/mp4'.
+		'mpc' -> 'chemical/x-mopac-input'.
+		'mpe' -> 'video/mpeg'.
+		'mpeg' -> 'video/mpeg'.
+		'mpega' -> 'audio/mpeg'.
+		'mpg' -> 'video/mpeg'.
+		'mpga' -> 'audio/mpeg'.
+		'ms' -> 'application/x-troff-ms'.
+		'msh' -> 'model/mesh'.
+		'msi' -> 'application/x-msi'.
+		'mvb' -> 'chemical/x-mopac-vib'.
+		'mxu' -> 'video/vnd.mpegurl'.
+		'nb' -> 'application/mathematica'.
+		'nc' -> 'application/x-netcdf'.
+		'nwc' -> 'application/x-nwc'.
+		'o' -> 'application/x-object'.
+		'oda' -> 'application/oda'.
+		'odb' -> 'application/vnd.oasis.opendocument.database'.
+		'odc' -> 'application/vnd.oasis.opendocument.chart'.
+		'odf' -> 'application/vnd.oasis.opendocument.formula'.
+		'odg' -> 'application/vnd.oasis.opendocument.graphics'.
+		'odi' -> 'application/vnd.oasis.opendocument.image'.
+		'odm' -> 'application/vnd.oasis.opendocument.text-master'.
+		'odp' -> 'application/vnd.oasis.opendocument.presentation'.
+		'ods' -> 'application/vnd.oasis.opendocument.spreadsheet'.
+		'odt' -> 'application/vnd.oasis.opendocument.text'.
+		'ogg' -> 'application/ogg'.
+		'old' -> 'application/x-trash'.
+		'oth' -> 'application/vnd.oasis.opendocument.text-web'.
+		'oza' -> 'application/x-oz-application'.
+		'p' -> 'text/x-pascal'.
+		'p7r' -> 'application/x-pkcs7-certreqresp'.
+		'pac' -> 'application/x-ns-proxy-autoconfig'.
+		'pas' -> 'text/x-pascal'.
+		'pat' -> 'image/x-coreldrawpattern'.
+		'pbm' -> 'image/x-portable-bitmap'.
+		'pcf' -> 'application/x-font'.
+		'pcf.Z' -> 'application/x-font'.
+		'pcx' -> 'image/pcx'.
+		'pdb' -> 'chemical/x-pdb'.
+		'pdf' -> 'application/pdf'.
+		'pfa' -> 'application/x-font'.
+		'pfb' -> 'application/x-font'.
+		'pgm' -> 'image/x-portable-graymap'.
+		'pgn' -> 'application/x-chess-pgn'.
+		'pgp' -> 'application/pgp-signature'.
+		'pk' -> 'application/x-tex-pk'.
+		'pl' -> 'text/x-perl'.
+		'pls' -> 'audio/x-scpls'.
+		'pm' -> 'text/x-perl'.
+		'png' -> 'image/png'.
+		'pnm' -> 'image/x-portable-anymap'.
+		'pot' -> 'text/plain'.
+		'ppm' -> 'image/x-portable-pixmap'.
+		'pps' -> 'application/vnd.ms-powerpoint'.
+		'ppt' -> 'application/vnd.ms-powerpoint'.
+		'prf' -> 'application/pics-rules'.
+		'prt' -> 'chemical/x-ncbi-asn1-ascii'.
+		'ps' -> 'application/postscript'.
+		'psd' -> 'image/x-photoshop'.
+		'psp' -> 'text/x-psp'.
+		'py' -> 'text/x-python'.
+		'pyc' -> 'application/x-python-code'.
+		'pyo' -> 'application/x-python-code'.
+		'qt' -> 'video/quicktime'.
+		'qtl' -> 'application/x-quicktimeplayer'.
+		'ra' -> 'audio/x-realaudio'.
+		'ram' -> 'audio/x-pn-realaudio'.
+		'rar' -> 'application/rar'.
+		'ras' -> 'image/x-cmu-raster'.
+		'rd' -> 'chemical/x-mdl-rdfile'.
+		'rdf' -> 'application/rdf+xml'.
+		'rgb' -> 'image/x-rgb'.
+		'rm' -> 'audio/x-pn-realaudio'.
+		'roff' -> 'application/x-troff'.
+		'ros' -> 'chemical/x-rosdal'.
+		'rpm' -> 'application/x-redhat-package-manager'.
+		'rss' -> 'application/rss+xml'.
+		'rtf' -> 'text/rtf'.
+		'rtx' -> 'text/richtext'.
+		'rxn' -> 'chemical/x-mdl-rxnfile'.
+		'sct' -> 'text/scriptlet'.
+		'sd' -> 'chemical/x-mdl-sdfile'.
+		'sd2' -> 'audio/x-sd2'.
+		'sda' -> 'application/vnd.stardivision.draw'.
+		'sdc' -> 'application/vnd.stardivision.calc'.
+		'sdd' -> 'application/vnd.stardivision.impress'.
+		'sdf' -> 'chemical/x-mdl-sdfile'.
+		'sdp' -> 'application/vnd.stardivision.impress'.
+		'sdw' -> 'application/vnd.stardivision.writer'.
+		'ser' -> 'application/java-serialized-object'.
+		'sgf' -> 'application/x-go-sgf'.
+		'sgl' -> 'application/vnd.stardivision.writer-global'.
+		'sh' -> 'text/x-sh'.
+		'shar' -> 'application/x-shar'.
+		'shtml' -> 'text/html'.
+		'sid' -> 'audio/prs.sid'.
+		'sik' -> 'application/x-trash'.
+		'silo' -> 'model/mesh'.
+		'sis' -> 'application/vnd.symbian.install'.
+		'sit' -> 'application/x-stuffit'.
+		'skd' -> 'application/x-koan'.
+		'skm' -> 'application/x-koan'.
+		'skp' -> 'application/x-koan'.
+		'skt' -> 'application/x-koan'.
+		'smf' -> 'application/vnd.stardivision.math'.
+		'smi' -> 'application/smil'.
+		'smil' -> 'application/smil'.
+		'snd' -> 'audio/basic'.
+		'spc' -> 'chemical/x-galactic-spc'.
+		'spl' -> 'application/x-futuresplash'.
+		'src' -> 'application/x-wais-source'.
+		'stc' -> 'application/vnd.sun.xml.calc.template'.
+		'std' -> 'application/vnd.sun.xml.draw.template'.
+		'sti' -> 'application/vnd.sun.xml.impress.template'.
+		'stl' -> 'application/vnd.ms-pki.stl'.
+		'stw' -> 'application/vnd.sun.xml.writer.template'.
+		'sty' -> 'text/x-tex'.
+		'sv4cpio' -> 'application/x-sv4cpio'.
+		'sv4crc' -> 'application/x-sv4crc'.
+		'svg' -> 'image/svg+xml'.
+		'svgz' -> 'image/svg+xml'.
+		'sw' -> 'chemical/x-swissprot'.
+		'swf' -> 'application/x-shockwave-flash'.
+		'swfl' -> 'application/x-shockwave-flash'.
+		'sxc' -> 'application/vnd.sun.xml.calc'.
+		'sxd' -> 'application/vnd.sun.xml.draw'.
+		'sxg' -> 'application/vnd.sun.xml.writer.global'.
+		'sxi' -> 'application/vnd.sun.xml.impress'.
+		'sxm' -> 'application/vnd.sun.xml.math'.
+		'sxw' -> 'application/vnd.sun.xml.writer'.
+		't' -> 'application/x-troff'.
+		'tar' -> 'application/x-tar'.
+		'taz' -> 'application/x-gtar'.
+		'tcl' -> 'text/x-tcl'.
+		'tex' -> 'text/x-tex'.
+		'texi' -> 'application/x-texinfo'.
+		'texinfo' -> 'application/x-texinfo'.
+		'text' -> 'text/plain'.
+		'tgf' -> 'chemical/x-mdl-tgf'.
+		'tgz' -> 'application/x-gtar'.
+		'tif' -> 'image/tiff'.
+		'tiff' -> 'image/tiff'.
+		'tk' -> 'text/x-tcl'.
+		'tm' -> 'text/texmacs'.
+		'torrent' -> 'application/x-bittorrent'.
+		'tr' -> 'application/x-troff'.
+		'ts' -> 'text/texmacs'.
+		'tsp' -> 'application/dsptype'.
+		'tsv' -> 'text/tab-separated-values'.
+		'txt' -> 'text/plain'.
+		'udeb' -> 'application/x-debian-package'.
+		'uls' -> 'text/iuls'.
+		'ustar' -> 'application/x-ustar'.
+		'val' -> 'chemical/x-ncbi-asn1-binary'.
+		'vcd' -> 'application/x-cdlink'.
+		'vcf' -> 'text/x-vcard'.
+		'vcs' -> 'text/x-vcalendar'.
+		'vmd' -> 'chemical/x-vmd'.
+		'vms' -> 'chemical/x-vamas-iso14976'.
+		'vor' -> 'application/vnd.stardivision.writer'.
+		'vrm' -> 'x-world/x-vrml'.
+		'vrml' -> 'x-world/x-vrml'.
+		'vsd' -> 'application/vnd.visio'.
+		'wad' -> 'application/x-doom'.
+		'wav' -> 'audio/x-wav'.
+		'wax' -> 'audio/x-ms-wax'.
+		'wbmp' -> 'image/vnd.wap.wbmp'.
+		'wbxml' -> 'application/vnd.wap.wbxml'.
+		'wk' -> 'application/x-123'.
+		'wm' -> 'video/x-ms-wm'.
+		'wma' -> 'audio/x-ms-wma'.
+		'wmd' -> 'application/x-ms-wmd'.
+		'wml' -> 'text/vnd.wap.wml'.
+		'wmlc' -> 'application/vnd.wap.wmlc'.
+		'wmls' -> 'text/vnd.wap.wmlscript'.
+		'wmlsc' -> 'application/vnd.wap.wmlscriptc'.
+		'wmv' -> 'video/x-ms-wmv'.
+		'wmx' -> 'video/x-ms-wmx'.
+		'wmz' -> 'application/x-ms-wmz'.
+		'wp5' -> 'application/wordperfect5.1'.
+		'wpd' -> 'application/wordperfect'.
+		'wrl' -> 'x-world/x-vrml'.
+		'wsc' -> 'text/scriptlet'.
+		'wvx' -> 'video/x-ms-wvx'.
+		'wz' -> 'application/x-wingz'.
+		'xbm' -> 'image/x-xbitmap'.
+		'xcf' -> 'application/x-xcf'.
+		'xht' -> 'application/xhtml+xml'.
+		'xhtml' -> 'application/xhtml+xml'.
+		'xlb' -> 'application/vnd.ms-excel'.
+		'xls' -> 'application/vnd.ms-excel'.
+		'xlt' -> 'application/vnd.ms-excel'.
+		'xml' -> 'application/xml'.
+		'xpi' -> 'application/x-xpinstall'.
+		'xpm' -> 'image/x-xpixmap'.
+		'xsl' -> 'application/xml'.
+		'xtel' -> 'chemical/x-xtel'.
+		'xul' -> 'application/vnd.mozilla.xul+xml'.
+		'xwd' -> 'image/x-xwindowdump'.
+		'xyz' -> 'chemical/x-xyz'.
+		'zip' -> 'application/zip'.
+		'zmt' -> 'chemical/x-mopac-input'.
+		'~' -> 'application/x-trash'
+	}
+!
+
+mimeTypes
+	^mimeTypes ifNil: [mimeTypes := self defaultMimeTypes]
+!
+
+mimeTypeFor: aString
+	^self mimeTypes at: (aString replace: '.*[\.]' with: '') ifAbsent: ['text/plain']
+! !
+
+!FileServer class methodsFor: 'initialization'!
+
+main
+	^self new startOn: self port
+! !
+

+ 8 - 0
server/Makefile

@@ -0,0 +1,8 @@
+Program.js: FileServer.st
+	../bin/jtalkc -m FileServer FileServer.st server
+
+run: Program.js
+	./server
+
+clean:
+	rm -f FileServer.js server.js

File diff suppressed because it is too large
+ 291 - 53
server/server.js


+ 89 - 48
st/IDE.st

@@ -1,5 +1,5 @@
 Widget subclass: #TabManager
-	instanceVariableNames: 'selectedTab tabs opened ul'
+	instanceVariableNames: 'selectedTab tabs opened ul input'
 	category: 'IDE'!
 
 !TabManager methodsFor: 'accessing'!
@@ -20,11 +20,11 @@ labelFor: aWidget
 !TabManager methodsFor: 'actions'!
 
 updateBodyMargin
-    self setBodyMargin: '#jtalk' asJQuery height + 27
+    self setBodyMargin: '#jtalk' asJQuery height
 !
 
 updatePosition
-    <jQuery('#jtalk').css('top', '').css('bottom', '27px')>
+    <jQuery('#jtalk').css('top', '').css('bottom', '0px')>
 !
 
 removeBodyMargin
@@ -86,6 +86,14 @@ closeTab: aWidget
     self selectTab: self tabs last.
     aWidget remove.
     self update
+!
+
+search: aString
+	| searchedClass |
+	searchedClass := Smalltalk current at: aString.
+		searchedClass isClass
+			ifTrue: [Browser openOn: searchedClass]
+			ifFalse: [ReferencesBrowser search: aString]
 ! !
 
 !TabManager methodsFor: 'adding/Removing'!
@@ -107,9 +115,9 @@ initialize
     super initialize.
     opened := true.
     'body' asJQuery 
-	append: self;
 	append: [:html | html div id: 'jtalk'];
 	addClass: 'jtalkBody'.
+    '#jtalk' asJQuery append: self.
     self 
 	addTab: Transcript current;
 	addTab: Workspace new;
@@ -123,6 +131,8 @@ initialize
 !TabManager methodsFor: 'rendering'!
 
 renderOn: html
+	html div id: 'logo'.
+	self renderToolbarOn: html.
 	ul := html ul
 		id: 'jtalkTabs';
 		yourself.
@@ -130,33 +140,49 @@ renderOn: html
 !
 
 renderTabFor: aWidget on: html
-    | li |
-    li := html li.
-    selectedTab = aWidget ifTrue: [
+	| li |
+	li := html li.
+	selectedTab = aWidget ifTrue: [
 	li class: 'selected'].
-    li with: [
-        aWidget canBeClosed ifTrue: [
-	    html span 
-		class: 'close';
-		with: 'x';
-		onClick: [self closeTab: aWidget]].
-	html span
-	    with: (self labelFor: aWidget);
-	    onClick: [self selectTab: aWidget]]
+	li with: [
+		html span class: 'ltab'.
+		html span
+     	    		class: 'mtab';
+      	    		with: [
+        			aWidget canBeClosed ifTrue: [
+	    				html span 
+						class: 'close';
+						with: 'x';
+					onClick: [self closeTab: aWidget]].
+	    		html span with: (self labelFor: aWidget)].
+        	html span class: 'rtab'];
+	onClick: [self selectTab: aWidget]
 !
 
 renderTabs
 	ul contents: [:html |
-	    html li 
-		class: 'closeAll';
-		with: 'x';
-		onClick: [self close].
 	    self tabs do: [:each |
 		self renderTabFor: each on: html].
 	    html li
 		class: 'newtab';
-		with: ' + ';
+		with: [
+                	html span class: 'ltab'.
+                	html span class: 'mtab'; with: ' + '.
+                	html span class: 'rtab'];
 		onClick: [self newBrowserTab]]
+!
+
+renderToolbarOn: html
+	html div 
+		id: 'jt_toolbar';
+		with: [
+			input := html input 
+				class: 'implementors';
+				yourself.
+			input onKeyPress: [:event |
+				event keyCode = 13 ifTrue: [
+				self search: input asJQuery val]].
+                	html div id: 'jt_close'; onClick: [self close]]
 ! !
 
 !TabManager methodsFor: 'updating'!
@@ -258,7 +284,7 @@ TabWidget subclass: #Workspace
 !Workspace methodsFor: 'accessing'!
 
 label
-    ^'[Workspace]'
+    ^'Workspace'
 ! !
 
 !Workspace methodsFor: 'actions'!
@@ -319,7 +345,7 @@ TabWidget subclass: #Transcript
 !Transcript methodsFor: 'accessing'!
 
 label
-    ^'[Transcript]'
+    ^'Transcript'
 ! !
 
 !Transcript methodsFor: 'actions'!
@@ -385,7 +411,7 @@ clear
 ! !
 
 TabWidget subclass: #Browser
-	instanceVariableNames: 'selectedCategory selectedClass selectedProtocol selectedMethod commitButton categoriesList classesList protocolsList methodsList sourceArea tabsList selectedTab saveButton classButtons methodButtons unsavedChanges input'
+	instanceVariableNames: 'selectedCategory selectedClass selectedProtocol selectedMethod commitButton categoriesList classesList protocolsList methodsList sourceArea tabsList selectedTab saveButton classButtons methodButtons unsavedChanges'
 	category: 'IDE'!
 
 !Browser methodsFor: 'accessing'!
@@ -393,7 +419,7 @@ TabWidget subclass: #Browser
 label
     ^selectedClass 
 	ifNil: ['Browser (nil)']
-	ifNotNil: [selectedClass name]
+	ifNotNil: ['Browser: ', selectedClass name]
 !
 
 categories
@@ -652,7 +678,7 @@ setMethodProtocol: aString
 addNewProtocol
     | newProtocol |
     newProtocol := self prompt: 'New method protocol'.
-    newProtocol notEmpty ifTrue: [
+    (newProtocol notNil and: [newProtocol notEmpty]) ifTrue: [
 	selectedMethod category: newProtocol.
 	self setMethodProtocol: newProtocol]
 !
@@ -719,7 +745,10 @@ renameClass
 
 addInstanceVariableNamed: aString toClass: aClass
 	ClassBuilder new
-		addSubclassOf: aClass superclass named: aClass name instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)
+		addSubclassOf: aClass superclass 
+		named: aClass name 
+		instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)
+		module: aClass module name
 !
 
 searchReferencesOf: aString
@@ -736,6 +765,17 @@ search: aString
 		searchedClass isClass
 			ifTrue: [self class openOn: searchedClass]
 			ifFalse: [self searchReferencesOf: aString]]
+!
+
+handleSourceAreaKeyDown: anEvent
+	 <if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 83) { //ctrl+s
+			self._compile();
+			anEvent.preventDefault();
+			return false;
+		}
+	}
+	>
 ! !
 
 !Browser methodsFor: 'initialization'!
@@ -759,7 +799,6 @@ renderTopPanelOn: html
     html div 
 	class: 'top'; 
 	with: [
-	    self renderInputOn: html.
 	    categoriesList := html ul class: 'jt_column browser categories'.
 	    commitButton := html button 
 		class: 'jt_commit';
@@ -779,7 +818,7 @@ renderTopPanelOn: html
 !
 
 renderTabsOn: html
-    tabsList := html ul class: 'jt_tabs'.
+    tabsList := html ul class: 'jt_tabs jt_browser'.
     self updateTabsList.
 !
 
@@ -789,6 +828,8 @@ renderBottomPanelOn: html
 	with: [
 	    sourceArea := SourceArea new.
 	    sourceArea renderOn: html.
+            sourceArea onKeyDown: [:e |
+                                   self handleSourceAreaKeyDown: e].
 	    sourceArea onKeyUp: [self updateStatus]]
 !
 
@@ -809,17 +850,8 @@ renderButtonsOn: html
 			with: 'PrintIt';
 			onClick: [sourceArea printIt].
 		html button with: 'InspectIt';
-			onClick: [sourceArea inspectit]]. 
+			onClick: [sourceArea inspectIt]]. 
     self updateSourceAndButtons
-!
-
-renderInputOn: html 
-	input := html input 
-		class: 'implementors';
-		yourself.
-	input onKeyPress: [:event |
-		event keyCode = 13 ifTrue: [
-			self search: input asJQuery val]]
 ! !
 
 !Browser methodsFor: 'testing'!
@@ -884,17 +916,26 @@ updateTabsList
 	li := html li.
 	selectedTab = #instance ifTrue: [li class: 'selected'].
 	li
-	    with: 'Instance';
+	    with: [
+              	html span class: 'ltab'.
+              	html span class: 'mtab'; with: 'Instance'.
+              	html span class: 'rtab'];
 	    onClick: [self selectTab: #instance].
 	li := html li.
 	selectedTab = #class ifTrue: [li class: 'selected'].
 	li
-	    with: 'Class';
+	    with: [
+              	html span class: 'ltab'.
+              	html span class: 'mtab'; with: 'Class'.
+              	html span class: 'rtab'];
 	    onClick: [self selectTab: #class].
 	li := html li.
 	selectedTab = #comment ifTrue: [li class: 'selected'].
 	li
-	    with: 'Comment';
+	    with: [
+              	html span class: 'ltab'.
+              	html span class: 'mtab'; with: 'Comment'.
+              	html span class: 'rtab'];
 	    onClick: [self selectTab: #comment]]
 !
 
@@ -1055,7 +1096,7 @@ renderTopPanelOn: html
 		with: [
 			variablesList := html ul class: 'jt_column variables'.
 			valueTextarea := html textarea class: 'jt_column value'; at: 'readonly' put: 'readonly'.
-                  	html div class: 'jt_buttons inspector'; with: [
+                  	html div class: 'jt_tabs inspector'; with: [
           			html button
                   			class: 'jt_button inspector refresh';
 					with: 'Refresh';
@@ -1152,7 +1193,7 @@ implementors
 !
 
 label
-	^'[ReferencesBrowser]'
+	^'[References]'
 !
 
 selector
@@ -1175,7 +1216,7 @@ referencedClasses
 
 openBrowserOn: aMethod
        | browser |
-       browser := Browser openOn: (aMethod class isMetaclass 
+       browser := Browser openOn: (aMethod methodClass isMetaclass 
 		ifTrue: [aMethod methodClass instanceClass] ifFalse: [aMethod methodClass]).
        aMethod methodClass isMetaclass ifTrue: [browser selectTab: #class].
        browser
@@ -1395,7 +1436,7 @@ currentLineOrSelection
 !SourceArea methodsFor: 'actions'!
 
 clear
-    textarea asJQuery val: ''
+      self val: ''
 !
 
 doIt
@@ -1904,7 +1945,7 @@ TabWidget subclass: #TestRunner
 !TestRunner methodsFor: 'accessing'!
 
 label
-    ^'[SUnit]'
+    ^'SUnit'
 !
 
 categories
@@ -2061,7 +2102,7 @@ renderClassesOn: html
 renderResultsOn: html
     	statusDiv := html div.
 	html with: self progressBar.
-   	methodsList := html ul class: 'jt_column sunit methods'.
+   	methodsList := html ul class: 'jt_column sunit results'.
 	self updateMethodsList.
 	self updateStatusDiv
 !

+ 185 - 10
st/Kernel-Tests.st

@@ -19,6 +19,17 @@ testStreamContents
 testIncludesSubString
 	self assert: ('jtalk' includesSubString: 'alk').
 	self deny: ('jtalk' includesSubString: 'zork').
+!
+
+testEquality
+	self assert: 'hello' = 'hello'.
+	self deny: 'hello' = 'world'.
+
+	self assert: 'hello'  = 'hello' yourself.
+	self assert: 'hello' yourself = 'hello'.
+
+	"test JS falsy value"
+	self deny: '' = 0
 ! !
 
 TestCase subclass: #DictionaryTest
@@ -28,37 +39,201 @@ TestCase subclass: #DictionaryTest
 !DictionaryTest methodsFor: 'tests'!
 
 testPrintString
-	self 
+	self
 		assert: 'a Dictionary(''firstname'' -> ''James'' , ''lastname'' -> ''Bond'')' 
 		equals: (Dictionary new 
                          	at:'firstname' put: 'James';
                         	at:'lastname' put: 'Bond';
                         	printString)
-! !
+!
 
-TestCase subclass: #NumberTest
-	instanceVariableNames: ''
-	category: 'Kernel-Tests'!
+testEquality
+	| d1 d2 |
 
-!NumberTest methodsFor: 'tests'!
+	self assert: Dictionary new = Dictionary new.
+		
+	d1 := Dictionary new at: 1 put: 2; yourself.
+	d2 := Dictionary new at: 1 put: 2; yourself.
+	self assert: d1 = d2.
 
-testNegated
-	self assert: (3 negated + 4) equals: 1
+	d2 := Dictionary new at: 1 put: 3; yourself.
+	self deny: d1 = d2.
+
+	d2 := Dictionary new at: 2 put: 2; yourself.
+	self deny: d1 = d2.
+
+	d2 := Dictionary new at: 1 put: 2; at: 3 put: 4; yourself.
+	self deny: d1 = d2.
+!
+
+testDynamicDictionaries
+	self assert: #{1 -> 'hello'. 2 -> 'world'} = (Dictionary with: 1 -> 'hello' with: 2 -> 'world')
 ! !
 
 TestCase subclass: #BooleanTest
 	instanceVariableNames: ''
 	category: 'Kernel-Tests'!
 
-!BooleanTest methodsFor: 'tests'!
+!BooleanTest methodsFor: 'not yet classified'!
 
 testLogic
-
+ 
 	"Trivial logic table"
 	self assert: (true & true); deny: (true & false); deny: (false & true); deny: (false & false).
 	self assert: (true | true); assert: (true | false); assert: (false | true); deny: (false | false).
         "Checking that expressions work fine too"
 	self assert: (true & (1 > 0)); deny: ((1 > 0) & false); deny: ((1 > 0) & (1 > 2)).
         self assert: (false | (1 > 0)); assert: ((1 > 0) | false); assert: ((1 > 0) | (1 > 2))
+!
+
+testEquality
+	"We're on top of JS...just be sure to check the basics!!"
+
+	self deny: 0 = false. 
+	self deny: false = 0.
+	self deny: '' = false.
+	self deny: false = ''.
+
+	self assert: true = true.
+	self deny: false = true.
+	self deny: true = false.
+	self assert: false = false.
+
+	"JS may do some type coercing after sending a message"
+	self assert: true yourself = true.
+	self assert: true yourself = true yourself
+!
+
+testLogicKeywords
+ 
+	"Trivial logic table"
+	self 
+		assert: (true and: [ true]); 
+		deny: (true and: [ false ]); 
+		deny: (false and: [ true ]); 
+		deny: (false and: [ false ]).
+	self 
+		assert: (true or: [ true ]); 
+		assert: (true or: [ false ]); 
+		assert: (false or: [ true ]); 
+		deny: (false or: [ false ]).
+        
+	"Checking that expressions work fine too"
+	self 
+		assert: (true and: [ 1 > 0 ]); 
+		deny: ((1 > 0) and: [ false ]); 
+		deny: ((1 > 0) and: [ 1 > 2 ]).
+        self 
+		assert: (false or: [ 1 > 0 ]); 
+		assert: ((1 > 0) or: [ false ]); 
+		assert: ((1 > 0) or: [ 1 > 2 ])
+!
+
+testIfTrueIfFalse
+ 
+	self assert: (true ifTrue: ['alternative block']) = 'alternative block'.
+	self assert: (true ifFalse: ['alternative block']) = nil.
+
+	self assert: (false ifTrue: ['alternative block']) = nil.
+	self assert: (false ifFalse: ['alternative block']) = 'alternative block'.
+
+	self assert: (false ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block2'.
+	self assert: (false ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block'.
+
+	self assert: (true ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block'.
+	self assert: (true ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block2'.
+! !
+
+TestCase subclass: #NumberTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!NumberTest methodsFor: 'tests'!
+
+testEquality
+	self assert: 1 = 1.
+	self assert: 0 = 0.
+	self deny: 1 = 0.
+
+	self assert: 1 yourself = 1.
+	self assert: 1 = 1 yourself.
+	self assert: 1 yourself = 1 yourself.
+	
+	self deny: 0 = false.
+	self deny: false = 0.
+	self deny: '' = 0.
+	self deny: 0 = ''
+!
+
+testArithmetic
+	
+	"We rely on JS here, so we won't test complex behavior, just check if 
+	message sends are corrects"
+
+	self assert: 1.5 + 1 = 2.5.
+	self assert: 2 - 1 = 1.
+	self assert: -2 - 1 = -3.
+	self assert: 12 / 2 = 6.
+	self assert: 3 * 4 = 12.
+
+	"Simple parenthesis and execution order"
+
+	self assert: 1 + 2 * 3 = 9.
+	self assert: 1 + (2 * 3) = 7
+!
+
+testRounded
+	
+	self assert: 3 rounded = 3.
+	self assert: 3.212 rounded = 3.
+	self assert: 3.51 rounded = 4
+!
+
+testNegated
+	self assert: 3 negated = -3.
+	self assert: -3 negated = 3
+!
+
+testComparison
+
+	self assert: 3 > 2.
+	self assert: 2 < 3.
+	
+	self deny: 3 < 2.
+	self deny: 2 > 3.
+
+	self assert: 3 >= 3.
+	self assert: 3.1 >= 3.
+	self assert: 3 <= 3.
+	self assert: 3 <= 3.1
+!
+
+testTruncated
+	
+	self assert: 3 truncated = 3.
+	self assert: 3.212 truncated = 3.
+	self assert: 3.51 truncated = 3
+! !
+
+TestCase subclass: #NumberTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!NumberTest methodsFor: 'not yet classified'!
+
+testPrintShowingDecimalPlaces
+	self assert: '23.00' equals: (23 printShowingDecimalPlaces: 2).
+	self assert: '23.57' equals: (23.5698 printShowingDecimalPlaces: 2).
+	self assert: '-234.56700' equals:( 234.567 negated printShowingDecimalPlaces: 5).
+	self assert: '23' equals: (23.4567 printShowingDecimalPlaces: 0).
+	self assert: '24' equals: (23.5567 printShowingDecimalPlaces: 0).
+	self assert: '-23' equals: (23.4567 negated printShowingDecimalPlaces: 0).
+	self assert: '-24' equals: (23.5567 negated printShowingDecimalPlaces: 0).
+	self assert: '100000000.0' equals: (100000000 printShowingDecimalPlaces: 1).
+	self assert: '0.98000' equals: (0.98 printShowingDecimalPlaces: 5).
+	self assert: '-0.98' equals: (0.98 negated printShowingDecimalPlaces: 2).
+	self assert: '2.57' equals: (2.567 printShowingDecimalPlaces: 2).
+	self assert: '-2.57' equals: (-2.567 printShowingDecimalPlaces: 2).
+	self assert: '0.00' equals: (0 printShowingDecimalPlaces: 2).
 ! !
 

+ 80 - 21
st/Kernel.st

@@ -39,11 +39,19 @@ basicDelete: aString
 !Object methodsFor: 'comparing'!
 
 = anObject
-	<return self == anObject>
+	^self == anObject
 !
 
 ~= anObject
 	^(self = anObject) = false
+!
+
+== anObject
+	<return self === anObject>
+!
+
+~~ anObject
+	^(self == anObject) = false
 ! !
 
 !Object methodsFor: 'converting'!
@@ -656,11 +664,6 @@ negated
 
 !Number methodsFor: 'comparing'!
 
-= aNumber
-	"Inlined in the Compiler"
-	<return Number(self) == aNumber>
-!
-
 > aNumber
 	"Inlined in the Compiler"
 	<return self >> aNumber>
@@ -679,6 +682,16 @@ negated
 <= aNumber
 	"Inlined in the Compiler"
 	<return self <= aNumber>
+!
+
+= aNumber
+	aNumber class = self class ifFalse: [^false]. 
+	<return Number(self) == aNumber>
+!
+
+== aNumber
+	aNumber class = self class ifFalse: [^false]. 
+	<return Number(self) === Number(aNumber)>
 ! !
 
 !Number methodsFor: 'converting'!
@@ -748,6 +761,10 @@ to: aNumber do: aBlock
 
 printString
 	<return String(self)>
+!
+
+printShowingDecimalPlaces: placesDesired
+	<return self.toFixed(placesDesired)>
 ! !
 
 !Number methodsFor: 'testing'!
@@ -880,11 +897,13 @@ Object subclass: #Boolean
 !Boolean methodsFor: 'comparing'!
 
 = aBoolean
+	aBoolean class = self class ifFalse: [^false].
 	<return Boolean(self == true) == aBoolean>
 !
 
-asJSONObject
-	^self
+== aBoolean
+	aBoolean class = self class ifFalse: [^false].
+	<return Boolean(self == true) === Boolean(aBoolean == true)>
 ! !
 
 !Boolean methodsFor: 'controlling'!
@@ -951,6 +970,12 @@ not
 	>
 ! !
 
+!Boolean methodsFor: 'converting'!
+
+asJSONObject
+	^self
+! !
+
 !Boolean methodsFor: 'copying'!
 
 shallowCopy
@@ -1381,6 +1406,14 @@ notEmpty
 
 isEmpty
 	^self size = 0
+!
+
+ifNotEmpty: aBlock
+	self notEmpty ifTrue: aBlock.
+!
+
+ifEmpty: aBlock
+	self isEmpty ifTrue: aBlock.
 ! !
 
 !Collection class methodsFor: 'accessing'!
@@ -1568,10 +1601,6 @@ remove: anObject
 
 !String methodsFor: 'comparing'!
 
-= aString
-	<return String(self) == aString>
-!
-
 > aString
 	<return String(self) >> aString>
 !
@@ -1586,6 +1615,16 @@ remove: anObject
 
 <= aString
 	<return String(self) <= aString>
+!
+
+= aString
+	aString class = self class ifFalse: [^false].
+	<return String(self) == aString>
+!
+
+== aString
+	aString class = self class ifFalse: [^false].
+	<return String(self) === String(aString)>
 ! !
 
 !String methodsFor: 'converting'!
@@ -1891,6 +1930,16 @@ removeFrom: aNumber to: anotherNumber
 	<self.splice(aNumber - 1,anotherNumber - 1)>
 ! !
 
+!Array methodsFor: 'comparing'!
+
+= aCollection
+	(self class = aCollection class and: [
+        	self size = aCollection size]) ifFalse: [^false].
+	self withIndexDo: [:each :i |
+                 (aCollection at: i) = each ifFalse: [^false]].
+	^true
+! !
+
 !Array methodsFor: 'converting'!
 
 asJavascript
@@ -2174,10 +2223,8 @@ removeKey: aKey
 
 = aDictionary
 	self class = aDictionary class ifFalse: [^false].
-	self associationsDo: [:assoc |
-	    (aDictionary at: assoc key ifAbsent: [^false]) = assoc value 
-		ifFalse: [^false]].
-	^true
+	self size = aDictionary size ifFalse: [^false].
+	^self associations = aDictionary associations
 ! !
 
 !Dictionary methodsFor: 'converting'!
@@ -2734,7 +2781,7 @@ ErrorHandler class instanceVariableNames: 'current'!
 !ErrorHandler class methodsFor: 'accessing'!
 
 current
-	^current
+	^current ifNil: [current := self new]
 !
 
 setCurrent: anHandler
@@ -2743,10 +2790,6 @@ setCurrent: anHandler
 
 !ErrorHandler class methodsFor: 'initialization'!
 
-initialize
-	self register
-!
-
 register
 	ErrorHandler setCurrent: self new
 ! !
@@ -2780,6 +2823,15 @@ inspectOn: anInspector
 		variables._at_put_(i, self['@jsObject'][i]);
 	}>.
 	anInspector setVariables: variables
+!
+
+doesNotUnderstand: aMessage
+	| obj selector arguments |
+	obj := self jsObject.
+	selector := aMessage selector.
+	arguments := aMessage arguments.
+	<if(obj[selector]) {return smalltalk.send(obj, selector, arguments)}>.
+	super doesNotUnderstand: aMessage
 ! !
 
 !JSObjectProxy class methodsFor: 'instance creation'!
@@ -2819,6 +2871,13 @@ remove: anObject
 	elements remove: anObject
 ! !
 
+!Set methodsFor: 'comparing'!
+
+= aCollection
+	^self class = aCollection class and: [
+        	elements = aCollection asArray]
+! !
+
 !Set methodsFor: 'converting'!
 
 asArray

+ 26 - 15
st/Makefile

@@ -16,35 +16,39 @@ FLAGS   := -d
 OBJECTS := $(patsubst %.st,%.js,$(wildcard *.st))
 
 # Default make target since it is the first target in this Makefile
-all: Examples.js
+all: $(OBJECTS)
 
 # Step by step
 #
 # First we copy the core javascript files from current working files
-# into this directory. These files are hand written. $@ is the target name.
-boot.js init.js:
+# into this directory. These files are hand written or generated using
+# other tools (parser.js). $@ is the target name.
+boot.js init.js parser.js:
 	cp ../js/$@ .
 
-# Then we compile Kernel.st depending on having using boot.js and init.js
+# Then we compile Kernel.st depending on having boot.js, init.js and parser.js
 # $< means the first dependency - in other words Kernel.st
-Kernel.js: Kernel.st boot.js init.js
+Kernel.js: Kernel.st boot.js init.js parser.js
 	$(JTALKC) $(FLAGS) $<
 
 # ...and Compiler, but using the new Kernel from above.
-# We only need to depend on Kernel.js since it in turn depends on Kernel.js, boot.js etc
+# We only need to depend on Kernel.js since it in turn depends on boot.js etc
 Compiler.js: Compiler.st Kernel.js
 	$(JTALKC) $(FLAGS) $<
 
-# ...now that we have a new Kernel/Parser/Compiler we use them
-# to compile the rest of st files presuming that they only depend on Compiler, like
+# ...now that we have a new Kernel and Compiler we use them
+# to compile the rest of st files presuming that they only depend on Kernel, like
 # for example Canvas.js and Benchfib.js.
-%.js: %.st Compiler.js 
+%.js: %.st Compiler.js
+	echo $(OBJECTS)
 	$(JTALKC) $(FLAGS) $<
 
-# But for some libraries there are dependencies to care for. Then
+# But for some libraries there are more dependencies to care for. Then
 # we need to use -l so that the compiler first loads that library
 # before compiling the .st file. Otherwise bindings will fail.
 #
+# NOTE: With the new dependency model in class Package etc this will change!
+#
 # JQuery uses Canvas
 JQuery.js: JQuery.st Canvas.js
 	$(JTALKC) $(FLAGS) -l Canvas $<
@@ -53,13 +57,20 @@ JQuery.js: JQuery.st Canvas.js
 IDE.js: IDE.st JQuery.js
 	$(JTALKC) $(FLAGS) -l Canvas,JQuery $<
 
-# The SUnit TestRunner uses UI stuff from IDE.
-SUnit.js: SUnit.st IDE.js
+TrySmalltalk.js: TrySmalltalk.st IDE.js
 	$(JTALKC) $(FLAGS) -l Canvas,JQuery,IDE $<
 
-# Some Examples use SUnit
-Examples.js: Examples.st SUnit.js
-	$(JTALKC) $(FLAGS) -l Canvas,JQuery,IDE,SUnit $<;
+# Some Examples use SUnit and also IDE
+Examples.js: Examples.st SUnit.js IDE.js
+	$(JTALKC) $(FLAGS) -l SUnit,Canvas,JQuery,IDE $<;
+
+# Tests typically also use SUnit
+Kernel-Tests.js: Kernel-Tests.st SUnit.js
+	$(JTALKC) $(FLAGS) -l SUnit $<;
+
+# Tests typically also use SUnit
+JQuery-Tests.js: JQuery-Tests.st JQuery.js SUnit.js
+	$(JTALKC) $(FLAGS) -l Canvas,JQuery,SUnit $<;
 
 
 # Installing is simply copying all js files to js directory.

+ 0 - 0
examples/trysmalltalk/TrySmalltalk.st → st/TrySmalltalk.st


Some files were not shown because too many files changed in this diff