Browse Source

Convert spaces to tabs in .st

Herbert Vojčík 12 years ago
parent
commit
8d0d0adde2

+ 46 - 46
st/Benchfib.st

@@ -14,43 +14,43 @@ main
 
 
 !Number methodsFor: '*Benchfib'!
 !Number methodsFor: '*Benchfib'!
 
 
-benchFib 
+benchFib
 	"Handy send-heavy benchmark"
 	"Handy send-heavy benchmark"
 	"(result // seconds to run) = approx calls per second"
 	"(result // seconds to run) = approx calls per second"
-	" | r t |
-	  t := Time millisecondsToRun: [r := 26 benchFib].
-	  (r * 1000) // t"
+	"	| r t |
+		t := Time millisecondsToRun: [r := 26 benchFib].
+		(r * 1000) // t"
 	"138000 on a Mac 8100/100"
 	"138000 on a Mac 8100/100"
-	^ self < 2 
-		ifTrue: [1] 
+	^ self < 2
+		ifTrue: [1]
 		ifFalse: [(self-1) benchFib + (self-2) benchFib + 1]
 		ifFalse: [(self-1) benchFib + (self-2) benchFib + 1]
 !
 !
 
 
-benchmark 
+benchmark
 	"Handy bytecode-heavy benchmark"
 	"Handy bytecode-heavy benchmark"
 	"(500000 // time to run) = approx bytecodes per second"
 	"(500000 // time to run) = approx bytecodes per second"
 	"5000000 // (Time millisecondsToRun: [10 benchmark]) * 1000"
 	"5000000 // (Time millisecondsToRun: [10 benchmark]) * 1000"
 	"3059000 on a Mac 8100/100"
 	"3059000 on a Mac 8100/100"
-    | size flags prime k count |
-    size := 8190.
-    1 to: self do:
-        [:iter |
-        count := 0.
-        flags := Array new.
-        size timesRepeat: [ flags add: true].
-        1 to: size do:
-            [:i | (flags at: i) ifTrue:
-                [prime := i+1.
-                k := i + prime.
-                [k <= size] whileTrue:
-                    [flags at: k put: false.
-                    k := k + prime].
-                count := count + 1]]].
-    ^ count
+	| size flags prime k count |
+	size := 8190.
+	1 to: self do:
+		[:iter |
+		count := 0.
+		flags := Array new.
+		size timesRepeat: [ flags add: true].
+		1 to: size do:
+			[:i | (flags at: i) ifTrue:
+				[prime := i+1.
+				k := i + prime.
+				[k <= size] whileTrue:
+					[flags at: k put: false.
+					k := k + prime].
+				count := count + 1]]].
+	^ count
 !
 !
 
 
 jsbenchFib
 jsbenchFib
- 
+
 	<if (this < 2) {
 	<if (this < 2) {
 return 1;
 return 1;
 } else {
 } else {
@@ -63,22 +63,22 @@ jsbenchmark
 var size = 8190;
 var size = 8190;
 var count;
 var count;
 for (var z=0;z<this;z++) {
 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;
-    }
-  }
+	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 count>
 !
 !
@@ -93,20 +93,20 @@ jstinyBenchmarks
 
 
 	n2 := 28.
 	n2 := 28.
 	[t2 := Date millisecondsToRun: [r := n2 jsbenchFib].
 	[t2 := Date millisecondsToRun: [r := n2 jsbenchFib].
-	t2 < 1000] whileTrue:[n2 := n2 + 1]. 
+	t2 < 1000] whileTrue:[n2 := n2 + 1].
 	"Note: #jsbenchFib's runtime is about O(k^n),
 	"Note: #jsbenchFib's runtime is about O(k^n),
 		where k is the golden number = (1 + 5 sqrt) / 2 = 1.618...."
 		where k is the golden number = (1 + 5 sqrt) / 2 = 1.618...."
 
 
 	^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',
 	^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',
-	  ((r * 1000) / t2) printString, ' sends/sec'
+		((r * 1000) / t2) printString, ' sends/sec'
 !
 !
 
 
-tinyBenchmarks 
+tinyBenchmarks
 	"Report the results of running the two tiny Squeak benchmarks.
 	"Report the results of running the two tiny Squeak benchmarks.
 	ar 9/10/1999: Adjusted to run at least 1 sec to get more stable results"
 	ar 9/10/1999: Adjusted to run at least 1 sec to get more stable results"
 	"0 tinyBenchmarks"
 	"0 tinyBenchmarks"
 	"On a 292 MHz G3 Mac: 22727272 bytecodes/sec; 984169 sends/sec"
 	"On a 292 MHz G3 Mac: 22727272 bytecodes/sec; 984169 sends/sec"
-	"On a 400 MHz PII/Win98:  18028169 bytecodes/sec; 1081272 sends/sec"
+	"On a 400 MHz PII/Win98: 18028169 bytecodes/sec; 1081272 sends/sec"
 	| t1 t2 r n1 n2 |
 	| t1 t2 r n1 n2 |
 	n1 := 1.
 	n1 := 1.
 	[t1 := Date millisecondsToRun: [n1 benchmark].
 	[t1 := Date millisecondsToRun: [n1 benchmark].
@@ -114,11 +114,11 @@ tinyBenchmarks
 
 
 	n2 := 16.
 	n2 := 16.
 	[t2 := Date millisecondsToRun: [r := n2 benchFib].
 	[t2 := Date millisecondsToRun: [r := n2 benchFib].
-	t2 < 1000] whileTrue:[n2 := n2 + 1]. 
+	t2 < 1000] whileTrue:[n2 := n2 + 1].
 	"Note: #benchFib's runtime is about O(k^n),
 	"Note: #benchFib's runtime is about O(k^n),
 		where k is the golden number = (1 + 5 sqrt) / 2 = 1.618...."
 		where k is the golden number = (1 + 5 sqrt) / 2 = 1.618...."
 
 
 	^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',
 	^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',
-	  ((r * 1000) / t2) printString, ' sends/sec'
+		((r * 1000) / t2) printString, ' sends/sec'
 ! !
 ! !
 
 

+ 166 - 166
st/Canvas.st

@@ -6,61 +6,61 @@ Object subclass: #HTMLCanvas
 !HTMLCanvas methodsFor: 'accessing'!
 !HTMLCanvas methodsFor: 'accessing'!
 
 
 root
 root
-    ^root
+	^root
 !
 !
 
 
 root: aTagBrush
 root: aTagBrush
-    root := aTagBrush
+	root := aTagBrush
 !
 !
 
 
 snippet: anElement
 snippet: anElement
 	"Adds clone of anElement, finds [data-snippet=""*""] subelement
 	"Adds clone of anElement, finds [data-snippet=""*""] subelement
-    and returns TagBrush as if that subelement was just added.
-    
-    Rarely needed to use directly, use `html foo` dynamically installed method
-    for a snippet named foo."
-    
-    | clone caret |
-    
-    clone := anElement asJQuery clone.
-    self with: (TagBrush fromJQuery: clone canvas: self).
-    caret := clone find: '[data-snippet="*"]'.
-    caret toArray isEmpty ifTrue: [ caret := clone ].
-    ^TagBrush fromJQuery: (caret removeAttr: 'data-snippet') canvas: self
+	and returns TagBrush as if that subelement was just added.
+	
+	Rarely needed to use directly, use `html foo` dynamically installed method
+	for a snippet named foo."
+	
+	| clone caret |
+	
+	clone := anElement asJQuery clone.
+	self with: (TagBrush fromJQuery: clone canvas: self).
+	caret := clone find: '[data-snippet="*"]'.
+	caret toArray isEmpty ifTrue: [ caret := clone ].
+	^TagBrush fromJQuery: (caret removeAttr: 'data-snippet') canvas: self
 ! !
 ! !
 
 
 !HTMLCanvas methodsFor: 'adding'!
 !HTMLCanvas methodsFor: 'adding'!
 
 
 entity: aString
 entity: aString
 	"Adds a character representing html entity, eg.
 	"Adds a character representing html entity, eg.
-    html entity: 'copy'
-    adds a copyright sign.
-    If a name does not represent valid HTML entity, error is raised."
+	html entity: 'copy'
+	adds a copyright sign.
+	If a name does not represent valid HTML entity, error is raised."
 	| result |
 	| result |
-    result := ('<span />' asJQuery html: '&', aString, ';') text.
-    result size = 1 ifFalse: [ self error: 'Not an HTML entity: ', aString ].
-    self with: result
+	result := ('<span />' asJQuery html: '&', aString, ';') text.
+	result size = 1 ifFalse: [ self error: 'Not an HTML entity: ', aString ].
+	self with: result
 !
 !
 
 
 with: anObject
 with: anObject
-    ^self root with: anObject
+	^self root with: anObject
 ! !
 ! !
 
 
 !HTMLCanvas methodsFor: 'initialization'!
 !HTMLCanvas methodsFor: 'initialization'!
 
 
 initialize
 initialize
-    super initialize.
-    root ifNil: [root := TagBrush fromString: 'div' canvas: self]
+	super initialize.
+	root ifNil: [root := TagBrush fromString: 'div' canvas: self]
 !
 !
 
 
 initializeFromJQuery: aJQuery
 initializeFromJQuery: aJQuery
-    root := TagBrush fromJQuery: aJQuery canvas: self
+	root := TagBrush fromJQuery: aJQuery canvas: self
 ! !
 ! !
 
 
 !HTMLCanvas methodsFor: 'tags'!
 !HTMLCanvas methodsFor: 'tags'!
 
 
 a
 a
-    ^self tag: 'a'
+	^self tag: 'a'
 !
 !
 
 
 abbr
 abbr
@@ -76,7 +76,7 @@ area
 !
 !
 
 
 article
 article
-    ^self tag: 'article'
+	^self tag: 'article'
 !
 !
 
 
 aside
 aside
@@ -84,7 +84,7 @@ aside
 !
 !
 
 
 audio
 audio
-    ^self tag: 'audio'
+	^self tag: 'audio'
 !
 !
 
 
 base
 base
@@ -100,11 +100,11 @@ body
 !
 !
 
 
 br
 br
-    ^self tag: 'br'
+	^self tag: 'br'
 !
 !
 
 
 button
 button
-    ^self tag: 'button'
+	^self tag: 'button'
 !
 !
 
 
 canvas
 canvas
@@ -120,7 +120,7 @@ cite
 !
 !
 
 
 code
 code
-    ^self tag: 'code'
+	^self tag: 'code'
 !
 !
 
 
 col
 col
@@ -152,11 +152,11 @@ details
 !
 !
 
 
 div
 div
-    ^self tag: 'div'
+	^self tag: 'div'
 !
 !
 
 
 div: aBlock
 div: aBlock
-    ^self div with: aBlock
+	^self div with: aBlock
 !
 !
 
 
 dl
 dl
@@ -176,7 +176,7 @@ embed
 !
 !
 
 
 fieldset
 fieldset
-    ^self tag: 'fieldset'
+	^self tag: 'fieldset'
 !
 !
 
 
 figcaption
 figcaption
@@ -188,59 +188,59 @@ figure
 !
 !
 
 
 footer
 footer
-    ^self tag: 'footer'
+	^self tag: 'footer'
 !
 !
 
 
 form
 form
-    ^self tag: 'form'
+	^self tag: 'form'
 !
 !
 
 
 h1
 h1
-    ^self tag: 'h1'
+	^self tag: 'h1'
 !
 !
 
 
 h1: anObject
 h1: anObject
-    ^self h1 with: anObject
+	^self h1 with: anObject
 !
 !
 
 
 h2
 h2
-    ^self tag: 'h2'
+	^self tag: 'h2'
 !
 !
 
 
 h2: anObject
 h2: anObject
-    ^ self h2 with: anObject
+	^ self h2 with: anObject
 !
 !
 
 
 h3
 h3
-    ^self tag: 'h3'
+	^self tag: 'h3'
 !
 !
 
 
 h3: anObject
 h3: anObject
-    ^self h3 with: anObject
+	^self h3 with: anObject
 !
 !
 
 
 h4
 h4
-    ^self tag: 'h4'
+	^self tag: 'h4'
 !
 !
 
 
 h4: anObject
 h4: anObject
-    ^self h4 with: anObject
+	^self h4 with: anObject
 !
 !
 
 
 h5
 h5
-    ^self tag: 'h5'
+	^self tag: 'h5'
 !
 !
 
 
 h5: anObject
 h5: anObject
-    ^self h5 with: anObject
+	^self h5 with: anObject
 !
 !
 
 
 h6
 h6
-    ^self tag: 'h6'
+	^self tag: 'h6'
 !
 !
 
 
 h6: anObject
 h6: anObject
-    ^self h6 with: anObject
+	^self h6 with: anObject
 !
 !
 
 
 head
 head
@@ -248,7 +248,7 @@ head
 !
 !
 
 
 header
 header
-    ^self tag: 'header'
+	^self tag: 'header'
 !
 !
 
 
 hgroup
 hgroup
@@ -256,7 +256,7 @@ hgroup
 !
 !
 
 
 hr
 hr
-    ^self tag: 'hr'
+	^self tag: 'hr'
 !
 !
 
 
 html
 html
@@ -264,23 +264,23 @@ html
 !
 !
 
 
 iframe
 iframe
-    ^self tag: 'iframe'
+	^self tag: 'iframe'
 !
 !
 
 
 iframe: aString
 iframe: aString
-    ^self iframe src: aString
+	^self iframe src: aString
 !
 !
 
 
 img
 img
-    ^self tag: 'img'
+	^self tag: 'img'
 !
 !
 
 
 img: aString
 img: aString
-    ^self img src: aString
+	^self img src: aString
 !
 !
 
 
 input
 input
-    ^self tag: 'input'
+	^self tag: 'input'
 !
 !
 
 
 label
 label
@@ -292,15 +292,15 @@ legend
 !
 !
 
 
 li
 li
-    ^self tag: 'li'
+	^self tag: 'li'
 !
 !
 
 
 li: anObject
 li: anObject
-    ^self li with: anObject
+	^self li with: anObject
 !
 !
 
 
 link
 link
-    ^self tag: 'link'
+	^self tag: 'link'
 !
 !
 
 
 map
 map
@@ -324,7 +324,7 @@ nav
 !
 !
 
 
 newTag: aString
 newTag: aString
-    ^TagBrush fromString: aString canvas: self
+	^TagBrush fromString: aString canvas: self
 !
 !
 
 
 noscript
 noscript
@@ -336,11 +336,11 @@ object
 !
 !
 
 
 ol
 ol
-    ^self tag: 'ol'
+	^self tag: 'ol'
 !
 !
 
 
 ol: anObject
 ol: anObject
-    ^self ol with: anObject
+	^self ol with: anObject
 !
 !
 
 
 optgroup
 optgroup
@@ -348,7 +348,7 @@ optgroup
 !
 !
 
 
 option
 option
-    ^self tag: 'option'
+	^self tag: 'option'
 !
 !
 
 
 output
 output
@@ -356,11 +356,11 @@ output
 !
 !
 
 
 p
 p
-    ^self tag: 'p'
+	^self tag: 'p'
 !
 !
 
 
 p: anObject
 p: anObject
-    ^self p with: anObject
+	^self p with: anObject
 !
 !
 
 
 param
 param
@@ -368,7 +368,7 @@ param
 !
 !
 
 
 pre
 pre
-    ^self tag: 'pre'
+	^self tag: 'pre'
 !
 !
 
 
 progress
 progress
@@ -376,15 +376,15 @@ progress
 !
 !
 
 
 script
 script
-    ^self tag: 'script'
+	^self tag: 'script'
 !
 !
 
 
 section
 section
-    ^self tag: 'section'
+	^self tag: 'section'
 !
 !
 
 
 select
 select
-    ^self tag: 'select'
+	^self tag: 'select'
 !
 !
 
 
 small
 small
@@ -396,11 +396,11 @@ source
 !
 !
 
 
 span
 span
-    ^self tag: 'span'
+	^self tag: 'span'
 !
 !
 
 
 span: anObject
 span: anObject
-    ^self span with: anObject
+	^self span with: anObject
 !
 !
 
 
 strong
 strong
@@ -412,7 +412,7 @@ strong: anObject
 !
 !
 
 
 style
 style
-	^ root addBrush:  (StyleTag canvas: self)
+	^ root addBrush: (StyleTag canvas: self)
 !
 !
 
 
 style: aString
 style: aString
@@ -432,35 +432,35 @@ sup
 !
 !
 
 
 table
 table
-    ^self tag: 'table'
+	^self tag: 'table'
 !
 !
 
 
 tag: aString
 tag: aString
-    ^root addBrush: (self newTag: aString)
+	^root addBrush: (self newTag: aString)
 !
 !
 
 
 tbody
 tbody
-    ^self tag: 'tbody'
+	^self tag: 'tbody'
 !
 !
 
 
-td 
-    ^self tag: 'td'
+td
+	^self tag: 'td'
 !
 !
 
 
 textarea
 textarea
-    ^self tag: 'textarea'
+	^self tag: 'textarea'
 !
 !
 
 
 tfoot
 tfoot
-    ^self tag: 'tfoot'
+	^self tag: 'tfoot'
 !
 !
 
 
 th
 th
-    ^self tag: 'th'
+	^self tag: 'th'
 !
 !
 
 
 thead
 thead
-    ^self tag: 'thead'
+	^self tag: 'thead'
 !
 !
 
 
 time
 time
@@ -472,19 +472,19 @@ title
 !
 !
 
 
 tr
 tr
-    ^self tag: 'tr'
+	^self tag: 'tr'
 !
 !
 
 
 ul
 ul
-    ^self tag: 'ul'
+	^self tag: 'ul'
 !
 !
 
 
 ul: anObject
 ul: anObject
-    ^self ul with: anObject
+	^self ul with: anObject
 !
 !
 
 
 video
 video
-    ^self tag: 'video'
+	^self tag: 'video'
 ! !
 ! !
 
 
 !HTMLCanvas class methodsFor: 'instance creation'!
 !HTMLCanvas class methodsFor: 'instance creation'!
@@ -571,23 +571,23 @@ snippets
 
 
 initializeFromJQuery: aJQuery
 initializeFromJQuery: aJQuery
 	"Finds and takes out all snippets out of aJQuery.
 	"Finds and takes out all snippets out of aJQuery.
-    Installs it into self."
-    
+	Installs it into self."
+	
 	(self snippetsFromJQuery: aJQuery) do: [ :each |
 	(self snippetsFromJQuery: aJQuery) do: [ :each |
-    	self installSnippetFromJQuery: each asJQuery ]
+		self installSnippetFromJQuery: each asJQuery ]
 ! !
 ! !
 
 
 !HTMLSnippet methodsFor: 'method generation'!
 !HTMLSnippet methodsFor: 'method generation'!
 
 
 snippetAt: aString compile: anElement
 snippetAt: aString compile: anElement
 	"Method generation for the snippet.
 	"Method generation for the snippet.
-    The selector is aString, the method block uses anElement"
-    
-    ClassBuilder new
-    	installMethod: ([ :htmlReceiver | htmlReceiver snippet: anElement ] 
-        	currySelf asCompiledMethod: aString)
-        forClass: HTMLCanvas
-        category: '**snippets'
+	The selector is aString, the method block uses anElement"
+	
+	ClassBuilder new
+		installMethod: ([ :htmlReceiver | htmlReceiver snippet: anElement ]
+			currySelf asCompiledMethod: aString)
+		forClass: HTMLCanvas
+		category: '**snippets'
 ! !
 ! !
 
 
 !HTMLSnippet methodsFor: 'private'!
 !HTMLSnippet methodsFor: 'private'!
@@ -600,20 +600,20 @@ snippetsFromJQuery: aJQuery
 
 
 installSnippetFromJQuery: element
 installSnippetFromJQuery: element
 	| name |
 	| name |
-    name := element attr: 'data-snippet'.
-    name = '*' ifFalse: [
-    	('^\*' asRegexp test: name) 
-            ifTrue: [ 
-            	name := name allButFirst. 
-                element attr: 'data-snippet' put: '*' ]
-          	ifFalse: [ 
-            	element removeAttr: 'data-snippet' ].
-        self snippetAt: name install: (element detach get: 0) ]
+	name := element attr: 'data-snippet'.
+	name = '*' ifFalse: [
+		('^\*' asRegexp test: name)
+			ifTrue: [
+				name := name allButFirst.
+				element attr: 'data-snippet' put: '*' ]
+			ifFalse: [
+				element removeAttr: 'data-snippet' ].
+		self snippetAt: name install: (element detach get: 0) ]
 !
 !
 
 
 snippetAt: aString install: anElement
 snippetAt: aString install: anElement
 	self snippets at: aString put: anElement.
 	self snippets at: aString put: anElement.
-    self snippetAt: aString compile: anElement
+	self snippetAt: aString compile: anElement
 ! !
 ! !
 
 
 HTMLSnippet class instanceVariableNames: 'current'!
 HTMLSnippet class instanceVariableNames: 'current'!
@@ -621,15 +621,15 @@ HTMLSnippet class instanceVariableNames: 'current'!
 !HTMLSnippet class methodsFor: 'initialization'!
 !HTMLSnippet class methodsFor: 'initialization'!
 
 
 ensureCurrent
 ensureCurrent
-	current ifNil: [ 
-    	current := super new
+	current ifNil: [
+		current := super new
 			initializeFromJQuery: document asJQuery;
 			initializeFromJQuery: document asJQuery;
 			yourself ]
 			yourself ]
 !
 !
 
 
 initialize
 initialize
 	super initialize.
 	super initialize.
-    self isDOMAvailable ifTrue: [
+	self isDOMAvailable ifTrue: [
 		self ensureCurrent ]
 		self ensureCurrent ]
 ! !
 ! !
 
 
@@ -654,50 +654,50 @@ Object subclass: #TagBrush
 !TagBrush methodsFor: 'accessing'!
 !TagBrush methodsFor: 'accessing'!
 
 
 element
 element
-    ^element
+	^element
 ! !
 ! !
 
 
 !TagBrush methodsFor: 'adding'!
 !TagBrush methodsFor: 'adding'!
 
 
 addBrush: aTagBrush
 addBrush: aTagBrush
-    self appendChild: aTagBrush element.
-    ^aTagBrush
+	self appendChild: aTagBrush element.
+	^aTagBrush
 !
 !
 
 
 append: anObject
 append: anObject
-    anObject appendToBrush: self
+	anObject appendToBrush: self
 !
 !
 
 
 appendBlock: aBlock
 appendBlock: aBlock
-    | root |
-    root := canvas root.
-    canvas root: self.
-    aBlock value: canvas.
-    canvas root: root
+	| root |
+	root := canvas root.
+	canvas root: self.
+	aBlock value: canvas.
+	canvas root: root
 !
 !
 
 
 appendChild: anElement
 appendChild: anElement
-	"In IE7 and IE8 appendChild fails on several node types. So we need to check" 
- 	<var element=self['@element'];
- 	if (null == element.canHaveChildren || element.canHaveChildren) {
+	"In IE7 and IE8 appendChild fails on several node types. So we need to check"
+	<var element=self['@element'];
+	if (null == element.canHaveChildren || element.canHaveChildren) {
 		element.appendChild(anElement);
 		element.appendChild(anElement);
- 	} else {
- 		element.text = String(element.text) +  anElement.innerHTML;
- 	} >
+	} else {
+		element.text = String(element.text) + anElement.innerHTML;
+	} >
 !
 !
 
 
 appendString: aString
 appendString: aString
-    self appendChild: (self createTextNodeFor: aString)
+	self appendChild: (self createTextNodeFor: aString)
 !
 !
 
 
 appendToBrush: aTagBrush
 appendToBrush: aTagBrush
-    aTagBrush addBrush: self
+	aTagBrush addBrush: self
 !
 !
 
 
 contents: anObject
 contents: anObject
-    self 
+	self
 	empty;
 	empty;
-   	append: anObject
+	append: anObject
 !
 !
 
 
 empty
 empty
@@ -705,7 +705,7 @@ empty
 !
 !
 
 
 with: anObject
 with: anObject
-    self append: anObject
+	self append: anObject
 ! !
 ! !
 
 
 !TagBrush methodsFor: 'attributes'!
 !TagBrush methodsFor: 'attributes'!
@@ -727,11 +727,11 @@ alt: aString
 !
 !
 
 
 at: aString put: aValue
 at: aString put: aValue
-    <self['@element'].setAttribute(aString, aValue)>
+	<self['@element'].setAttribute(aString, aValue)>
 !
 !
 
 
 class: aString
 class: aString
-      <self['@element'].className = aString>
+	<self['@element'].className = aString>
 !
 !
 
 
 cols: aString
 cols: aString
@@ -755,7 +755,7 @@ for: aString
 !
 !
 
 
 height: aString
 height: aString
-    self  at: 'height' put: aString
+	self at: 'height' put: aString
 !
 !
 
 
 hidden
 hidden
@@ -763,15 +763,15 @@ hidden
 !
 !
 
 
 href: aString
 href: aString
-    self at: 'href' put: aString
+	self at: 'href' put: aString
 !
 !
 
 
 id: aString
 id: aString
-    self at: 'id' put: aString
+	self at: 'id' put: aString
 !
 !
 
 
 media: aString
 media: aString
-    self at: 'media' put: aString
+	self at: 'media' put: aString
 !
 !
 
 
 method: aString
 method: aString
@@ -787,11 +787,11 @@ placeholder: aString
 !
 !
 
 
 rel: aString
 rel: aString
-    self  at: 'rel' put: aString
+	self at: 'rel' put: aString
 !
 !
 
 
 removeAt: aString
 removeAt: aString
-    <self['@element'].removeAttribute(aString)>
+	<self['@element'].removeAttribute(aString)>
 !
 !
 
 
 rows: aString
 rows: aString
@@ -799,11 +799,11 @@ rows: aString
 !
 !
 
 
 src: aString
 src: aString
-    self  at: 'src' put: aString
+	self at: 'src' put: aString
 !
 !
 
 
 style: aString
 style: aString
-    self at: 'style' put: aString
+	self at: 'style' put: aString
 !
 !
 
 
 tabindex: aNumber
 tabindex: aNumber
@@ -815,11 +815,11 @@ target: aString
 !
 !
 
 
 title: aString
 title: aString
-    self at: 'title' put: aString
+	self at: 'title' put: aString
 !
 !
 
 
 type: aString
 type: aString
-    self at: 'type' put: aString
+	self at: 'type' put: aString
 !
 !
 
 
 valign: aString
 valign: aString
@@ -827,31 +827,31 @@ valign: aString
 !
 !
 
 
 value: aString
 value: aString
-    self  at: 'value' put: aString
+	self at: 'value' put: aString
 !
 !
 
 
 width: aString
 width: aString
-    self  at: 'width' put: aString
+	self at: 'width' put: aString
 ! !
 ! !
 
 
 !TagBrush methodsFor: 'converting'!
 !TagBrush methodsFor: 'converting'!
 
 
 asJQuery
 asJQuery
-    ^window jQuery: self element
+	^window jQuery: self element
 ! !
 ! !
 
 
 !TagBrush methodsFor: 'events'!
 !TagBrush methodsFor: 'events'!
 
 
 onBlur: aBlock
 onBlur: aBlock
-    self asJQuery bind: 'blur' do: aBlock
+	self asJQuery bind: 'blur' do: aBlock
 !
 !
 
 
 onChange: aBlock
 onChange: aBlock
-    self asJQuery bind: 'change' do: aBlock
+	self asJQuery bind: 'change' do: aBlock
 !
 !
 
 
 onClick: aBlock
 onClick: aBlock
-    self asJQuery bind: 'click' do: aBlock
+	self asJQuery bind: 'click' do: aBlock
 !
 !
 
 
 onDblClick: aBlock
 onDblClick: aBlock
@@ -859,7 +859,7 @@ onDblClick: aBlock
 !
 !
 
 
 onFocus: aBlock
 onFocus: aBlock
-    self asJQuery bind: 'focus' do: aBlock
+	self asJQuery bind: 'focus' do: aBlock
 !
 !
 
 
 onFocusIn: aBlock
 onFocusIn: aBlock
@@ -875,15 +875,15 @@ onHover: aBlock
 !
 !
 
 
 onKeyDown: aBlock
 onKeyDown: aBlock
-    self asJQuery bind: 'keydown' do: aBlock
+	self asJQuery bind: 'keydown' do: aBlock
 !
 !
 
 
 onKeyPress: aBlock
 onKeyPress: aBlock
-    self asJQuery bind: 'keypress' do: aBlock
+	self asJQuery bind: 'keypress' do: aBlock
 !
 !
 
 
 onKeyUp: aBlock
 onKeyUp: aBlock
-    self asJQuery bind: 'keyup' do: aBlock
+	self asJQuery bind: 'keyup' do: aBlock
 !
 !
 
 
 onMouseDown: aBlock
 onMouseDown: aBlock
@@ -929,13 +929,13 @@ onUnload: aBlock
 !TagBrush methodsFor: 'initialization'!
 !TagBrush methodsFor: 'initialization'!
 
 
 initializeFromJQuery: aJQuery canvas: aCanvas
 initializeFromJQuery: aJQuery canvas: aCanvas
-    element := aJQuery get: 0.
-    canvas := aCanvas
+	element := aJQuery get: 0.
+	canvas := aCanvas
 !
 !
 
 
 initializeFromString: aString canvas: aCanvas
 initializeFromString: aString canvas: aCanvas
-    element := self createElementFor: aString.
-    canvas := aCanvas
+	element := self createElementFor: aString.
+	canvas := aCanvas
 ! !
 ! !
 
 
 !TagBrush methodsFor: 'private'!
 !TagBrush methodsFor: 'private'!
@@ -951,13 +951,13 @@ createTextNodeFor: aString
 !TagBrush class methodsFor: 'instance creation'!
 !TagBrush class methodsFor: 'instance creation'!
 
 
 fromJQuery: aJQuery canvas: aCanvas
 fromJQuery: aJQuery canvas: aCanvas
-    ^self new
+	^self new
 	initializeFromJQuery: aJQuery canvas: aCanvas;
 	initializeFromJQuery: aJQuery canvas: aCanvas;
 	yourself
 	yourself
 !
 !
 
 
 fromString: aString canvas: aCanvas
 fromString: aString canvas: aCanvas
-    ^self new
+	^self new
 	initializeFromString: aString canvas: aCanvas;
 	initializeFromString: aString canvas: aCanvas;
 	yourself
 	yourself
 ! !
 ! !
@@ -981,7 +981,7 @@ with: aString
 !StyleTag class methodsFor: 'instance creation'!
 !StyleTag class methodsFor: 'instance creation'!
 
 
 canvas: aCanvas
 canvas: aCanvas
-    ^self new
+	^self new
 	initializeFromString: 'style' canvas: aCanvas;
 	initializeFromString: 'style' canvas: aCanvas;
 	yourself
 	yourself
 ! !
 ! !
@@ -993,37 +993,37 @@ Object subclass: #Widget
 !Widget methodsFor: 'adding'!
 !Widget methodsFor: 'adding'!
 
 
 appendToBrush: aTagBrush
 appendToBrush: aTagBrush
-    self appendToJQuery: aTagBrush asJQuery
+	self appendToJQuery: aTagBrush asJQuery
 !
 !
 
 
 appendToJQuery: aJQuery
 appendToJQuery: aJQuery
-   self renderOn: (HTMLCanvas onJQuery: aJQuery)
+	self renderOn: (HTMLCanvas onJQuery: aJQuery)
 ! !
 ! !
 
 
 !Widget methodsFor: 'rendering'!
 !Widget methodsFor: 'rendering'!
 
 
 renderOn: html
 renderOn: html
-    self
+	self
 ! !
 ! !
 
 
 !Object methodsFor: '*Canvas'!
 !Object methodsFor: '*Canvas'!
 
 
 appendToBrush: aTagBrush
 appendToBrush: aTagBrush
-    aTagBrush append: self asString
+	aTagBrush append: self asString
 !
 !
 
 
 appendToJQuery: aJQuery
 appendToJQuery: aJQuery
-    aJQuery append: self asString
+	aJQuery append: self asString
 ! !
 ! !
 
 
 !BlockClosure methodsFor: '*Canvas'!
 !BlockClosure methodsFor: '*Canvas'!
 
 
 appendToBrush: aTagBrush
 appendToBrush: aTagBrush
-    aTagBrush appendBlock: self
+	aTagBrush appendBlock: self
 !
 !
 
 
 appendToJQuery: aJQuery
 appendToJQuery: aJQuery
-    self value: (HTMLCanvas onJQuery: aJQuery)
+	self value: (HTMLCanvas onJQuery: aJQuery)
 ! !
 ! !
 
 
 !CharacterArray methodsFor: '*Canvas'!
 !CharacterArray methodsFor: '*Canvas'!
@@ -1035,20 +1035,20 @@ asSnippet
 !String methodsFor: '*Canvas'!
 !String methodsFor: '*Canvas'!
 
 
 appendToBrush: aTagBrush
 appendToBrush: aTagBrush
-    aTagBrush appendString: self
+	aTagBrush appendString: self
 !
 !
 
 
 appendToJQuery: aJQuery
 appendToJQuery: aJQuery
-    aJQuery append: self
+	aJQuery append: self
 !
 !
 
 
 asJQuery
 asJQuery
-    <return jQuery(String(self))>
+	<return jQuery(String(self))>
 ! !
 ! !
 
 
 !JSObjectProxy methodsFor: '*Canvas'!
 !JSObjectProxy methodsFor: '*Canvas'!
 
 
 asJQuery
 asJQuery
-    <return jQuery(self['@jsObject'])>
+	<return jQuery(self['@jsObject'])>
 ! !
 ! !
 
 

+ 16 - 16
st/Compiler-AST.st

@@ -82,8 +82,8 @@ isValueNode
 !
 !
 
 
 subtreeNeedsAliasing
 subtreeNeedsAliasing
-    ^(self shouldBeAliased or: [ self shouldBeInlined ]) or: [
-        (self nodes detect: [ :each | each subtreeNeedsAliasing ] ifNone: [ false ]) ~= false ]
+	^(self shouldBeAliased or: [ self shouldBeInlined ]) or: [
+		(self nodes detect: [ :each | each subtreeNeedsAliasing ] ifNone: [ false ]) ~= false ]
 ! !
 ! !
 
 
 !Node methodsFor: 'visiting'!
 !Node methodsFor: 'visiting'!
@@ -159,7 +159,7 @@ isBlockNode
 !
 !
 
 
 subtreeNeedsAliasing
 subtreeNeedsAliasing
-    ^ self shouldBeAliased or: [ self shouldBeInlined ]
+	^ self shouldBeAliased or: [ self shouldBeInlined ]
 ! !
 ! !
 
 
 !BlockNode methodsFor: 'visiting'!
 !BlockNode methodsFor: 'visiting'!
@@ -343,13 +343,13 @@ arguments: aCollection
 cascadeNodeWithMessages: aCollection
 cascadeNodeWithMessages: aCollection
 	| first |
 	| first |
 	first := SendNode new
 	first := SendNode new
-	    selector: self selector;
-	    arguments: self arguments;
-	    yourself.
+		selector: self selector;
+		arguments: self arguments;
+		yourself.
 	^CascadeNode new
 	^CascadeNode new
-	    receiver: self receiver;
-	    nodes: (Array with: first), aCollection;
-	    yourself
+		receiver: self receiver;
+		nodes: (Array with: first), aCollection;
+		yourself
 !
 !
 
 
 index
 index
@@ -392,12 +392,12 @@ superSend: aBoolean
 
 
 valueForReceiver: anObject
 valueForReceiver: anObject
 	^SendNode new
 	^SendNode new
-	    receiver: (self receiver 
+		receiver: (self receiver
 		ifNil: [anObject]
 		ifNil: [anObject]
 		ifNotNil: [self receiver valueForReceiver: anObject]);
 		ifNotNil: [self receiver valueForReceiver: anObject]);
-	    selector: self selector;
-	    arguments: self arguments;
-	    yourself
+		selector: self selector;
+		arguments: self arguments;
+		yourself
 ! !
 ! !
 
 
 !SendNode methodsFor: 'testing'!
 !SendNode methodsFor: 'testing'!
@@ -438,9 +438,9 @@ temps: aCollection
 
 
 asBlockSequenceNode
 asBlockSequenceNode
 	^BlockSequenceNode new
 	^BlockSequenceNode new
-	    nodes: self nodes;
-	    temps: self temps;
-	    yourself
+		nodes: self nodes;
+		temps: self temps;
+		yourself
 ! !
 ! !
 
 
 !SequenceNode methodsFor: 'visiting'!
 !SequenceNode methodsFor: 'visiting'!

+ 13 - 13
st/Compiler-Core.st

@@ -5,7 +5,7 @@ Object subclass: #Compiler
 !Compiler commentStamp!
 !Compiler commentStamp!
 I provide the public interface for compiling Amber source code into JavaScript.
 I provide the public interface for compiling Amber source code into JavaScript.
 
 
-The code generator used to produce JavaScript can be plugged with `#codeGeneratorClass`. 
+The code generator used to produce JavaScript can be plugged with `#codeGeneratorClass`.
 The default code generator is an instance of `InlinedCodeGenerator`!
 The default code generator is an instance of `InlinedCodeGenerator`!
 
 
 !Compiler methodsFor: 'accessing'!
 !Compiler methodsFor: 'accessing'!
@@ -89,8 +89,8 @@ evaluateExpression: aString
 evaluateExpression: aString on: anObject
 evaluateExpression: aString on: anObject
 	"Unlike #eval: evaluate a Smalltalk expression with anObject as the receiver and answer the returned object"
 	"Unlike #eval: evaluate a Smalltalk expression with anObject as the receiver and answer the returned object"
 	| result method |
 	| result method |
-    method := self eval: (self compileExpression: aString on: anObject).
-    method category: 'xxxDoIt'.
+	method := self eval: (self compileExpression: aString on: anObject).
+	method category: 'xxxDoIt'.
 	anObject class addCompiledMethod: method.
 	anObject class addCompiledMethod: method.
 	result := anObject xxxDoIt.
 	result := anObject xxxDoIt.
 	anObject class removeCompiledMethod: method.
 	anObject class removeCompiledMethod: method.
@@ -98,18 +98,18 @@ evaluateExpression: aString on: anObject
 !
 !
 
 
 install: aString forClass: aBehavior category: anotherString
 install: aString forClass: aBehavior category: anotherString
-   	^ ClassBuilder new
-    	installMethod: (self eval: (self compile: aString forClass: aBehavior))
-        forClass: aBehavior
-        category: anotherString
+	^ ClassBuilder new
+		installMethod: (self eval: (self compile: aString forClass: aBehavior))
+		forClass: aBehavior
+		category: anotherString
 !
 !
 
 
 parse: aString
 parse: aString
-    ^Smalltalk current parse: aString
+	^Smalltalk current parse: aString
 !
 !
 
 
 parseExpression: aString
 parseExpression: aString
-    ^self parse: 'doIt ^[', aString, '] value'
+	^self parse: 'doIt ^[', aString, '] value'
 !
 !
 
 
 recompile: aClass
 recompile: aClass
@@ -229,11 +229,11 @@ I am the abstract super class of all code generators and provide their common AP
 
 
 classNameFor: aClass
 classNameFor: aClass
 	^aClass isMetaclass
 	^aClass isMetaclass
-	    ifTrue: [aClass instanceClass name, '.klass']
-	    ifFalse: [
+		ifTrue: [aClass instanceClass name, '.klass']
+		ifFalse: [
 		aClass isNil
 		aClass isNil
-		    ifTrue: ['nil']
-		    ifFalse: [aClass name]]
+			ifTrue: ['nil']
+			ifFalse: [aClass name]]
 !
 !
 
 
 currentClass
 currentClass

+ 2 - 2
st/Compiler-Exceptions.st

@@ -9,7 +9,7 @@ CompilerError subclass: #ParseError
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Compiler-Exceptions'!
 	package: 'Compiler-Exceptions'!
 !ParseError commentStamp!
 !ParseError commentStamp!
-Instance of ParseError are signaled on any parsing error. 
+Instance of ParseError are signaled on any parsing error.
 See `Smalltalk >> #parse:`!
 See `Smalltalk >> #parse:`!
 
 
 CompilerError subclass: #SemanticError
 CompilerError subclass: #SemanticError
@@ -105,6 +105,6 @@ basicSignal: anError
 
 
 handleError: anError
 handleError: anError
 	super handleError: anError.
 	super handleError: anError.
-    self basicSignal: anError
+	self basicSignal: anError
 ! !
 ! !
 
 

+ 123 - 123
st/Compiler-IR.st

@@ -62,8 +62,8 @@ alias: aNode
 
 
 	aNode isImmutable ifTrue: [ ^ self visit: aNode ].
 	aNode isImmutable ifTrue: [ ^ self visit: aNode ].
 
 
-	variable := IRVariable new 
-		variable: (AliasVar new name: '$', self nextAlias); 
+	variable := IRVariable new
+		variable: (AliasVar new name: '$', self nextAlias);
 		yourself.
 		yourself.
 
 
 	self sequence add: (IRAssignment new
 	self sequence add: (IRAssignment new
@@ -78,32 +78,32 @@ alias: aNode
 
 
 aliasTemporally: aCollection
 aliasTemporally: aCollection
 	"https://github.com/NicolasPetton/amber/issues/296
 	"https://github.com/NicolasPetton/amber/issues/296
-    
-    If a node is aliased, all preceding ones are aliased as well.
-    The tree is iterated twice. First we get the aliasing dependency, 
-    then the aliasing itself is done"
+	
+	If a node is aliased, all preceding ones are aliased as well.
+	The tree is iterated twice. First we get the aliasing dependency,
+	then the aliasing itself is done"
 
 
 	| threshold result |
 	| threshold result |
-    threshold := 0.
-    
-    aCollection withIndexDo: [ :each :i |
-        each subtreeNeedsAliasing
-		    ifTrue: [ threshold := i ]].
+	threshold := 0.
+	
+	aCollection withIndexDo: [ :each :i |
+		each subtreeNeedsAliasing
+			ifTrue: [ threshold := i ]].
 
 
 	result := OrderedCollection new.
 	result := OrderedCollection new.
-	aCollection withIndexDo: [ :each :i | 
+	aCollection withIndexDo: [ :each :i |
 		result add: (i <= threshold
 		result add: (i <= threshold
 			ifTrue: [ self alias: each ]
 			ifTrue: [ self alias: each ]
 			ifFalse: [ self visit: each ])].
 			ifFalse: [ self visit: each ])].
 
 
-    ^result
+	^result
 !
 !
 
 
 visitAssignmentNode: aNode
 visitAssignmentNode: aNode
 	| left right assignment |
 	| left right assignment |
 	right := self visit: aNode right.
 	right := self visit: aNode right.
 	left := self visit: aNode left.
 	left := self visit: aNode left.
-	self sequence add: (IRAssignment new 
+	self sequence add: (IRAssignment new
 		add: left;
 		add: left;
 		add: right;
 		add: right;
 		yourself).
 		yourself).
@@ -117,9 +117,9 @@ visitBlockNode: aNode
 		scope: aNode scope;
 		scope: aNode scope;
 		yourself.
 		yourself.
 	aNode scope temps do: [ :each |
 	aNode scope temps do: [ :each |
-		closure add: (IRTempDeclaration new 
+		closure add: (IRTempDeclaration new
 			name: each name;
 			name: each name;
-            scope: aNode scope;
+			scope: aNode scope;
 			yourself) ].
 			yourself) ].
 	aNode nodes do: [ :each | closure add: (self visit: each) ].
 	aNode nodes do: [ :each | closure add: (self visit: each) ].
 	^ closure
 	^ closure
@@ -128,11 +128,11 @@ visitBlockNode: aNode
 visitBlockSequenceNode: aNode
 visitBlockSequenceNode: aNode
 	^ self
 	^ self
 		withSequence: IRBlockSequence new
 		withSequence: IRBlockSequence new
-		do: [ 
+		do: [
 			aNode nodes ifNotEmpty: [
 			aNode nodes ifNotEmpty: [
-				aNode nodes allButLast do: [ :each | 
+				aNode nodes allButLast do: [ :each |
 					self sequence add: (self visit: each) ].
 					self sequence add: (self visit: each) ].
-				aNode nodes last isReturnNode 
+				aNode nodes last isReturnNode
 					ifFalse: [ self sequence add: (IRBlockReturn new add: (self visit: aNode nodes last); yourself) ]
 					ifFalse: [ self sequence add: (IRBlockReturn new add: (self visit: aNode nodes last); yourself) ]
 					ifTrue: [ self sequence add: (self visit: aNode nodes last) ]]]
 					ifTrue: [ self sequence add: (self visit: aNode nodes last) ]]]
 !
 !
@@ -140,7 +140,7 @@ visitBlockSequenceNode: aNode
 visitCascadeNode: aNode
 visitCascadeNode: aNode
 	| alias |
 	| alias |
 
 
-	aNode receiver isImmutable ifFalse: [ 
+	aNode receiver isImmutable ifFalse: [
 		alias := self alias: aNode receiver.
 		alias := self alias: aNode receiver.
 		aNode nodes do: [ :each |
 		aNode nodes do: [ :each |
 			each receiver: (VariableNode new binding: alias variable) ]].
 			each receiver: (VariableNode new binding: alias variable) ]].
@@ -161,7 +161,7 @@ visitDynamicArrayNode: aNode
 visitDynamicDictionaryNode: aNode
 visitDynamicDictionaryNode: aNode
 	| dictionary |
 	| dictionary |
 	dictionary := IRDynamicDictionary new.
 	dictionary := IRDynamicDictionary new.
-    (self aliasTemporally: aNode nodes) do: [:each | dictionary add: each].
+	(self aliasTemporally: aNode nodes) do: [:each | dictionary add: each].
 	^ dictionary
 	^ dictionary
 !
 !
 
 
@@ -175,11 +175,11 @@ visitMethodNode: aNode
 
 
 	self method: (IRMethod new
 	self method: (IRMethod new
 		source: self source;
 		source: self source;
-        theClass: self theClass;
+		theClass: self theClass;
 		arguments: aNode arguments;
 		arguments: aNode arguments;
 		selector: aNode selector;
 		selector: aNode selector;
 		messageSends: aNode messageSends;
 		messageSends: aNode messageSends;
-        superSends: aNode superSends;
+		superSends: aNode superSends;
 		classReferences: aNode classReferences;
 		classReferences: aNode classReferences;
 		scope: aNode scope;
 		scope: aNode scope;
 		yourself).
 		yourself).
@@ -187,7 +187,7 @@ visitMethodNode: aNode
 	aNode scope temps do: [ :each |
 	aNode scope temps do: [ :each |
 		self method add: (IRTempDeclaration new
 		self method add: (IRTempDeclaration new
 			name: each name;
 			name: each name;
-            scope: aNode scope;
+			scope: aNode scope;
 			yourself) ].
 			yourself) ].
 
 
 	aNode nodes do: [ :each | self method add: (self visit: each) ].
 	aNode nodes do: [ :each | self method add: (self visit: each) ].
@@ -202,7 +202,7 @@ visitMethodNode: aNode
 
 
 visitReturnNode: aNode
 visitReturnNode: aNode
 	| return |
 	| return |
-	return := aNode nonLocalReturn 
+	return := aNode nonLocalReturn
 		ifTrue: [ IRNonLocalReturn new ]
 		ifTrue: [ IRNonLocalReturn new ]
 		ifFalse: [ IRReturn new ].
 		ifFalse: [ IRReturn new ].
 	return scope: aNode scope.
 	return scope: aNode scope.
@@ -214,12 +214,12 @@ visitReturnNode: aNode
 visitSendNode: aNode
 visitSendNode: aNode
 	| send all receiver arguments |
 	| send all receiver arguments |
 	send := IRSend new.
 	send := IRSend new.
-	send 
+	send
 		selector: aNode selector;
 		selector: aNode selector;
 		index: aNode index.
 		index: aNode index.
 	aNode superSend ifTrue: [ send classSend: self theClass superclass ].
 	aNode superSend ifTrue: [ send classSend: self theClass superclass ].
-    
-    all := self aliasTemporally: { aNode receiver }, aNode arguments.
+	
+	all := self aliasTemporally: { aNode receiver }, aNode arguments.
 	receiver := all first.
 	receiver := all first.
 	arguments := all allButFirst.
 	arguments := all allButFirst.
 
 
@@ -230,8 +230,8 @@ visitSendNode: aNode
 !
 !
 
 
 visitSequenceNode: aNode
 visitSequenceNode: aNode
-	^ self 
-		withSequence: IRSequence new 	
+	^ self
+		withSequence: IRSequence new	
 		do: [
 		do: [
 			aNode nodes do: [ :each | | instruction |
 			aNode nodes do: [ :each | | instruction |
 				instruction := self visit: each.
 				instruction := self visit: each.
@@ -240,14 +240,14 @@ visitSequenceNode: aNode
 !
 !
 
 
 visitValueNode: aNode
 visitValueNode: aNode
-	^ IRValue new 
-		value: aNode value; 
+	^ IRValue new
+		value: aNode value;
 		yourself
 		yourself
 !
 !
 
 
 visitVariableNode: aNode
 visitVariableNode: aNode
-	^ IRVariable new 
-		variable: aNode binding; 
+	^ IRVariable new
+		variable: aNode binding;
 		yourself
 		yourself
 ! !
 ! !
 
 
@@ -293,7 +293,7 @@ remove: anIRInstruction
 
 
 replace: anIRInstruction with: anotherIRInstruction
 replace: anIRInstruction with: anotherIRInstruction
 	anotherIRInstruction parent: self.
 	anotherIRInstruction parent: self.
-	self instructions 
+	self instructions
 		at: (self instructions indexOf: anIRInstruction)
 		at: (self instructions indexOf: anIRInstruction)
 		put: anotherIRInstruction
 		put: anotherIRInstruction
 !
 !
@@ -418,8 +418,8 @@ arguments: aCollection
 
 
 locals
 locals
 	^ self arguments copy
 	^ self arguments copy
-    	addAll: (self tempDeclarations collect: [ :each | each name ]); 
-        yourself
+		addAll: (self tempDeclarations collect: [ :each | each name ]);
+		yourself
 !
 !
 
 
 scope: aScope
 scope: aScope
@@ -428,8 +428,8 @@ scope: aScope
 !
 !
 
 
 tempDeclarations
 tempDeclarations
-	^ self instructions select: [ :each | 
-    	each isTempDeclaration ]
+	^ self instructions select: [ :each |
+		each isTempDeclaration ]
 ! !
 ! !
 
 
 IRClosureInstruction subclass: #IRClosure
 IRClosureInstruction subclass: #IRClosure
@@ -652,9 +652,9 @@ index: anInteger
 !
 !
 
 
 javascriptSelector
 javascriptSelector
-	^ self classSend 
-    	ifNil: [ self selector asSelector ]
-      	ifNotNil: [ self selector asSuperSelector ]
+	^ self classSend
+		ifNil: [ self selector asSelector ]
+		ifNotNil: [ self selector asSuperSelector ]
 !
 !
 
 
 selector
 selector
@@ -894,13 +894,13 @@ visitIRAssignment: anIRAssignment
 !
 !
 
 
 visitIRClosure: anIRClosure
 visitIRClosure: anIRClosure
-	self stream 
-		nextPutClosureWith: [ 
-        	self stream nextPutVars: (anIRClosure tempDeclarations collect: [ :each |
-    				each name asVariableName ]).
-        	self stream 
-            	nextPutBlockContextFor: anIRClosure
-                during: [ super visitIRClosure: anIRClosure ] ]
+	self stream
+		nextPutClosureWith: [
+			self stream nextPutVars: (anIRClosure tempDeclarations collect: [ :each |
+					each name asVariableName ]).
+			self stream
+				nextPutBlockContextFor: anIRClosure
+				during: [ super visitIRClosure: anIRClosure ] ]
 		arguments: anIRClosure arguments
 		arguments: anIRClosure arguments
 !
 !
 
 
@@ -914,7 +914,7 @@ visitIRDynamicArray: anIRDynamicArray
 
 
 visitIRDynamicDictionary: anIRDynamicDictionary
 visitIRDynamicDictionary: anIRDynamicDictionary
 	self stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.
 	self stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.
-		anIRDynamicDictionary instructions 
+		anIRDynamicDictionary instructions
 			do: [ :each | self visit: each ]
 			do: [ :each | self visit: each ]
 			separatedBy: [self stream nextPutAll: ',' ].
 			separatedBy: [self stream nextPutAll: ',' ].
 	self stream nextPutAll: '])'
 	self stream nextPutAll: '])'
@@ -923,16 +923,16 @@ visitIRDynamicDictionary: anIRDynamicDictionary
 visitIRMethod: anIRMethod
 visitIRMethod: anIRMethod
 
 
 	self stream
 	self stream
-		nextPutMethodDeclaration: anIRMethod 
-		with: [ self stream 
-			nextPutFunctionWith: [ 
-            	self stream nextPutVars: (anIRMethod tempDeclarations collect: [ :each |
-    				each name asVariableName ]).
-            	self stream nextPutContextFor: anIRMethod during: [
+		nextPutMethodDeclaration: anIRMethod
+		with: [ self stream
+			nextPutFunctionWith: [
+				self stream nextPutVars: (anIRMethod tempDeclarations collect: [ :each |
+					each name asVariableName ]).
+				self stream nextPutContextFor: anIRMethod during: [
 				anIRMethod internalVariables notEmpty ifTrue: [
 				anIRMethod internalVariables notEmpty ifTrue: [
 					self stream nextPutVars: (anIRMethod internalVariables asArray collect: [ :each |
 					self stream nextPutVars: (anIRMethod internalVariables asArray collect: [ :each |
 						each variable alias ]) ].
 						each variable alias ]) ].
-				anIRMethod scope hasNonLocalReturn 
+				anIRMethod scope hasNonLocalReturn
 					ifTrue: [
 					ifTrue: [
 						self stream nextPutNonLocalReturnHandlingWith: [
 						self stream nextPutNonLocalReturnHandlingWith: [
 							super visitIRMethod: anIRMethod ]]
 							super visitIRMethod: anIRMethod ]]
@@ -951,18 +951,18 @@ visitIRReturn: anIRReturn
 !
 !
 
 
 visitIRSend: anIRSend
 visitIRSend: anIRSend
-	anIRSend classSend 
-    	ifNil: [
+	anIRSend classSend
+		ifNil: [
 			self stream nextPutAll: '_st('.
 			self stream nextPutAll: '_st('.
 			self visit: anIRSend instructions first.
 			self visit: anIRSend instructions first.
-   		 	self stream nextPutAll: ').', anIRSend selector asSelector, '('.
+			self stream nextPutAll: ').', anIRSend selector asSelector, '('.
 			anIRSend instructions allButFirst
 			anIRSend instructions allButFirst
 				do: [ :each | self visit: each ]
 				do: [ :each | self visit: each ]
 				separatedBy: [ self stream nextPutAll: ',' ].
 				separatedBy: [ self stream nextPutAll: ',' ].
 			self stream nextPutAll: ')' ]
 			self stream nextPutAll: ')' ]
-		ifNotNil: [ 
-			self stream 
-            	nextPutAll: anIRSend classSend asJavascript, '.fn.prototype.';
+		ifNotNil: [
+			self stream
+				nextPutAll: anIRSend classSend asJavascript, '.fn.prototype.';
 				nextPutAll: anIRSend selector asSelector, '.apply(';
 				nextPutAll: anIRSend selector asSelector, '.apply(';
 				nextPutAll: '_st('.
 				nextPutAll: '_st('.
 			self visit: anIRSend instructions first.
 			self visit: anIRSend instructions first.
@@ -980,9 +980,9 @@ visitIRSequence: anIRSequence
 !
 !
 
 
 visitIRTempDeclaration: anIRTempDeclaration
 visitIRTempDeclaration: anIRTempDeclaration
-	"self stream 
-    	nextPutAll: 'var ', anIRTempDeclaration name asVariableName, ';'; 
-        lf"
+	"self stream
+		nextPutAll: 'var ', anIRTempDeclaration name asVariableName, ';';
+		lf"
 !
 !
 
 
 visitIRValue: anIRValue
 visitIRValue: anIRValue
@@ -991,8 +991,8 @@ visitIRValue: anIRValue
 
 
 visitIRVariable: anIRVariable
 visitIRVariable: anIRVariable
 	anIRVariable variable name = 'thisContext'
 	anIRVariable variable name = 'thisContext'
-    	ifTrue: [ self stream nextPutAll: 'smalltalk.getThisContext()' ]
-      	ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]
+		ifTrue: [ self stream nextPutAll: 'smalltalk.getThisContext()' ]
+		ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]
 !
 !
 
 
 visitIRVerbatim: anIRVerbatim
 visitIRVerbatim: anIRVerbatim
@@ -1036,32 +1036,32 @@ nextPutAssignment
 !
 !
 
 
 nextPutBlockContextFor: anIRClosure during: aBlock
 nextPutBlockContextFor: anIRClosure during: aBlock
-	self 
-    	nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') {'; 
-        nextPutAll: String cr.
-    
-    aBlock value.
-    
-    self 
-    	nextPutAll: '}, function(', anIRClosure scope alias, ') {';
-        nextPutAll: anIRClosure scope alias, '.fillBlock({'.
-    
-    anIRClosure locals 
-    	do: [ :each |
-    		self 
-        		nextPutAll: each asVariableName;
-           	 	nextPutAll: ':';
-        		nextPutAll: each asVariableName]
+	self
+		nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') {';
+		nextPutAll: String cr.
+	
+	aBlock value.
+	
+	self
+		nextPutAll: '}, function(', anIRClosure scope alias, ') {';
+		nextPutAll: anIRClosure scope alias, '.fillBlock({'.
+	
+	anIRClosure locals
+		do: [ :each |
+			self
+				nextPutAll: each asVariableName;
+				nextPutAll: ':';
+				nextPutAll: each asVariableName]
 		separatedBy: [ self nextPutAll: ',' ].
 		separatedBy: [ self nextPutAll: ',' ].
-    
-    self
-    	nextPutAll: '},';
-        nextPutAll:  anIRClosure method scope alias, ')})'
+	
+	self
+		nextPutAll: '},';
+		nextPutAll:	 anIRClosure method scope alias, ')})'
 !
 !
 
 
 nextPutClosureWith: aBlock arguments: anArray
 nextPutClosureWith: aBlock arguments: anArray
 	stream nextPutAll: '(function('.
 	stream nextPutAll: '(function('.
-	anArray 
+	anArray
 		do: [ :each | stream nextPutAll: each asVariableName ]
 		do: [ :each | stream nextPutAll: each asVariableName ]
 		separatedBy: [ stream nextPut: ',' ].
 		separatedBy: [ stream nextPut: ',' ].
 	stream nextPutAll: '){'; lf.
 	stream nextPutAll: '){'; lf.
@@ -1070,32 +1070,32 @@ nextPutClosureWith: aBlock arguments: anArray
 !
 !
 
 
 nextPutContextFor: aMethod during: aBlock
 nextPutContextFor: aMethod during: aBlock
-	self 
-    	nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { '; 
-        nextPutAll: String cr.
-    aBlock value.
-    
-    self 
-    	nextPutAll: '}, function(', aMethod scope alias, ') {', aMethod scope alias; 
-        nextPutAll: '.fill(self,', aMethod selector asJavascript, ',{'.
-
-    aMethod locals 
-    	do: [ :each |
-    		self 
-        		nextPutAll: each asVariableName;
-           	 	nextPutAll: ':';
-        		nextPutAll: each asVariableName]
+	self
+		nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { ';
+		nextPutAll: String cr.
+	aBlock value.
+	
+	self
+		nextPutAll: '}, function(', aMethod scope alias, ') {', aMethod scope alias;
+		nextPutAll: '.fill(self,', aMethod selector asJavascript, ',{'.
+
+	aMethod locals
+		do: [ :each |
+			self
+				nextPutAll: each asVariableName;
+				nextPutAll: ':';
+				nextPutAll: each asVariableName]
 		separatedBy: [ self nextPutAll: ',' ].
 		separatedBy: [ self nextPutAll: ',' ].
-    
-    self
-    	nextPutAll: '},';
-        nextPutAll: aMethod theClass asJavascript;
-        nextPutAll: ')})'
+	
+	self
+		nextPutAll: '},';
+		nextPutAll: aMethod theClass asJavascript;
+		nextPutAll: ')})'
 !
 !
 
 
 nextPutFunctionWith: aBlock arguments: anArray
 nextPutFunctionWith: aBlock arguments: anArray
 	stream nextPutAll: 'fn: function('.
 	stream nextPutAll: 'fn: function('.
-	anArray 
+	anArray
 		do: [ :each | stream nextPutAll: each asVariableName ]
 		do: [ :each | stream nextPutAll: each asVariableName ]
 		separatedBy: [ stream nextPut: ',' ].
 		separatedBy: [ stream nextPut: ',' ].
 	stream nextPutAll: '){'; lf.
 	stream nextPutAll: '){'; lf.
@@ -1123,30 +1123,30 @@ nextPutIfElse: aBlock with: ifBlock with: elseBlock
 !
 !
 
 
 nextPutMethodDeclaration: aMethod with: aBlock
 nextPutMethodDeclaration: aMethod with: aBlock
-	stream 
+	stream
 		nextPutAll: 'smalltalk.method({'; lf;
 		nextPutAll: 'smalltalk.method({'; lf;
 		nextPutAll: 'selector: "', aMethod selector, '",'; lf;
 		nextPutAll: 'selector: "', aMethod selector, '",'; lf;
-		nextPutAll: 'source: ', aMethod source asJavascript, ',';lf. 
+		nextPutAll: 'source: ', aMethod source asJavascript, ',';lf.
 	aBlock value.
 	aBlock value.
-	stream 
+	stream
 		nextPutAll: ',', String lf, 'messageSends: ';
 		nextPutAll: ',', String lf, 'messageSends: ';
 		nextPutAll: aMethod messageSends asArray asJavascript, ','; lf;
 		nextPutAll: aMethod messageSends asArray asJavascript, ','; lf;
-        nextPutAll: 'args: ', (aMethod arguments collect: [ :each | each value ]) asArray asJavascript, ','; lf;
+		nextPutAll: 'args: ', (aMethod arguments collect: [ :each | each value ]) asArray asJavascript, ','; lf;
 		nextPutAll: 'referencedClasses: ['.
 		nextPutAll: 'referencedClasses: ['.
-	aMethod classReferences 
+	aMethod classReferences
 		do: [:each | stream nextPutAll: each asJavascript]
 		do: [:each | stream nextPutAll: each asJavascript]
 		separatedBy: [stream nextPutAll: ','].
 		separatedBy: [stream nextPutAll: ','].
-	stream 
+	stream
 		nextPutAll: ']';
 		nextPutAll: ']';
 		nextPutAll: '})'
 		nextPutAll: '})'
 !
 !
 
 
 nextPutNonLocalReturnHandlingWith: aBlock
 nextPutNonLocalReturnHandlingWith: aBlock
-	stream 
+	stream
 		nextPutAll: 'var $early={};'; lf;
 		nextPutAll: 'var $early={};'; lf;
 		nextPutAll: 'try {'; lf.
 		nextPutAll: 'try {'; lf.
 	aBlock value.
 	aBlock value.
-	stream 
+	stream
 		nextPutAll: '}'; lf;
 		nextPutAll: '}'; lf;
 		nextPutAll: 'catch(e) {if(e===$early)return e[0]; throw e}'; lf
 		nextPutAll: 'catch(e) {if(e===$early)return e[0]; throw e}'; lf
 !
 !
@@ -1167,10 +1167,10 @@ nextPutReturnWith: aBlock
 !
 !
 
 
 nextPutSequenceWith: aBlock
 nextPutSequenceWith: aBlock
-	"stream 
+	"stream
 		nextPutAll: 'switch(smalltalk.thisContext.pc){'; lf."
 		nextPutAll: 'switch(smalltalk.thisContext.pc){'; lf."
 	aBlock value.
 	aBlock value.
-	"stream 
+	"stream
 		nextPutAll: '};'; lf"
 		nextPutAll: '};'; lf"
 !
 !
 
 
@@ -1191,9 +1191,9 @@ nextPutVar: aString
 
 
 nextPutVars: aCollection
 nextPutVars: aCollection
 	aCollection ifEmpty: [ ^self ].
 	aCollection ifEmpty: [ ^self ].
-    
+	
 	stream nextPutAll: 'var '.
 	stream nextPutAll: 'var '.
-	aCollection 
+	aCollection
 		do: [ :each | stream nextPutAll: each ]
 		do: [ :each | stream nextPutAll: each ]
 		separatedBy: [ stream nextPutAll: ',' ].
 		separatedBy: [ stream nextPutAll: ',' ].
 	stream nextPutAll: ';'; lf
 	stream nextPutAll: ';'; lf
@@ -1202,7 +1202,7 @@ nextPutVars: aCollection
 !BlockClosure methodsFor: '*Compiler-IR'!
 !BlockClosure methodsFor: '*Compiler-IR'!
 
 
 appendToInstruction: anIRInstruction
 appendToInstruction: anIRInstruction
-    anIRInstruction appendBlock: self
+	anIRInstruction appendBlock: self
 ! !
 ! !
 
 
 !String methodsFor: '*Compiler-IR'!
 !String methodsFor: '*Compiler-IR'!

+ 29 - 29
st/Compiler-Inlining.st

@@ -158,25 +158,25 @@ Message selectors that can be inlined are answered by `IRSendInliner >> #inlined
 !IRInliner methodsFor: 'factory'!
 !IRInliner methodsFor: 'factory'!
 
 
 assignmentInliner
 assignmentInliner
-	^ IRAssignmentInliner new 
+	^ IRAssignmentInliner new
 		translator: self;
 		translator: self;
 		yourself
 		yourself
 !
 !
 
 
 nonLocalReturnInliner
 nonLocalReturnInliner
-	^ IRNonLocalReturnInliner new 
+	^ IRNonLocalReturnInliner new
 		translator: self;
 		translator: self;
 		yourself
 		yourself
 !
 !
 
 
 returnInliner
 returnInliner
-	^ IRReturnInliner new 
+	^ IRReturnInliner new
 		translator: self;
 		translator: self;
 		yourself
 		yourself
 !
 !
 
 
 sendInliner
 sendInliner
-	^ IRSendInliner new 
+	^ IRSendInliner new
 		translator: self;
 		translator: self;
 		yourself
 		yourself
 ! !
 ! !
@@ -184,14 +184,14 @@ sendInliner
 !IRInliner methodsFor: 'testing'!
 !IRInliner methodsFor: 'testing'!
 
 
 shouldInlineAssignment: anIRAssignment
 shouldInlineAssignment: anIRAssignment
-	^ anIRAssignment isInlined not and: [ 
+	^ anIRAssignment isInlined not and: [
 		anIRAssignment instructions last isSend and: [	
 		anIRAssignment instructions last isSend and: [	
 			self shouldInlineSend: (anIRAssignment instructions last) ]]
 			self shouldInlineSend: (anIRAssignment instructions last) ]]
 !
 !
 
 
 shouldInlineReturn: anIRReturn
 shouldInlineReturn: anIRReturn
-	^ anIRReturn isInlined not and: [ 
-		anIRReturn instructions first isSend and: [	
+	^ anIRReturn isInlined not and: [
+		anIRReturn instructions first isSend and: [
 			self shouldInlineSend: (anIRReturn instructions first) ]]
 			self shouldInlineSend: (anIRReturn instructions first) ]]
 !
 !
 
 
@@ -219,19 +219,19 @@ transformNonLocalReturn: anIRNonLocalReturn
 !
 !
 
 
 visitIRAssignment: anIRAssignment
 visitIRAssignment: anIRAssignment
-	^ (self shouldInlineAssignment: anIRAssignment) 
+	^ (self shouldInlineAssignment: anIRAssignment)
 		ifTrue: [ self assignmentInliner inlineAssignment: anIRAssignment ]
 		ifTrue: [ self assignmentInliner inlineAssignment: anIRAssignment ]
 		ifFalse: [ super visitIRAssignment: anIRAssignment ]
 		ifFalse: [ super visitIRAssignment: anIRAssignment ]
 !
 !
 
 
 visitIRNonLocalReturn: anIRNonLocalReturn
 visitIRNonLocalReturn: anIRNonLocalReturn
-	^ (self shouldInlineReturn: anIRNonLocalReturn) 
+	^ (self shouldInlineReturn: anIRNonLocalReturn)
 		ifTrue: [ self nonLocalReturnInliner inlineReturn: anIRNonLocalReturn ]
 		ifTrue: [ self nonLocalReturnInliner inlineReturn: anIRNonLocalReturn ]
 		ifFalse: [ self transformNonLocalReturn: anIRNonLocalReturn ]
 		ifFalse: [ self transformNonLocalReturn: anIRNonLocalReturn ]
 !
 !
 
 
 visitIRReturn: anIRReturn
 visitIRReturn: anIRReturn
-	^ (self shouldInlineReturn: anIRReturn) 
+	^ (self shouldInlineReturn: anIRReturn)
 		ifTrue: [ self returnInliner inlineReturn: anIRReturn ]
 		ifTrue: [ self returnInliner inlineReturn: anIRReturn ]
 		ifFalse: [ super visitIRReturn: anIRReturn ]
 		ifFalse: [ super visitIRReturn: anIRReturn ]
 !
 !
@@ -260,7 +260,7 @@ visitIRInlinedClosure: anIRInlinedClosure
 !
 !
 
 
 visitIRInlinedIfFalse: anIRInlinedIfFalse
 visitIRInlinedIfFalse: anIRInlinedIfFalse
-	self stream nextPutIf: [ 
+	self stream nextPutIf: [
 		self stream nextPutAll: '!! smalltalk.assert('.
 		self stream nextPutAll: '!! smalltalk.assert('.
 		self visit: anIRInlinedIfFalse instructions first.
 		self visit: anIRInlinedIfFalse instructions first.
 		self stream nextPutAll: ')' ]
 		self stream nextPutAll: ')' ]
@@ -268,17 +268,17 @@ visitIRInlinedIfFalse: anIRInlinedIfFalse
 !
 !
 
 
 visitIRInlinedIfNil: anIRInlinedIfNil
 visitIRInlinedIfNil: anIRInlinedIfNil
-	self stream nextPutIf: [ 
-		self stream nextPutAll: '($receiver = '. 
+	self stream nextPutIf: [
+		self stream nextPutAll: '($receiver = '.
 		self visit: anIRInlinedIfNil instructions first.
 		self visit: anIRInlinedIfNil instructions first.
 		self stream nextPutAll: ') == nil || $receiver == undefined' ]
 		self stream nextPutAll: ') == nil || $receiver == undefined' ]
 		with: [ self visit: anIRInlinedIfNil instructions last ]
 		with: [ self visit: anIRInlinedIfNil instructions last ]
 !
 !
 
 
 visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil
 visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil
-	self stream 
-		nextPutIfElse: [ 
-			self stream nextPutAll: '($receiver = '. 
+	self stream
+		nextPutIfElse: [
+			self stream nextPutAll: '($receiver = '.
 			self visit: anIRInlinedIfNilIfNotNil instructions first.
 			self visit: anIRInlinedIfNilIfNotNil instructions first.
 			self stream nextPutAll: ') == nil || $receiver == undefined' ]
 			self stream nextPutAll: ') == nil || $receiver == undefined' ]
 		with: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]
 		with: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]
@@ -286,17 +286,17 @@ visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil
 !
 !
 
 
 visitIRInlinedIfTrue: anIRInlinedIfTrue
 visitIRInlinedIfTrue: anIRInlinedIfTrue
-	self stream nextPutIf: [ 
-		self stream nextPutAll: 'smalltalk.assert('. 
+	self stream nextPutIf: [
+		self stream nextPutAll: 'smalltalk.assert('.
 		self visit: anIRInlinedIfTrue instructions first.
 		self visit: anIRInlinedIfTrue instructions first.
 		self stream nextPutAll: ')' ]
 		self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfTrue instructions last ]
 		with: [ self visit: anIRInlinedIfTrue instructions last ]
 !
 !
 
 
 visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse
 visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse
-	self stream 
-		nextPutIfElse: [ 
-			self stream nextPutAll: 'smalltalk.assert('. 
+	self stream
+		nextPutIfElse: [
+			self stream nextPutAll: 'smalltalk.assert('.
 			self visit: anIRInlinedIfTrueIfFalse instructions first.
 			self visit: anIRInlinedIfTrueIfFalse instructions first.
 			self stream nextPutAll: ')' ]
 			self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]
 		with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]
@@ -314,7 +314,7 @@ visitIRInlinedReturn: anIRInlinedReturn
 !
 !
 
 
 visitIRInlinedSequence: anIRInlinedSequence
 visitIRInlinedSequence: anIRInlinedSequence
-	anIRInlinedSequence instructions do: [ :each | 
+	anIRInlinedSequence instructions do: [ :each |
 		self stream nextPutStatementWith: [ self visit: each ]]
 		self stream nextPutStatementWith: [ self visit: each ]]
 ! !
 ! !
 
 
@@ -369,8 +369,8 @@ ifFalse: anIRInstruction ifTrue: anotherIRInstruction
 !
 !
 
 
 ifNil: anIRInstruction
 ifNil: anIRInstruction
-	^ self 
-		inlinedSend: IRInlinedIfNilIfNotNil new 
+	^ self
+		inlinedSend: IRInlinedIfNilIfNotNil new
 		with: anIRInstruction
 		with: anIRInstruction
 		with: (IRClosure new
 		with: (IRClosure new
 			scope: anIRInstruction scope copy;
 			scope: anIRInstruction scope copy;
@@ -385,7 +385,7 @@ ifNil: anIRInstruction ifNotNil: anotherIRInstruction
 !
 !
 
 
 ifNotNil: anIRInstruction
 ifNotNil: anIRInstruction
-	^ self 
+	^ self
 		inlinedSend: IRInlinedIfNilIfNotNil new
 		inlinedSend: IRInlinedIfNilIfNotNil new
 		with: (IRClosure new
 		with: (IRClosure new
 			scope: anIRInstruction scope copy;
 			scope: anIRInstruction scope copy;
@@ -415,7 +415,7 @@ inlineClosure: anIRClosure
 	inlinedClosure scope: anIRClosure scope.
 	inlinedClosure scope: anIRClosure scope.
 
 
 	"Add the possible temp declarations"
 	"Add the possible temp declarations"
-	anIRClosure instructions do: [ :each | 
+	anIRClosure instructions do: [ :each |
 		each isSequence ifFalse: [
 		each isSequence ifFalse: [
 			inlinedClosure add: each ]].
 			inlinedClosure add: each ]].
 
 
@@ -439,8 +439,8 @@ inlineClosure: anIRClosure
 
 
 inlineSend: anIRSend
 inlineSend: anIRSend
 	self send: anIRSend.
 	self send: anIRSend.
-	^ self 
-		perform: self send selector 
+	^ self
+		perform: self send selector
 		withArguments: self send instructions allButFirst
 		withArguments: self send instructions allButFirst
 !
 !
 
 
@@ -500,7 +500,7 @@ IRSendInliner subclass: #IRAssignmentInliner
 	instanceVariableNames: 'assignment'
 	instanceVariableNames: 'assignment'
 	package: 'Compiler-Inlining'!
 	package: 'Compiler-Inlining'!
 !IRAssignmentInliner commentStamp!
 !IRAssignmentInliner commentStamp!
-I inline message sends together with assignments by moving them around into the inline closure instructions. 
+I inline message sends together with assignments by moving them around into the inline closure instructions.
 
 
 ##Example
 ##Example
 
 

+ 146 - 146
st/Compiler-Interpreter.st

@@ -56,27 +56,27 @@ receiver: anObject
 
 
 selector
 selector
 	^ self metod
 	^ self metod
-    	ifNotNil: [ self method selector ]
+		ifNotNil: [ self method selector ]
 ! !
 ! !
 
 
 !AIContext methodsFor: 'initialization'!
 !AIContext methodsFor: 'initialization'!
 
 
 initializeFromMethodContext: aMethodContext
 initializeFromMethodContext: aMethodContext
 	self pc: aMethodContext pc.
 	self pc: aMethodContext pc.
-    self receiver: aMethodContext receiver.
-    self method: aMethodContext method.
-    aMethodContext outerContext ifNotNil: [
+	self receiver: aMethodContext receiver.
+	self method: aMethodContext method.
+	aMethodContext outerContext ifNotNil: [
 		self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].
 		self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].
-    aMethodContext locals keysAndValuesDo: [ :key :value |
-    	self locals at: key put: value ]
+	aMethodContext locals keysAndValuesDo: [ :key :value |
+		self locals at: key put: value ]
 ! !
 ! !
 
 
 !AIContext class methodsFor: 'instance creation'!
 !AIContext class methodsFor: 'instance creation'!
 
 
 fromMethodContext: aMethodContext
 fromMethodContext: aMethodContext
 	^ self new
 	^ self new
-    	initializeFromMethodContext: aMethodContext;
-        yourself
+		initializeFromMethodContext: aMethodContext;
+		yourself
 ! !
 ! !
 
 
 Object subclass: #ASTDebugger
 Object subclass: #ASTDebugger
@@ -123,16 +123,16 @@ defaultInterpreterClass
 
 
 buildAST
 buildAST
 	"Build the AST tree from the method source code.
 	"Build the AST tree from the method source code.
-    The AST is annotated with a SemanticAnalyzer, 
-    to know the semantics and bindings of each node needed for later debugging"
-    
-    | ast |
-    
-    ast := Smalltalk current parse: self method source.
-    (SemanticAnalyzer on: self context receiver class)
-    	visit: ast.    
-    
-    ^ ast
+	The AST is annotated with a SemanticAnalyzer,
+	to know the semantics and bindings of each node needed for later debugging"
+	
+	| ast |
+	
+	ast := Smalltalk current parse: self method source.
+	(SemanticAnalyzer on: self context receiver class)
+		visit: ast.
+	
+	^ ast
 !
 !
 
 
 initializeInterpreter
 initializeInterpreter
@@ -141,9 +141,9 @@ initializeInterpreter
 
 
 initializeWithContext: aMethodContext
 initializeWithContext: aMethodContext
 	"TODO: do we need to handle block contexts?"
 	"TODO: do we need to handle block contexts?"
-    
-    self context: (AIContext fromMethodContext: aMethodContext).
-    self initializeInterpreter
+	
+	self context: (AIContext fromMethodContext: aMethodContext).
+	self initializeInterpreter
 ! !
 ! !
 
 
 !ASTDebugger methodsFor: 'stepping'!
 !ASTDebugger methodsFor: 'stepping'!
@@ -157,16 +157,16 @@ resume
 !
 !
 
 
 step
 step
-	"The ASTSteppingInterpreter stops at each node interpretation. 
-    One step will interpret nodes until:
-    - we get at the end
-    - the next node is a stepping node (send, assignment, etc.)"
-    
+	"The ASTSteppingInterpreter stops at each node interpretation.
+	One step will interpret nodes until:
+	- we get at the end
+	- the next node is a stepping node (send, assignment, etc.)"
+	
 	[ (self interpreter nextNode notNil and: [ self interpreter nextNode stopOnStepping ])
 	[ (self interpreter nextNode notNil and: [ self interpreter nextNode stopOnStepping ])
-		or: [ self interpreter atEnd not ] ] 
- 			whileFalse: [
-				self interpreter step. 
-                self step ]
+		or: [ self interpreter atEnd not ] ]
+			whileFalse: [
+				self interpreter step.
+				self step ]
 !
 !
 
 
 stepInto
 stepInto
@@ -181,8 +181,8 @@ stepOver
 
 
 context: aMethodContext
 context: aMethodContext
 	^ self new
 	^ self new
-    	initializeWithContext: aMethodContext;
-        yourself
+		initializeWithContext: aMethodContext;
+		yourself
 ! !
 ! !
 
 
 Object subclass: #ASTInterpreter
 Object subclass: #ASTInterpreter
@@ -194,13 +194,13 @@ It is built using Continuation Passing Style for stepping purposes.
 
 
 Usage example:
 Usage example:
 
 
-    | ast interpreter |
-    ast := Smalltalk current parse: 'foo 1+2+4'.
-    (SemanticAnalyzer on: Object) visit: ast.
+	| ast interpreter |
+	ast := Smalltalk current parse: 'foo 1+2+4'.
+	(SemanticAnalyzer on: Object) visit: ast.
 
 
-    ASTInterpreter new
-        interpret: ast nodes first;
-        result "Answers 7"!
+	ASTInterpreter new
+		interpret: ast nodes first;
+		result "Answers 7"!
 
 
 !ASTInterpreter methodsFor: 'accessing'!
 !ASTInterpreter methodsFor: 'accessing'!
 
 
@@ -224,41 +224,41 @@ result
 
 
 initialize
 initialize
 	super initialize.
 	super initialize.
-    shouldReturn := false
+	shouldReturn := false
 ! !
 ! !
 
 
 !ASTInterpreter methodsFor: 'interpreting'!
 !ASTInterpreter methodsFor: 'interpreting'!
 
 
 interpret: aNode
 interpret: aNode
 	shouldReturn := false.
 	shouldReturn := false.
-    self interpret: aNode continue: [ :value |
-    	result := value ]
+	self interpret: aNode continue: [ :value |
+		result := value ]
 !
 !
 
 
 interpret: aNode continue: aBlock
 interpret: aNode continue: aBlock
 	shouldReturn ifTrue: [ ^ self ].
 	shouldReturn ifTrue: [ ^ self ].
 
 
-	aNode isNode 
-    	ifTrue: [ 	
-        	currentNode := aNode.
-            self interpretNode: aNode continue: [ :value |
-  				self continue: aBlock value: value ] ]
-        ifFalse: [ self continue: aBlock value: aNode ]
+	aNode isNode
+		ifTrue: [	
+			currentNode := aNode.
+			self interpretNode: aNode continue: [ :value |
+				self continue: aBlock value: value ] ]
+		ifFalse: [ self continue: aBlock value: aNode ]
 !
 !
 
 
 interpretAssignmentNode: aNode continue: aBlock
 interpretAssignmentNode: aNode continue: aBlock
 	self interpret: aNode right continue: [ :value |
 	self interpret: aNode right continue: [ :value |
-    	self 
-        	continue: aBlock
-            value: (self assign: aNode left to: value) ]
+		self
+			continue: aBlock
+			value: (self assign: aNode left to: value) ]
 !
 !
 
 
 interpretBlockNode: aNode continue: aBlock
 interpretBlockNode: aNode continue: aBlock
 	"TODO: Context should be set"
 	"TODO: Context should be set"
-    
-    self 
-    	continue: aBlock 
-        value: [ self interpret: aNode nodes first; result ]
+	
+	self
+		continue: aBlock
+		value: [ self interpret: aNode nodes first; result ]
 !
 !
 
 
 interpretBlockSequenceNode: aNode continue: aBlock
 interpretBlockSequenceNode: aNode continue: aBlock
@@ -268,16 +268,16 @@ interpretBlockSequenceNode: aNode continue: aBlock
 interpretCascadeNode: aNode continue: aBlock
 interpretCascadeNode: aNode continue: aBlock
 	"TODO: Handle super sends"
 	"TODO: Handle super sends"
 	
 	
-    self interpret: aNode receiver continue: [ :receiver |
+	self interpret: aNode receiver continue: [ :receiver |
 		"Only interpret the receiver once"
 		"Only interpret the receiver once"
-        aNode nodes do: [ :each | each receiver: receiver ].
-  
-    	self 
-        	interpretAll: aNode nodes allButLast
-    		continue: [
-              	self 
-                	interpret: aNode nodes last
-                	continue: [ :val | self continue: aBlock value: val ] ] ]
+		aNode nodes do: [ :each | each receiver: receiver ].
+
+		self
+			interpretAll: aNode nodes allButLast
+			continue: [
+				self
+					interpret: aNode nodes last
+					continue: [ :val | self continue: aBlock value: val ] ] ]
 !
 !
 
 
 interpretClassReferenceNode: aNode continue: aBlock
 interpretClassReferenceNode: aNode continue: aBlock
@@ -286,18 +286,18 @@ interpretClassReferenceNode: aNode continue: aBlock
 
 
 interpretDynamicArrayNode: aNode continue: aBlock
 interpretDynamicArrayNode: aNode continue: aBlock
 	self interpretAll: aNode nodes continue: [ :array |
 	self interpretAll: aNode nodes continue: [ :array |
-    	self 
-        	continue: aBlock
+		self
+			continue: aBlock
 			value: array ]
 			value: array ]
 !
 !
 
 
 interpretDynamicDictionaryNode: aNode continue: aBlock
 interpretDynamicDictionaryNode: aNode continue: aBlock
-    self interpretAll: aNode nodes continue: [ :array | | hashedCollection |
-    	hashedCollection := HashedCollection new.
-        array do: [ :each | hashedCollection add: each ].
-        self 	
-        	continue: aBlock
-            value: hashedCollection ]
+	self interpretAll: aNode nodes continue: [ :array | | hashedCollection |
+		hashedCollection := HashedCollection new.
+		array do: [ :each | hashedCollection add: each ].
+		self	
+			continue: aBlock
+			value: hashedCollection ]
 !
 !
 
 
 interpretJSStatementNode: aNode continue: aBlock
 interpretJSStatementNode: aNode continue: aBlock
@@ -307,37 +307,37 @@ interpretJSStatementNode: aNode continue: aBlock
 
 
 interpretMethodNode: aNode continue: aBlock
 interpretMethodNode: aNode continue: aBlock
 	self interpretAll: aNode nodes continue: [ :array |
 	self interpretAll: aNode nodes continue: [ :array |
-    	self continue: aBlock value: array first ]
+		self continue: aBlock value: array first ]
 !
 !
 
 
 interpretNode: aNode continue: aBlock
 interpretNode: aNode continue: aBlock
-    aNode interpreter: self continue: aBlock
+	aNode interpreter: self continue: aBlock
 !
 !
 
 
 interpretReturnNode: aNode continue: aBlock
 interpretReturnNode: aNode continue: aBlock
-    self interpret: aNode nodes first continue: [ :value |
-    	shouldReturn := true.
+	self interpret: aNode nodes first continue: [ :value |
+		shouldReturn := true.
 		self continue: aBlock value: value ]
 		self continue: aBlock value: value ]
 !
 !
 
 
 interpretSendNode: aNode continue: aBlock
 interpretSendNode: aNode continue: aBlock
 	"TODO: Handle super sends"
 	"TODO: Handle super sends"
-    
-    self interpret: aNode receiver continue: [ :receiver |
-    	self interpretAll: aNode arguments continue: [ :args |
-    		self 
-            	messageFromSendNode: aNode 
-                arguments: args
-                do: [ :message |
-        			self context pc: self context pc + 1.
-        			self 
-            			continue: aBlock 
-                		value: (message sendTo: receiver) ] ] ]
+	
+	self interpret: aNode receiver continue: [ :receiver |
+		self interpretAll: aNode arguments continue: [ :args |
+			self
+				messageFromSendNode: aNode
+				arguments: args
+				do: [ :message |
+					self context pc: self context pc + 1.
+					self
+						continue: aBlock
+						value: (message sendTo: receiver) ] ] ]
 !
 !
 
 
 interpretSequenceNode: aNode continue: aBlock
 interpretSequenceNode: aNode continue: aBlock
 	self interpretAll: aNode nodes continue: [ :array |
 	self interpretAll: aNode nodes continue: [ :array |
-    	self continue: aBlock value: array last ]
+		self continue: aBlock value: array last ]
 !
 !
 
 
 interpretValueNode: aNode continue: aBlock
 interpretValueNode: aNode continue: aBlock
@@ -345,9 +345,9 @@ interpretValueNode: aNode continue: aBlock
 !
 !
 
 
 interpretVariableNode: aNode continue: aBlock
 interpretVariableNode: aNode continue: aBlock
-    self 
-    	continue: aBlock
-        value: (aNode binding isInstanceVar
+	self
+		continue: aBlock
+		value: (aNode binding isInstanceVar
 			ifTrue: [ self context receiver instVarAt: aNode value ]
 			ifTrue: [ self context receiver instVarAt: aNode value ]
 			ifFalse: [ self context localAt: aNode value ])
 			ifFalse: [ self context localAt: aNode value ])
 ! !
 ! !
@@ -355,62 +355,62 @@ interpretVariableNode: aNode continue: aBlock
 !ASTInterpreter methodsFor: 'private'!
 !ASTInterpreter methodsFor: 'private'!
 
 
 assign: aNode to: anObject
 assign: aNode to: anObject
-	^ aNode binding isInstanceVar 
-    	ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]
-      	ifFalse: [ self context localAt: aNode value put: anObject ]
+	^ aNode binding isInstanceVar
+		ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]
+		ifFalse: [ self context localAt: aNode value put: anObject ]
 !
 !
 
 
 continue: aBlock value: anObject
 continue: aBlock value: anObject
 	result := anObject.
 	result := anObject.
-    aBlock value: anObject
+	aBlock value: anObject
 !
 !
 
 
 eval: aString
 eval: aString
-	"Evaluate aString as JS source inside an JS function. 
-    aString is not sandboxed."
-    
-    | source function |
-    
-    source := String streamContents: [ :str |
-    	str nextPutAll: '(function('.
-        self context locals keys 
-        	do: [ :each | str nextPutAll: each ]
-          	separatedBy: [ str nextPutAll: ',' ].
-        str 
-        	nextPutAll: '){ return (function() {';
-        	nextPutAll: aString;
-            nextPutAll: '})() })' ].
-            
+	"Evaluate aString as JS source inside an JS function.
+	aString is not sandboxed."
+	
+	| source function |
+	
+	source := String streamContents: [ :str |
+		str nextPutAll: '(function('.
+		self context locals keys
+			do: [ :each | str nextPutAll: each ]
+			separatedBy: [ str nextPutAll: ',' ].
+		str
+			nextPutAll: '){ return (function() {';
+			nextPutAll: aString;
+			nextPutAll: '})() })' ].
+			
 	function := Compiler new eval: source.
 	function := Compiler new eval: source.
-    
+	
 	^ function valueWithPossibleArguments: self context locals values
 	^ function valueWithPossibleArguments: self context locals values
 !
 !
 
 
 interpretAll: aCollection continue: aBlock
 interpretAll: aCollection continue: aBlock
-	self 
-    	interpretAll: aCollection 
-        continue: aBlock 
-        result: OrderedCollection new
+	self
+		interpretAll: aCollection
+		continue: aBlock
+		result: OrderedCollection new
 !
 !
 
 
 interpretAll: nodes continue: aBlock result: aCollection
 interpretAll: nodes continue: aBlock result: aCollection
-	nodes isEmpty 
-    	ifTrue: [ self continue: aBlock value: aCollection ]
-    	ifFalse: [
-    		self interpret: nodes first continue: [:value |
-    			self 
-                	interpretAll: nodes allButFirst 
-                    continue: aBlock
-  					result: aCollection, { value } ] ]
+	nodes isEmpty
+		ifTrue: [ self continue: aBlock value: aCollection ]
+		ifFalse: [
+			self interpret: nodes first continue: [:value |
+				self
+					interpretAll: nodes allButFirst
+					continue: aBlock
+					result: aCollection, { value } ] ]
 !
 !
 
 
 messageFromSendNode: aSendNode arguments: aCollection do: aBlock
 messageFromSendNode: aSendNode arguments: aCollection do: aBlock
-    self 
-        continue: aBlock
-        value: (Message new
-    		selector: aSendNode selector;
-        	arguments: aCollection;
-        	yourself)
+	self
+		continue: aBlock
+		value: (Message new
+			selector: aSendNode selector;
+			arguments: aCollection;
+			yourself)
 ! !
 ! !
 
 
 !ASTInterpreter methodsFor: 'testing'!
 !ASTInterpreter methodsFor: 'testing'!
@@ -428,21 +428,21 @@ Use `#step` to actually interpret the next node.
 
 
 Usage example:
 Usage example:
 
 
-    | ast interpreter |
-    ast := Smalltalk current parse: 'foo 1+2+4'.
-    (SemanticAnalyzer on: Object) visit: ast.
-
-    interpreter := ASTSteppingInterpreter new
-        interpret: ast nodes first;
-        yourself.
-        
-    debugger step; step.
-    debugger step; step.
-    debugger result."Answers 1"
-    debugger step.
-    debugger result. "Answers 3"
-    debugger step.
-    debugger result. "Answers 7"!
+	| ast interpreter |
+	ast := Smalltalk current parse: 'foo 1+2+4'.
+	(SemanticAnalyzer on: Object) visit: ast.
+
+	interpreter := ASTSteppingInterpreter new
+		interpret: ast nodes first;
+		yourself.
+		
+	debugger step; step.
+	debugger step; step.
+	debugger result."Answers 1"
+	debugger step.
+	debugger result. "Answers 3"
+	debugger step.
+	debugger result. "Answers 7"!
 
 
 !ASTSteppingInterpreter methodsFor: 'accessing'!
 !ASTSteppingInterpreter methodsFor: 'accessing'!
 
 
@@ -454,15 +454,15 @@ nextNode
 
 
 initialize
 initialize
 	super initialize.
 	super initialize.
-    continuation := [  ]
+	continuation := []
 ! !
 ! !
 
 
 !ASTSteppingInterpreter methodsFor: 'interpreting'!
 !ASTSteppingInterpreter methodsFor: 'interpreting'!
 
 
 interpret: aNode continue: aBlock
 interpret: aNode continue: aBlock
 	nextNode := aNode.
 	nextNode := aNode.
-	continuation := [ 
-    	super interpret: aNode continue: aBlock ]
+	continuation := [
+		super interpret: aNode continue: aBlock ]
 ! !
 ! !
 
 
 !ASTSteppingInterpreter methodsFor: 'stepping'!
 !ASTSteppingInterpreter methodsFor: 'stepping'!

+ 27 - 27
st/Compiler-Semantic.st

@@ -24,7 +24,7 @@ args
 !
 !
 
 
 bindingFor: aStringOrNode
 bindingFor: aStringOrNode
-	^ self pseudoVars at: aStringOrNode value ifAbsent: [ 
+	^ self pseudoVars at: aStringOrNode value ifAbsent: [
 		self args at: aStringOrNode value ifAbsent: [
 		self args at: aStringOrNode value ifAbsent: [
 			self temps at: aStringOrNode value ifAbsent: [ nil ]]]
 			self temps at: aStringOrNode value ifAbsent: [ nil ]]]
 !
 !
@@ -41,7 +41,7 @@ lookupVariable: aNode
 	| lookup |
 	| lookup |
 	lookup := (self bindingFor: aNode).
 	lookup := (self bindingFor: aNode).
 	lookup ifNil: [
 	lookup ifNil: [
-		lookup := self outerScope ifNotNil: [ 
+		lookup := self outerScope ifNotNil: [
 			(self outerScope lookupVariable: aNode) ]].
 			(self outerScope lookupVariable: aNode) ]].
 	^ lookup
 	^ lookup
 !
 !
@@ -76,7 +76,7 @@ pseudoVars
 scopeLevel
 scopeLevel
 	self outerScope ifNil: [ ^ 1 ].
 	self outerScope ifNil: [ ^ 1 ].
 	self isInlined ifTrue: [ ^ self outerScope scopeLevel ].
 	self isInlined ifTrue: [ ^ self outerScope scopeLevel ].
-    
+	
 	^ self outerScope scopeLevel + 1
 	^ self outerScope scopeLevel + 1
 !
 !
 
 
@@ -108,7 +108,7 @@ isBlockScope
 
 
 isInlined
 isInlined
 	^ self instruction notNil and: [
 	^ self instruction notNil and: [
-      	self instruction isInlined ]
+		self instruction isInlined ]
 !
 !
 
 
 isMethodScope
 isMethodScope
@@ -203,7 +203,7 @@ Object subclass: #ScopeVar
 	instanceVariableNames: 'scope name'
 	instanceVariableNames: 'scope name'
 	package: 'Compiler-Semantic'!
 	package: 'Compiler-Semantic'!
 !ScopeVar commentStamp!
 !ScopeVar commentStamp!
-I am an entry in a LexicalScope that gets associated with variable nodes of the same name.  
+I am an entry in a LexicalScope that gets associated with variable nodes of the same name.	
 There are 4 different subclasses of vars: temp vars, local vars, args, and unknown/global vars.!
 There are 4 different subclasses of vars: temp vars, local vars, args, and unknown/global vars.!
 
 
 !ScopeVar methodsFor: 'accessing'!
 !ScopeVar methodsFor: 'accessing'!
@@ -264,7 +264,7 @@ validateAssignment
 !ScopeVar class methodsFor: 'instance creation'!
 !ScopeVar class methodsFor: 'instance creation'!
 
 
 on: aString
 on: aString
-	^ self new 
+	^ self new
 		name: aString;
 		name: aString;
 		yourself
 		yourself
 ! !
 ! !
@@ -413,18 +413,18 @@ errorShadowingVariable: aString
 
 
 errorUnknownVariable: aNode
 errorUnknownVariable: aNode
 	"Throw an error if the variable is undeclared in the global JS scope (i.e. window).
 	"Throw an error if the variable is undeclared in the global JS scope (i.e. window).
-    We allow four variable names in addition: `jQuery`, `window`, `process` and `global` 
-    for nodejs and browser environments. 
-    
-    This is only to make sure compilation works on both browser-based and nodejs environments.
-    The ideal solution would be to use a pragma instead"
+	We allow four variable names in addition: `jQuery`, `window`, `process` and `global`
+	for nodejs and browser environments.
+	
+	This is only to make sure compilation works on both browser-based and nodejs environments.
+	The ideal solution would be to use a pragma instead"
 
 
 	| identifier |
 	| identifier |
-    identifier := aNode value.
-    
-	((#('jQuery' 'window' 'document' 'process' 'global') includes: identifier) not 
-        and: [ self isVariableGloballyUndefined: identifier ]) 
-        	ifTrue: [
+	identifier := aNode value.
+	
+	((#('jQuery' 'window' 'document' 'process' 'global') includes: identifier) not
+		and: [ self isVariableGloballyUndefined: identifier ])
+			ifTrue: [
 				UnknownVariableError new
 				UnknownVariableError new
 					variableName: aNode value;
 					variableName: aNode value;
 					signal ]
 					signal ]
@@ -443,7 +443,7 @@ newMethodScope
 !
 !
 
 
 newScopeOfClass: aLexicalScopeClass
 newScopeOfClass: aLexicalScopeClass
-	^ aLexicalScopeClass new 
+	^ aLexicalScopeClass new
 		outerScope: currentScope;
 		outerScope: currentScope;
 		yourself
 		yourself
 ! !
 ! !
@@ -485,7 +485,7 @@ visitBlockNode: aNode
 	aNode scope: currentScope.
 	aNode scope: currentScope.
 	currentScope node: aNode.
 	currentScope node: aNode.
 	
 	
-	aNode parameters do: [ :each | 
+	aNode parameters do: [ :each |
 		self validateVariableScope: each.
 		self validateVariableScope: each.
 		currentScope addArg: each ].
 		currentScope addArg: each ].
 
 
@@ -495,7 +495,7 @@ visitBlockNode: aNode
 
 
 visitCascadeNode: aNode
 visitCascadeNode: aNode
 	"Populate the receiver into all children"
 	"Populate the receiver into all children"
-	aNode nodes do: [ :each | 
+	aNode nodes do: [ :each |
 		each receiver: aNode receiver ].
 		each receiver: aNode receiver ].
 	super visitCascadeNode: aNode.
 	super visitCascadeNode: aNode.
 	aNode nodes first superSend ifTrue: [
 	aNode nodes first superSend ifTrue: [
@@ -512,18 +512,18 @@ visitMethodNode: aNode
 	aNode scope: currentScope.
 	aNode scope: currentScope.
 	currentScope node: aNode.
 	currentScope node: aNode.
 
 
-	self theClass allInstanceVariableNames do: [:each | 
+	self theClass allInstanceVariableNames do: [:each |
 		currentScope addIVar: each ].
 		currentScope addIVar: each ].
-	aNode arguments do: [ :each | 
+	aNode arguments do: [ :each |
 		self validateVariableScope: each.
 		self validateVariableScope: each.
 		currentScope addArg: each ].
 		currentScope addArg: each ].
 
 
 	super visitMethodNode: aNode.
 	super visitMethodNode: aNode.
 
 
-	aNode 
+	aNode
 		classReferences: self classReferences;
 		classReferences: self classReferences;
 		messageSends: self messageSends keys;
 		messageSends: self messageSends keys;
-        superSends: self superSends keys.
+		superSends: self superSends keys.
 	self popScope
 	self popScope
 !
 !
 
 
@@ -537,13 +537,13 @@ visitReturnNode: aNode
 
 
 visitSendNode: aNode
 visitSendNode: aNode
 
 
-	aNode receiver value = 'super' 
+	aNode receiver value = 'super'
 		ifTrue: [
 		ifTrue: [
 			aNode superSend: true.
 			aNode superSend: true.
 			aNode receiver value: 'self'.
 			aNode receiver value: 'self'.
 			self superSends at: aNode selector ifAbsentPut: [ Set new ].
 			self superSends at: aNode selector ifAbsentPut: [ Set new ].
 			(self superSends at: aNode selector) add: aNode ]
 			(self superSends at: aNode selector) add: aNode ]
-          
+		
 		ifFalse: [ (IRSendInliner inlinedSelectors includes: aNode selector) ifTrue: [
 		ifFalse: [ (IRSendInliner inlinedSelectors includes: aNode selector) ifTrue: [
 			aNode shouldBeInlined: true.
 			aNode shouldBeInlined: true.
 			aNode receiver shouldBeAliased: true ] ].
 			aNode receiver shouldBeAliased: true ] ].
@@ -557,7 +557,7 @@ visitSendNode: aNode
 !
 !
 
 
 visitSequenceNode: aNode
 visitSequenceNode: aNode
-	aNode temps do: [ :each | 
+	aNode temps do: [ :each |
 		self validateVariableScope: each.
 		self validateVariableScope: each.
 		currentScope addTemp: each ].
 		currentScope addTemp: each ].
 
 
@@ -568,7 +568,7 @@ visitVariableNode: aNode
 	"Bind a ScopeVar to aNode by doing a lookup in the current scope.
 	"Bind a ScopeVar to aNode by doing a lookup in the current scope.
 	If no ScopeVar is found, bind a UnknowVar and throw an error"
 	If no ScopeVar is found, bind a UnknowVar and throw an error"
 
 
-	aNode binding: ((currentScope lookupVariable: aNode) ifNil: [ 
+	aNode binding: ((currentScope lookupVariable: aNode) ifNil: [
 		self errorUnknownVariable: aNode.
 		self errorUnknownVariable: aNode.
 		UnknownVar new name: aNode value; yourself ])
 		UnknownVar new name: aNode value; yourself ])
 ! !
 ! !

+ 110 - 110
st/Compiler-Tests.st

@@ -13,37 +13,37 @@ interpreter
 
 
 analyze: aNode forClass: aClass
 analyze: aNode forClass: aClass
 	(SemanticAnalyzer on: aClass) visit: aNode.
 	(SemanticAnalyzer on: aClass) visit: aNode.
-    ^ aNode
+	^ aNode
 !
 !
 
 
 interpret: aString
 interpret: aString
-	^ self 
-    	interpret: aString 
-        withArguments: Dictionary new
+	^ self
+		interpret: aString
+		withArguments: Dictionary new
 !
 !
 
 
 interpret: aString receiver: anObject withArguments: aDictionary
 interpret: aString receiver: anObject withArguments: aDictionary
 	"The food is a methodNode. Interpret the sequenceNode only"
 	"The food is a methodNode. Interpret the sequenceNode only"
-    
-    | ctx |
-    
-    ctx := AIContext new.
-    ctx receiver: anObject.
-    aDictionary keysAndValuesDo: [ :key :value |
-    	ctx localAt: key put: value ].
-    
-    ^ self interpreter
-    	context: ctx;
-    	interpret: (self parse: aString forClass: anObject class) 
-        	nodes first;
-        result
+	
+	| ctx |
+	
+	ctx := AIContext new.
+	ctx receiver: anObject.
+	aDictionary keysAndValuesDo: [ :key :value |
+		ctx localAt: key put: value ].
+	
+	^ self interpreter
+		context: ctx;
+		interpret: (self parse: aString forClass: anObject class)
+			nodes first;
+		result
 !
 !
 
 
 interpret: aString withArguments: aDictionary
 interpret: aString withArguments: aDictionary
-	^ self 
-    	interpret: aString 
-        receiver: Object new
-        withArguments: aDictionary
+	^ self
+		interpret: aString
+		receiver: Object new
+		withArguments: aDictionary
 ! !
 ! !
 
 
 !AbstractASTInterpreterTest methodsFor: 'parsing'!
 !AbstractASTInterpreterTest methodsFor: 'parsing'!
@@ -74,8 +74,8 @@ testBinarySend
 
 
 testBlockLiteral
 testBlockLiteral
 	self assert: (self interpret: 'foo ^ true ifTrue: [ 1 ] ifFalse: [ 2 ]') equals: 1.
 	self assert: (self interpret: 'foo ^ true ifTrue: [ 1 ] ifFalse: [ 2 ]') equals: 1.
-    self assert: (self interpret: 'foo true ifTrue: [ ^ 1 ] ifFalse: [ 2 ]') equals: 1.
-    self assert: (self interpret: 'foo ^ false ifTrue: [ 1 ] ifFalse: [ 2 ]') equals: 2
+	self assert: (self interpret: 'foo true ifTrue: [ ^ 1 ] ifFalse: [ 2 ]') equals: 1.
+	self assert: (self interpret: 'foo ^ false ifTrue: [ 1 ] ifFalse: [ 2 ]') equals: 2
 !
 !
 
 
 testCascade
 testCascade
@@ -92,30 +92,30 @@ testDynamicDictionary
 
 
 testInlinedJSStatement
 testInlinedJSStatement
 	self assert: (self interpret: 'foo <return 2+3>') equals: 5.
 	self assert: (self interpret: 'foo <return 2+3>') equals: 5.
-    
-    self 
-    	assert: (self 
-    		interpret: 'foo: anInteger <return 2 + anInteger>' 
-        	withArguments: #{ 'anInteger' -> 3}) 
+	
+	self
+		assert: (self
+			interpret: 'foo: anInteger <return 2 + anInteger>'
+			withArguments: #{ 'anInteger' -> 3})
 		equals: 5
 		equals: 5
 !
 !
 
 
 testInstVarAccess
 testInstVarAccess
-	self 
-    	assert: (self 
-    		interpret: 'foo ^ x'
-        	receiver: 2@3
-        	withArguments: #{})
-        equals: 2
+	self
+		assert: (self
+			interpret: 'foo ^ x'
+			receiver: 2@3
+			withArguments: #{})
+		equals: 2
 !
 !
 
 
 testInstVarAssignment
 testInstVarAssignment
-	self 
-    	assert: (self 
-    		interpret: 'foo: anInteger x := anInteger. ^ x'
-        	receiver: Point new
-        	withArguments: #{'anInteger' -> 2})
-        equals: 2
+	self
+		assert: (self
+			interpret: 'foo: anInteger x := anInteger. ^ x'
+			receiver: Point new
+			withArguments: #{'anInteger' -> 2})
+		equals: 2
 !
 !
 
 
 testNonlocalReturn
 testNonlocalReturn
@@ -123,12 +123,12 @@ testNonlocalReturn
 !
 !
 
 
 testReceiver
 testReceiver
-	self 
-    	assert: (self 
-    		interpret: 'foo ^ self'
-        	receiver: 2@3
-        	withArguments: #{})
-        equals: 2@3
+	self
+		assert: (self
+			interpret: 'foo ^ self'
+			receiver: 2@3
+			withArguments: #{})
+		equals: 2@3
 !
 !
 
 
 testTempAssignment
 testTempAssignment
@@ -149,55 +149,55 @@ interpreter
 
 
 testAtEnd
 testAtEnd
 	self interpret: 'foo 1 + 2'.
 	self interpret: 'foo 1 + 2'.
-    self deny: self interpreter atEnd.
+	self deny: self interpreter atEnd.
 
 
-    self interpreter step.
-    self deny: self interpreter atEnd.
-    
-    self interpreter step.
-    self deny: self interpreter atEnd.
-    
-    self interpreter step.
-    self deny: self interpreter atEnd.
-    
-    self interpreter step.
-    self assert: self interpreter atEnd
+	self interpreter step.
+	self deny: self interpreter atEnd.
+	
+	self interpreter step.
+	self deny: self interpreter atEnd.
+	
+	self interpreter step.
+	self deny: self interpreter atEnd.
+	
+	self interpreter step.
+	self assert: self interpreter atEnd
 !
 !
 
 
 testMessageSend
 testMessageSend
 	self interpret: 'foo 1 + 2'.
 	self interpret: 'foo 1 + 2'.
-    
-    "SequenceNode"
-    self interpreter step.
-    
-    "SendNode"
-    self interpreter step.
-    
-     "ValueNode"
-    self interpreter step.
-    self assert: self interpreter currentNode value equals: 1.
-    
-    "ValueNode"
-    self interpreter step.
-    self assert: self interpreter currentNode value equals: 2.
-    
-    "Result"
-    self interpreter step.
-    self assert: self interpreter result equals: 3
+	
+	"SequenceNode"
+	self interpreter step.
+	
+	"SendNode"
+	self interpreter step.
+	
+	 "ValueNode"
+	self interpreter step.
+	self assert: self interpreter currentNode value equals: 1.
+	
+	"ValueNode"
+	self interpreter step.
+	self assert: self interpreter currentNode value equals: 2.
+	
+	"Result"
+	self interpreter step.
+	self assert: self interpreter result equals: 3
 !
 !
 
 
 testSimpleStepping
 testSimpleStepping
 	self interpret: 'foo 1'.
 	self interpret: 'foo 1'.
-    
-    "SequenceNode"
-    self interpreter step.
-    
-    self assert: self interpreter result isNil.
-    
-    "ValueNode"
-    self interpreter step.
-    
-    self assert: self interpreter result equals: 1
+	
+	"SequenceNode"
+	self interpreter step.
+	
+	self assert: self interpreter result isNil.
+	
+	"ValueNode"
+	self interpreter step.
+	
+	self assert: self interpreter result equals: 1
 ! !
 ! !
 
 
 TestCase subclass: #CodeGeneratorTest
 TestCase subclass: #CodeGeneratorTest
@@ -265,40 +265,40 @@ testCascades
 
 
 testDynamicArrayElementsOrdered
 testDynamicArrayElementsOrdered
 	self should: 'foo
 	self should: 'foo
-  | x |
-  x := 1.
-  ^ { x. true ifTrue: [ x := 2 ] }
+	| x |
+	x := 1.
+	^ { x. true ifTrue: [ x := 2 ] }
 ' return: #(1 2).
 ' return: #(1 2).
 !
 !
 
 
 testDynamicDictionaryElementsOrdered
 testDynamicDictionaryElementsOrdered
 	self should: 'foo
 	self should: 'foo
-  | x |
-  x := ''foo''->1.
-  ^ #{ x. (true ifTrue: [ x := ''bar''->2 ]) }
+	| x |
+	x := ''foo''->1.
+	^ #{ x. (true ifTrue: [ x := ''bar''->2 ]) }
 ' return: #{'foo'->1. 'bar'->2}.
 ' return: #{'foo'->1. 'bar'->2}.
 !
 !
 
 
 testInnerTemporalDependentElementsOrdered
 testInnerTemporalDependentElementsOrdered
 	self should: 'foo
 	self should: 'foo
-  | x |
-  x := Array.
-  ^ x with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])
+	| x |
+	x := Array.
+	^ x with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])
 ' return: {'foo'->Array. 'bar'->2}.
 ' return: {'foo'->Array. 'bar'->2}.
 	self should: 'foo
 	self should: 'foo
-  | x |
-  x := 1.
-  ^ Array with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])
+	| x |
+	x := 1.
+	^ Array with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])
 ' return: {'foo'->1. 'bar'->2}.
 ' return: {'foo'->1. 'bar'->2}.
 	self should: 'foo
 	self should: 'foo
-  | x |
-  x := 1.
-  ^ { ''foo''->x. ''bar''->(true ifTrue: [ x := 2 ]) }
+	| x |
+	x := 1.
+	^ { ''foo''->x. ''bar''->(true ifTrue: [ x := 2 ]) }
 ' return: {'foo'->1. 'bar'->2}.
 ' return: {'foo'->1. 'bar'->2}.
 	self should: 'foo
 	self should: 'foo
-  | x |
-  x := 1.
-  ^ #{ ''foo''->x. ''bar''->(true ifTrue: [ x := 2 ]) }
+	| x |
+	x := 1.
+	^ #{ ''foo''->x. ''bar''->(true ifTrue: [ x := 2 ]) }
 ' return: #{'foo'->1. 'bar'->2}.
 ' return: #{'foo'->1. 'bar'->2}.
 !
 !
 
 
@@ -349,15 +349,15 @@ testNonLocalReturn
 
 
 testSendReceiverAndArgumentsOrdered
 testSendReceiverAndArgumentsOrdered
 	self should: 'foo
 	self should: 'foo
-  | x |
-  x := 1.
-  ^ Array with: x with: (true ifTrue: [ x := 2 ])
+	| x |
+	x := 1.
+	^ Array with: x with: (true ifTrue: [ x := 2 ])
 ' return: #(1 2).
 ' return: #(1 2).
 
 
 	self should: 'foo
 	self should: 'foo
-  | x |
-  x := Array.
-  ^ x with: x with: (true ifTrue: [ x := 2 ])
+	| x |
+	x := Array.
+	^ x with: x with: (true ifTrue: [ x := 2 ])
 ' return: {Array. 2}.
 ' return: {Array. 2}.
 !
 !
 
 

+ 12 - 12
st/Examples.st

@@ -3,41 +3,41 @@ Widget subclass: #Counter
 	instanceVariableNames: 'count header'
 	instanceVariableNames: 'count header'
 	package: 'Examples'!
 	package: 'Examples'!
 !Counter commentStamp!
 !Counter commentStamp!
-This is a trivial Widget example mimicking the classic Counter example in Seaside. 
+This is a trivial Widget example mimicking the classic Counter example in Seaside.
 In order to play with it, just select the doit below and press the Do it button in the far right corner.
 In order to play with it, just select the doit below and press the Do it button in the far right corner.
 Then take a look in the HTML document above the IDE.
 Then take a look in the HTML document above the IDE.
 
 
-        Counter new appendToJQuery: 'body' asJQuery!
+		Counter new appendToJQuery: 'body' asJQuery!
 
 
 !Counter methodsFor: 'actions'!
 !Counter methodsFor: 'actions'!
 
 
 decrease
 decrease
-    count := count - 1.
-    header contents: [:html | html with: count asString]
+	count := count - 1.
+	header contents: [:html | html with: count asString]
 !
 !
 
 
 increase
 increase
-    count := count + 1.
-    header contents: [:html | html with: count asString]
+	count := count + 1.
+	header contents: [:html | html with: count asString]
 ! !
 ! !
 
 
 !Counter methodsFor: 'initialization'!
 !Counter methodsFor: 'initialization'!
 
 
 initialize
 initialize
-    super initialize.
-    count := 0
+	super initialize.
+	count := 0
 ! !
 ! !
 
 
 !Counter methodsFor: 'rendering'!
 !Counter methodsFor: 'rendering'!
 
 
 renderOn: html
 renderOn: html
-    header := html h1 
+	header := html h1
 	with: count asString;
 	with: count asString;
 	yourself.
 	yourself.
-    html button
+	html button
 	with: '++';
 	with: '++';
 	onClick: [self increase].
 	onClick: [self increase].
-    html button
+	html button
 	with: '--';
 	with: '--';
 	onClick: [self decrease]
 	onClick: [self decrease]
 ! !
 ! !
@@ -50,6 +50,6 @@ tryExample
 	look in the HTML document above the IDE."
 	look in the HTML document above the IDE."
 
 
 	"Counter tryExample"
 	"Counter tryExample"
-        self new appendToJQuery: 'body' asJQuery
+		self new appendToJQuery: 'body' asJQuery
 ! !
 ! !
 
 

File diff suppressed because it is too large
+ 251 - 251
st/IDE.st


+ 112 - 112
st/Importer-Exporter.st

@@ -24,13 +24,13 @@ nextChunk
 
 
 	| char result chunk |
 	| char result chunk |
 	result := '' writeStream.
 	result := '' writeStream.
-        [char := stream next.
-        char notNil] whileTrue: [
-                 char = '!!' ifTrue: [
-                         stream peek = '!!'
-                                ifTrue: [stream next "skipping the escape double"]
-                                ifFalse: [^result contents trimBoth  "chunk end marker found"]].
-                 result nextPut: char].
+		[char := stream next.
+		char notNil] whileTrue: [
+				 char = '!!' ifTrue: [
+						 stream peek = '!!'
+								ifTrue: [stream next "skipping the escape double"]
+								ifFalse: [^result contents trimBoth	 "chunk end marker found"]].
+				 result nextPut: char].
 	^nil "a chunk needs to end with !!"
 	^nil "a chunk needs to end with !!"
 ! !
 ! !
 
 
@@ -47,10 +47,10 @@ Object subclass: #Exporter
 !Exporter methodsFor: 'fileOut'!
 !Exporter methodsFor: 'fileOut'!
 
 
 exportAll
 exportAll
-    "Export all packages in the system."
+	"Export all packages in the system."
 
 
-    ^String streamContents: [:stream |
-    	Smalltalk current packages do: [:pkg |
+	^String streamContents: [:stream |
+		Smalltalk current packages do: [:pkg |
 		stream nextPutAll: (self exportPackage: pkg name)]]
 		stream nextPutAll: (self exportPackage: pkg name)]]
 !
 !
 
 
@@ -69,13 +69,13 @@ exportPackage: packageName
 
 
 	| package |
 	| package |
 	^String streamContents: [:stream |
 	^String streamContents: [:stream |
-                package := Smalltalk current packageAt: packageName.
-                self exportPackageDefinitionOf: package on: stream.
+				package := Smalltalk current packageAt: packageName.
+				self exportPackageDefinitionOf: package on: stream.
 
 
 		"Export classes in dependency order.
 		"Export classes in dependency order.
 		Update (issue #171): Remove duplicates for export"
 		Update (issue #171): Remove duplicates for export"
-	    	package sortedClasses asSet do: [:each |
-                        stream nextPutAll: (self exportClass: each)].
+			package sortedClasses asSet do: [:each |
+						stream nextPutAll: (self exportClass: each)].
 		self exportPackageExtensionsOf: package on: stream]
 		self exportPackageExtensionsOf: package on: stream]
 ! !
 ! !
 
 
@@ -83,29 +83,29 @@ exportPackage: packageName
 
 
 classNameFor: aClass
 classNameFor: aClass
 	^aClass isMetaclass
 	^aClass isMetaclass
-	    ifTrue: [aClass instanceClass name, '.klass']
-	    ifFalse: [
+		ifTrue: [aClass instanceClass name, '.klass']
+		ifFalse: [
 		aClass isNil
 		aClass isNil
-		    ifTrue: ['nil']
-		    ifFalse: [aClass name]]
+			ifTrue: ['nil']
+			ifFalse: [aClass name]]
 !
 !
 
 
 exportDefinitionOf: aClass on: aStream
 exportDefinitionOf: aClass on: aStream
-	aStream 
-	    nextPutAll: 'smalltalk.addClass(';
-	    nextPutAll: '''', (self classNameFor: aClass), ''', ';
-	    nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);
-	    nextPutAll: ', ['.
-	aClass instanceVariableNames 
-	    do: [:each | aStream nextPutAll: '''', each, '''']
-	    separatedBy: [aStream nextPutAll: ', '].
-	aStream	
-	    nextPutAll: '], ''';
-	    nextPutAll: aClass category, '''';
-	    nextPutAll: ');'.
+	aStream
+		nextPutAll: 'smalltalk.addClass(';
+		nextPutAll: '''', (self classNameFor: aClass), ''', ';
+		nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);
+		nextPutAll: ', ['.
+	aClass instanceVariableNames
+		do: [:each | aStream nextPutAll: '''', each, '''']
+		separatedBy: [aStream nextPutAll: ', '].
+	aStream
+		nextPutAll: '], ''';
+		nextPutAll: aClass category, '''';
+		nextPutAll: ');'.
 	aClass comment notEmpty ifTrue: [
 	aClass comment notEmpty ifTrue: [
-	    aStream 
-	    	lf;
+		aStream
+			lf;
 		nextPutAll: 'smalltalk.';
 		nextPutAll: 'smalltalk.';
 		nextPutAll: (self classNameFor: aClass);
 		nextPutAll: (self classNameFor: aClass);
 		nextPutAll: '.comment=';
 		nextPutAll: '.comment=';
@@ -115,17 +115,17 @@ exportDefinitionOf: aClass on: aStream
 
 
 exportMetaDefinitionOf: aClass on: aStream
 exportMetaDefinitionOf: aClass on: aStream
 	aClass class instanceVariableNames isEmpty ifFalse: [
 	aClass class instanceVariableNames isEmpty ifFalse: [
-	    aStream 
+		aStream
 		nextPutAll: 'smalltalk.', (self classNameFor: aClass class);
 		nextPutAll: 'smalltalk.', (self classNameFor: aClass class);
 		nextPutAll: '.iVarNames = ['.
 		nextPutAll: '.iVarNames = ['.
-	    aClass class instanceVariableNames
+		aClass class instanceVariableNames
 		do: [:each | aStream nextPutAll: '''', each, '''']
 		do: [:each | aStream nextPutAll: '''', each, '''']
 		separatedBy: [aStream nextPutAll: ','].
 		separatedBy: [aStream nextPutAll: ','].
-	    aStream nextPutAll: '];', String lf]
+		aStream nextPutAll: '];', String lf]
 !
 !
 
 
 exportMethod: aMethod of: aClass on: aStream
 exportMethod: aMethod of: aClass on: aStream
-	aStream 
+	aStream
 		nextPutAll: 'smalltalk.addMethod(';lf;
 		nextPutAll: 'smalltalk.addMethod(';lf;
 		nextPutAll: aMethod selector asSelector asJavascript, ',';lf;
 		nextPutAll: aMethod selector asSelector asJavascript, ',';lf;
 		nextPutAll: 'smalltalk.method({';lf;
 		nextPutAll: 'smalltalk.method({';lf;
@@ -153,10 +153,10 @@ exportMethodsOf: aClass on: aStream
 !
 !
 
 
 exportPackageDefinitionOf: package on: aStream
 exportPackageDefinitionOf: package on: aStream
-	aStream 
-	    nextPutAll: 'smalltalk.addPackage(';
-	    nextPutAll: '''', package name, ''');';
-        lf
+	aStream
+		nextPutAll: 'smalltalk.addPackage(';
+		nextPutAll: '''', package name, ''');';
+		lf
 !
 !
 
 
 exportPackageExtensionsOf: package on: aStream
 exportPackageExtensionsOf: package on: aStream
@@ -165,7 +165,7 @@ exportPackageExtensionsOf: package on: aStream
 	| name |
 	| name |
 	name := package name.
 	name := package name.
 	(Package sortedClasses: Smalltalk current classes) do: [:each |
 	(Package sortedClasses: Smalltalk current classes) do: [:each |
-		{each. each class} do: [:aClass | 
+		{each. each class} do: [:aClass |
 			((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:method |
 			((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:method |
 				(method category match: '^\*', name) ifTrue: [
 				(method category match: '^\*', name) ifTrue: [
 					self exportMethod: method of: aClass on: aStream ]]]]
 					self exportMethod: method of: aClass on: aStream ]]]]
@@ -185,48 +185,48 @@ chunkEscape: aString
 
 
 classNameFor: aClass
 classNameFor: aClass
 	^aClass isMetaclass
 	^aClass isMetaclass
-	    ifTrue: [aClass instanceClass name, ' class']
-	    ifFalse: [
+		ifTrue: [aClass instanceClass name, ' class']
+		ifFalse: [
 		aClass isNil
 		aClass isNil
-		    ifTrue: ['nil']
-		    ifFalse: [aClass name]]
+			ifTrue: ['nil']
+			ifFalse: [aClass name]]
 !
 !
 
 
 exportDefinitionOf: aClass on: aStream
 exportDefinitionOf: aClass on: aStream
-    "Chunk format."
-
-    aStream 
-        nextPutAll: (self classNameFor: aClass superclass);
-        nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;
-        nextPutAll: '	instanceVariableNames: '''.
-    aClass instanceVariableNames 
-        do: [:each | aStream nextPutAll: each]
-        separatedBy: [aStream nextPutAll: ' '].
-    aStream 
-        nextPutAll: ''''; lf;
-        nextPutAll: '	package: ''', aClass category, '''!!'; lf.
-    aClass comment notEmpty ifTrue: [
-        aStream 
-        nextPutAll: '!!', (self classNameFor: aClass), ' commentStamp!!';lf;
-        nextPutAll: (self chunkEscape: aClass comment), '!!';lf].
-    aStream lf
+	"Chunk format."
+
+	aStream
+		nextPutAll: (self classNameFor: aClass superclass);
+		nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;
+		nextPutAll: '	instanceVariableNames: '''.
+	aClass instanceVariableNames
+		do: [:each | aStream nextPutAll: each]
+		separatedBy: [aStream nextPutAll: ' '].
+	aStream
+		nextPutAll: ''''; lf;
+		nextPutAll: '	package: ''', aClass category, '''!!'; lf.
+	aClass comment notEmpty ifTrue: [
+		aStream
+		nextPutAll: '!!', (self classNameFor: aClass), ' commentStamp!!';lf;
+		nextPutAll: (self chunkEscape: aClass comment), '!!';lf].
+	aStream lf
 !
 !
 
 
 exportMetaDefinitionOf: aClass on: aStream
 exportMetaDefinitionOf: aClass on: aStream
 
 
 	aClass class instanceVariableNames isEmpty ifFalse: [
 	aClass class instanceVariableNames isEmpty ifFalse: [
-		aStream 
-		    nextPutAll: (self classNameFor: aClass class);
-		    nextPutAll: ' instanceVariableNames: '''.
-		aClass class instanceVariableNames 
-		    do: [:each | aStream nextPutAll: each]
-		    separatedBy: [aStream nextPutAll: ' '].
-		aStream	
-		    nextPutAll: '''!!'; lf; lf]
+		aStream
+			nextPutAll: (self classNameFor: aClass class);
+			nextPutAll: ' instanceVariableNames: '''.
+		aClass class instanceVariableNames
+			do: [:each | aStream nextPutAll: each]
+			separatedBy: [aStream nextPutAll: ' '].
+		aStream
+			nextPutAll: '''!!'; lf; lf]
 !
 !
 
 
 exportMethod: aMethod of: aClass on: aStream
 exportMethod: aMethod of: aClass on: aStream
-	aStream 
+	aStream
 		lf; lf; nextPutAll: (self chunkEscape: aMethod source); lf;
 		lf; lf; nextPutAll: (self chunkEscape: aMethod source); lf;
 		nextPutAll: '!!'
 		nextPutAll: '!!'
 !
 !
@@ -247,7 +247,7 @@ exportMethodsOf: aClass on: aStream
 
 
 	| map |
 	| map |
 	map := Dictionary new.
 	map := Dictionary new.
-	aClass protocolsDo: [:category :methods | 
+	aClass protocolsDo: [:category :methods |
 		(category match: '^\*') ifFalse: [ map at: category put: methods ]].
 		(category match: '^\*') ifFalse: [ map at: category put: methods ]].
 	(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |
 	(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |
 		methods := map at: category.
 		methods := map at: category.
@@ -261,7 +261,7 @@ exportMethodsOf: aClass on: aStream
 exportPackageDefinitionOf: package on: aStream
 exportPackageDefinitionOf: package on: aStream
 	"Chunk format."
 	"Chunk format."
 
 
-	aStream 
+	aStream
 		nextPutAll: 'Smalltalk current createPackage: ''', package name, '''!!';
 		nextPutAll: 'Smalltalk current createPackage: ''', package name, '''!!';
 		lf
 		lf
 !
 !
@@ -278,7 +278,7 @@ exportPackageExtensionsOf: package on: aStream
 	(Package sortedClasses: Smalltalk current classes) do: [:each |
 	(Package sortedClasses: Smalltalk current classes) do: [:each |
 		{each. each class} do: [:aClass |
 		{each. each class} do: [:aClass |
 			map := Dictionary new.
 			map := Dictionary new.
-			aClass protocolsDo: [:category :methods | 
+			aClass protocolsDo: [:category :methods |
 				(category match: '^\*', name) ifTrue: [ map at: category put: methods ]].
 				(category match: '^\*', name) ifTrue: [ map at: category put: methods ]].
 			(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |
 			(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |
 				methods := map at: category.	
 				methods := map at: category.	
@@ -292,23 +292,23 @@ Exporter subclass: #StrippedExporter
 !StrippedExporter methodsFor: 'private'!
 !StrippedExporter methodsFor: 'private'!
 
 
 exportDefinitionOf: aClass on: aStream
 exportDefinitionOf: aClass on: aStream
-	aStream 
-	    nextPutAll: 'smalltalk.addClass(';
-	    nextPutAll: '''', (self classNameFor: aClass), ''', ';
-	    nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);
-	    nextPutAll: ', ['.
-	aClass instanceVariableNames 
-	    do: [:each | aStream nextPutAll: '''', each, '''']
-	    separatedBy: [aStream nextPutAll: ', '].
-	aStream	
-	    nextPutAll: '], ''';
-	    nextPutAll: aClass category, '''';
-	    nextPutAll: ');'.
+	aStream
+		nextPutAll: 'smalltalk.addClass(';
+		nextPutAll: '''', (self classNameFor: aClass), ''', ';
+		nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);
+		nextPutAll: ', ['.
+	aClass instanceVariableNames
+		do: [:each | aStream nextPutAll: '''', each, '''']
+		separatedBy: [aStream nextPutAll: ', '].
+	aStream
+		nextPutAll: '], ''';
+		nextPutAll: aClass category, '''';
+		nextPutAll: ');'.
 	aStream lf
 	aStream lf
 !
 !
 
 
 exportMethod: aMethod of: aClass on: aStream
 exportMethod: aMethod of: aClass on: aStream
-	aStream 
+	aStream
 		nextPutAll: 'smalltalk.addMethod(';lf;
 		nextPutAll: 'smalltalk.addMethod(';lf;
 		nextPutAll: aMethod selector asSelector asJavascript, ',';lf;
 		nextPutAll: aMethod selector asSelector asJavascript, ',';lf;
 		nextPutAll: 'smalltalk.method({';lf;
 		nextPutAll: 'smalltalk.method({';lf;
@@ -327,19 +327,19 @@ Object subclass: #Importer
 !Importer methodsFor: 'fileIn'!
 !Importer methodsFor: 'fileIn'!
 
 
 import: aStream
 import: aStream
-    | chunk result parser lastEmpty |
-    parser := ChunkParser on: aStream.
-    lastEmpty := false.
-    [chunk := parser nextChunk.
-     chunk isNil] whileFalse: [
-        chunk isEmpty
-       		ifTrue: [lastEmpty := true]
-       		ifFalse: [
-        		result := Compiler new evaluateExpression: chunk.
-        		lastEmpty 
-            			ifTrue: [
-                                  	lastEmpty := false.
-                                  	result scanFrom: parser]]]
+	| chunk result parser lastEmpty |
+	parser := ChunkParser on: aStream.
+	lastEmpty := false.
+	[chunk := parser nextChunk.
+	 chunk isNil] whileFalse: [
+		chunk isEmpty
+			ifTrue: [lastEmpty := true]
+			ifFalse: [
+				result := Compiler new evaluateExpression: chunk.
+				lastEmpty
+						ifTrue: [
+									lastEmpty := false.
+									result scanFrom: parser]]]
 ! !
 ! !
 
 
 Object subclass: #PackageLoader
 Object subclass: #PackageLoader
@@ -350,30 +350,30 @@ Object subclass: #PackageLoader
 
 
 initializePackageNamed: packageName prefix: aString
 initializePackageNamed: packageName prefix: aString
 
 
-	(Package named: packageName) 
-    	setupClasses;
-        commitPathJs: '/', aString, '/js';
-        commitPathSt: '/', aString, '/st'
+	(Package named: packageName)
+		setupClasses;
+		commitPathJs: '/', aString, '/js';
+		commitPathSt: '/', aString, '/st'
 !
 !
 
 
 loadPackage: packageName prefix: aString	
 loadPackage: packageName prefix: aString	
 	| url |
 	| url |
-    url := '/', aString, '/js/', packageName, '.js'.
-	jQuery 
+	url := '/', aString, '/js/', packageName, '.js'.
+	jQuery
 		ajax: url
 		ajax: url
-        options: #{
+		options: #{
 			'type' -> 'GET'.
 			'type' -> 'GET'.
 			'dataType' -> 'script'.
 			'dataType' -> 'script'.
-    		'complete' -> [ :jqXHR :textStatus | 
-				jqXHR readyState = 4 
-                	ifTrue: [ self initializePackageNamed: packageName prefix: aString ] ].
-			'error' -> [ window alert: 'Could not load package at:  ', url ]
+			'complete' -> [ :jqXHR :textStatus |
+				jqXHR readyState = 4
+					ifTrue: [ self initializePackageNamed: packageName prefix: aString ] ].
+			'error' -> [ window alert: 'Could not load package at:	', url ]
 		}
 		}
 !
 !
 
 
 loadPackages: aCollection prefix: aString
 loadPackages: aCollection prefix: aString
 	aCollection do: [ :each |
 	aCollection do: [ :each |
-    	self loadPackage: each prefix: aString ]
+		self loadPackage: each prefix: aString ]
 ! !
 ! !
 
 
 !PackageLoader class methodsFor: 'not yet classified'!
 !PackageLoader class methodsFor: 'not yet classified'!

+ 144 - 144
st/Kernel-Classes.st

@@ -3,13 +3,13 @@ Object subclass: #Behavior
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Classes'!
 	package: 'Kernel-Classes'!
 !Behavior commentStamp!
 !Behavior commentStamp!
-Behavior is the superclass of all class objects. 
+Behavior is the superclass of all class objects.
 
 
 It defines the protocol for creating instances of a class with `#basicNew` and `#new` (see `boot.js` for class constructors details).
 It defines the protocol for creating instances of a class with `#basicNew` and `#new` (see `boot.js` for class constructors details).
-Instances know about the subclass/superclass relationships between classes, contain the description that instances are created from, 
+Instances know about the subclass/superclass relationships between classes, contain the description that instances are created from,
 and hold the method dictionary that's associated with each class.
 and hold the method dictionary that's associated with each class.
 
 
-Behavior also  provides methods for compiling methods, examining the method dictionary, and iterating over the class hierarchy.!
+Behavior also provides methods for compiling methods, examining the method dictionary, and iterating over the class hierarchy.!
 
 
 !Behavior methodsFor: 'accessing'!
 !Behavior methodsFor: 'accessing'!
 
 
@@ -17,7 +17,7 @@ allInstanceVariableNames
 	| result |
 	| result |
 	result := self instanceVariableNames copy.
 	result := self instanceVariableNames copy.
 	self superclass ifNotNil: [
 	self superclass ifNotNil: [
-	    result addAll: self superclass allInstanceVariableNames].
+		result addAll: self superclass allInstanceVariableNames].
 	^result
 	^result
 !
 !
 
 
@@ -31,39 +31,39 @@ allSubclasses
 	| result |
 	| result |
 	result := self subclasses.
 	result := self subclasses.
 	self subclasses do: [:each |
 	self subclasses do: [:each |
-	    result addAll: each allSubclasses].
+		result addAll: each allSubclasses].
 	^result
 	^result
 !
 !
 
 
 allSuperclasses
 allSuperclasses
 	
 	
-    self superclass ifNil: [ ^ #() ].
-    
-	^ (OrderedCollection with: self superclass) 
-    	addAll: self superclass allSuperclasses;
-        yourself
+	self superclass ifNil: [ ^ #() ].
+	
+	^ (OrderedCollection with: self superclass)
+		addAll: self superclass allSuperclasses;
+		yourself
 !
 !
 
 
 comment
 comment
-    ^(self basicAt: 'comment') ifNil: ['']
+	^(self basicAt: 'comment') ifNil: ['']
 !
 !
 
 
 comment: aString
 comment: aString
-    self basicAt: 'comment' put: aString.
-    SystemAnnouncer current
-    	announce: (ClassCommentChanged new
-        	theClass: self;
-            yourself)
+	self basicAt: 'comment' put: aString.
+	SystemAnnouncer current
+		announce: (ClassCommentChanged new
+			theClass: self;
+			yourself)
 !
 !
 
 
 commentStamp
 commentStamp
-    ^ClassCommentReader new
+	^ClassCommentReader new
 	class: self;
 	class: self;
 	yourself
 	yourself
 !
 !
 
 
 commentStamp: aStamp prior: prior
 commentStamp: aStamp prior: prior
-        ^self commentStamp
+		^self commentStamp
 !
 !
 
 
 definition
 definition
@@ -79,12 +79,12 @@ lookupSelector: selector
 	Return the corresponding method if found.
 	Return the corresponding method if found.
 	Otherwise chase the superclass chain and try again.
 	Otherwise chase the superclass chain and try again.
 	Return nil if no method is found."
 	Return nil if no method is found."
-    
+	
 	| lookupClass |
 	| lookupClass |
-    
+	
 	lookupClass := self.
 	lookupClass := self.
 	[ lookupClass = nil ] whileFalse: [
 	[ lookupClass = nil ] whileFalse: [
-      	(lookupClass includesSelector: selector)
+		(lookupClass includesSelector: selector)
 				ifTrue: [ ^ lookupClass methodAt: selector ].
 				ifTrue: [ ^ lookupClass methodAt: selector ].
 			lookupClass := lookupClass superclass ].
 			lookupClass := lookupClass superclass ].
 	^ nil
 	^ nil
@@ -111,8 +111,8 @@ methods
 
 
 methodsFor: aString
 methodsFor: aString
 	^ClassCategoryReader new
 	^ClassCategoryReader new
-	    class: self category: aString;
-	    yourself
+		class: self category: aString;
+		yourself
 !
 !
 
 
 methodsFor: aString stamp: aStamp
 methodsFor: aString stamp: aStamp
@@ -133,7 +133,7 @@ organization
 !
 !
 
 
 protocols
 protocols
-   ^ self organization elements sorted
+	^ self organization elements sorted
 !
 !
 
 
 protocolsDo: aBlock
 protocolsDo: aBlock
@@ -144,7 +144,7 @@ protocolsDo: aBlock
 	methodsByCategory := HashedCollection new.
 	methodsByCategory := HashedCollection new.
 	self methodDictionary values do: [:m |
 	self methodDictionary values do: [:m |
 		(methodsByCategory at: m category ifAbsentPut: [Array new])
 		(methodsByCategory at: m category ifAbsentPut: [Array new])
- 			add: m]. 
+			add: m].
 	self protocols do: [:category |
 	self protocols do: [:category |
 		aBlock value: category value: (methodsByCategory at: category)]
 		aBlock value: category value: (methodsByCategory at: category)]
 !
 !
@@ -181,30 +181,30 @@ withAllSubclasses
 
 
 addCompiledMethod: aMethod
 addCompiledMethod: aMethod
 	| oldMethod announcement |
 	| oldMethod announcement |
-    
-	oldMethod := self methodDictionary 
-    	at: aMethod selector 
-        ifAbsent: [ nil ].
-    
-   (self protocols includes: aMethod protocol)
-   		ifFalse: [ self organization addElement: aMethod protocol ].
-   
+	
+	oldMethod := self methodDictionary
+		at: aMethod selector
+		ifAbsent: [ nil ].
+	
+	(self protocols includes: aMethod protocol)
+		ifFalse: [ self organization addElement: aMethod protocol ].
+
 	self basicAddCompiledMethod: aMethod.
 	self basicAddCompiledMethod: aMethod.
-    
-    announcement := oldMethod 
-    	ifNil: [
-		    MethodAdded new
-		            method: aMethod;
-       			    yourself ]
-    	ifNotNil: [
-          	MethodModified new
-                    oldMethod: oldMethod; 
-		            method: aMethod;
-       			    yourself ].
-                    
-                    
+	
+	announcement := oldMethod
+		ifNil: [
+			MethodAdded new
+					method: aMethod;
+					yourself ]
+		ifNotNil: [
+			MethodModified new
+					oldMethod: oldMethod;
+					method: aMethod;
+					yourself ].
+					
+					
 	SystemAnnouncer current
 	SystemAnnouncer current
-		   		announce: announcement
+				announce: announcement
 !
 !
 
 
 compile: aString
 compile: aString
@@ -213,22 +213,22 @@ compile: aString
 
 
 compile: aString category: anotherString
 compile: aString category: anotherString
 	Compiler new
 	Compiler new
-		install: aString 
-        forClass: self 
-        category: anotherString
+		install: aString
+		forClass: self
+		category: anotherString
 !
 !
 
 
 removeCompiledMethod: aMethod
 removeCompiledMethod: aMethod
 	self basicRemoveCompiledMethod: aMethod.
 	self basicRemoveCompiledMethod: aMethod.
-    
-    self methods 
-    	detect: [ :each | each protocol = aMethod protocol ]
-  		ifNone: [ self organization removeElement: aMethod protocol ].
-    
-    SystemAnnouncer current
-   		announce: (MethodRemoved new
-            method: aMethod;
-            yourself)
+	
+	self methods
+		detect: [ :each | each protocol = aMethod protocol ]
+		ifNone: [ self organization removeElement: aMethod protocol ].
+	
+	SystemAnnouncer current
+		announce: (MethodRemoved new
+			method: aMethod;
+			yourself)
 ! !
 ! !
 
 
 !Behavior methodsFor: 'instance creation'!
 !Behavior methodsFor: 'instance creation'!
@@ -249,9 +249,9 @@ basicAddCompiledMethod: aMethod
 
 
 basicRemoveCompiledMethod: aMethod
 basicRemoveCompiledMethod: aMethod
 	<
 	<
-    	smalltalk.removeMethod(aMethod)
+		smalltalk.removeMethod(aMethod)
 		smalltalk.init(self);
 		smalltalk.init(self);
-    >
+	>
 ! !
 ! !
 
 
 !Behavior methodsFor: 'testing'!
 !Behavior methodsFor: 'testing'!
@@ -273,7 +273,7 @@ Behavior subclass: #Class
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Classes'!
 	package: 'Kernel-Classes'!
 !Class commentStamp!
 !Class commentStamp!
-Class is __the__ class object. 
+Class is __the__ class object.
 
 
 Instances are the classes of the system.
 Instances are the classes of the system.
 Class creation is done throught a `ClassBuilder`!
 Class creation is done throught a `ClassBuilder`!
@@ -286,20 +286,20 @@ category
 
 
 definition
 definition
 	^ String streamContents: [ :stream |
 	^ String streamContents: [ :stream |
-		stream 
-	    	nextPutAll: self superclass asString;
-	    	nextPutAll: ' subclass: #';
-	    	nextPutAll: self name;
-	    	nextPutAll: String lf, String tab;
-	    	nextPutAll: 'instanceVariableNames: '''.
-		self instanceVariableNames 
-          	do: [ :each | stream nextPutAll: each ] 
-	    	separatedBy: [ stream nextPutAll: ' ' ].
 		stream
 		stream
-	    	nextPutAll: '''', String lf, String tab;
-	    	nextPutAll: 'package: ''';
-	    	nextPutAll: self category;
-	    	nextPutAll: '''' ]
+			nextPutAll: self superclass asString;
+			nextPutAll: ' subclass: #';
+			nextPutAll: self name;
+			nextPutAll: String lf, String tab;
+			nextPutAll: 'instanceVariableNames: '''.
+		self instanceVariableNames
+			do: [ :each | stream nextPutAll: each ]
+			separatedBy: [ stream nextPutAll: ' ' ].
+		stream
+			nextPutAll: '''', String lf, String tab;
+			nextPutAll: 'package: ''';
+			nextPutAll: self category;
+			nextPutAll: '''' ]
 !
 !
 
 
 package
 package
@@ -334,7 +334,7 @@ subclass: aString instanceVariableNames: aString2 classVariableNames: classVars
 
 
 subclass: aString instanceVariableNames: aString2 package: aString3
 subclass: aString instanceVariableNames: aString2 package: aString3
 	^ClassBuilder new
 	^ClassBuilder new
-	    superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3
+		superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3
 ! !
 ! !
 
 
 !Class methodsFor: 'converting'!
 !Class methodsFor: 'converting'!
@@ -361,20 +361,20 @@ Behavior subclass: #Metaclass
 !Metaclass commentStamp!
 !Metaclass commentStamp!
 Metaclass is the root of the class hierarchy.
 Metaclass is the root of the class hierarchy.
 
 
-Metaclass instances are metaclasses, one for each real class. 
+Metaclass instances are metaclasses, one for each real class.
 Metaclass instances have a single instance, which they hold onto, which is the class that they are the metaclass of.!
 Metaclass instances have a single instance, which they hold onto, which is the class that they are the metaclass of.!
 
 
 !Metaclass methodsFor: 'accessing'!
 !Metaclass methodsFor: 'accessing'!
 
 
 definition
 definition
 	^ String streamContents: [ :stream |
 	^ String streamContents: [ :stream |
-		stream 
-	   	 	nextPutAll: self asString;
-	    	nextPutAll: ' class ';
-	    	nextPutAll: 'instanceVariableNames: '''.
+		stream
+			nextPutAll: self asString;
+			nextPutAll: ' class ';
+			nextPutAll: 'instanceVariableNames: '''.
 		self instanceVariableNames
 		self instanceVariableNames
-	    	do: [ :each | stream nextPutAll: each ]
-	    	separatedBy: [ stream nextPutAll: ' ' ].
+			do: [ :each | stream nextPutAll: each ]
+			separatedBy: [ stream nextPutAll: ' ' ].
 		stream nextPutAll: '''' ]
 		stream nextPutAll: '''' ]
 !
 !
 
 
@@ -384,7 +384,7 @@ instanceClass
 
 
 instanceVariableNames: aCollection
 instanceVariableNames: aCollection
 	ClassBuilder new
 	ClassBuilder new
-	    class: self instanceVariableNames: aCollection
+		class: self instanceVariableNames: aCollection
 !
 !
 
 
 theMetaClass
 theMetaClass
@@ -430,33 +430,33 @@ instanceVariableNamesFor: aString
 !ClassBuilder methodsFor: 'class definition'!
 !ClassBuilder methodsFor: 'class definition'!
 
 
 addSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName
 addSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName
-    | theClass |
-    
-    theClass := Smalltalk current at: aString.
-    
-   	theClass ifNotNil: [ 
-    	theClass superclass == aClass ifFalse: [
-    		^ self 
-        		migrateClassNamed: aString 
-           	 	superclass: aClass 
-           	 	instanceVariableNames: aCollection 
-            	package: packageName ] ].
-
-	^ self 
-    	basicAddSubclassOf: aClass 
-        named: aString 
-        instanceVariableNames: aCollection 
-        package: packageName
+	| theClass |
+	
+	theClass := Smalltalk current at: aString.
+	
+	theClass ifNotNil: [
+		theClass superclass == aClass ifFalse: [
+			^ self
+				migrateClassNamed: aString
+				superclass: aClass
+				instanceVariableNames: aCollection
+				package: packageName ] ].
+
+	^ self
+		basicAddSubclassOf: aClass
+		named: aString
+		instanceVariableNames: aCollection
+		package: packageName
 !
 !
 
 
 class: aClass instanceVariableNames: aString
 class: aClass instanceVariableNames: aString
 	self basicClass: aClass instanceVariableNames: aString.
 	self basicClass: aClass instanceVariableNames: aString.
-    self setupClass: aClass.
-    
-    SystemAnnouncer current
-    	announce: (ClassDefinitionChanged new
-        	theClass: aClass;
-            yourself)
+	self setupClass: aClass.
+	
+	SystemAnnouncer current
+		announce: (ClassDefinitionChanged new
+			theClass: aClass;
+			yourself)
 !
 !
 
 
 superclass: aClass subclass: aString
 superclass: aClass subclass: aString
@@ -466,16 +466,16 @@ superclass: aClass subclass: aString
 superclass: aClass subclass: aString instanceVariableNames: aString2 package: aString3
 superclass: aClass subclass: aString instanceVariableNames: aString2 package: aString3
 	| newClass |
 	| newClass |
 	
 	
-    newClass := self addSubclassOf: aClass
+	newClass := self addSubclassOf: aClass
 		named: aString instanceVariableNames: (self instanceVariableNamesFor: aString2)
 		named: aString instanceVariableNames: (self instanceVariableNamesFor: aString2)
 		package: (aString3 ifNil: ['unclassified']).
 		package: (aString3 ifNil: ['unclassified']).
 	self setupClass: newClass.
 	self setupClass: newClass.
-    
-    SystemAnnouncer current 
-    	announce: (ClassAdded new
-        	theClass: newClass;
-            yourself).
-    
+	
+	SystemAnnouncer current
+		announce: (ClassAdded new
+			theClass: newClass;
+			yourself).
+	
 	^newClass
 	^newClass
 ! !
 ! !
 
 
@@ -483,20 +483,20 @@ superclass: aClass subclass: aString instanceVariableNames: aString2 package: aS
 
 
 migrateClass: aClass superclass: anotherClass
 migrateClass: aClass superclass: anotherClass
 	console log: aClass name.
 	console log: aClass name.
-	self 
-    	migrateClassNamed: aClass name
-        superclass: anotherClass
-        instanceVariableNames: aClass instanceVariableNames
-        package: aClass package name
+	self
+		migrateClassNamed: aClass name
+		superclass: anotherClass
+		instanceVariableNames: aClass instanceVariableNames
+		package: aClass package name
 !
 !
 
 
 migrateClassNamed: aString superclass: aClass instanceVariableNames: aCollection package: packageName
 migrateClassNamed: aString superclass: aClass instanceVariableNames: aCollection package: packageName
 	| oldClass newClass tmp |
 	| oldClass newClass tmp |
-    
-    tmp := 'new*', aString.
-    oldClass := Smalltalk current at: aString.
-    
-    newClass := self 
+	
+	tmp := 'new*', aString.
+	oldClass := Smalltalk current at: aString.
+	
+	newClass := self
 		addSubclassOf: aClass
 		addSubclassOf: aClass
 		named: tmp
 		named: tmp
 		instanceVariableNames: aCollection
 		instanceVariableNames: aCollection
@@ -508,28 +508,28 @@ migrateClassNamed: aString superclass: aClass instanceVariableNames: aCollection
 		on: Error
 		on: Error
 		do: [ :exception |
 		do: [ :exception |
 			self
 			self
-            	basicSwapClassNames: oldClass with: newClass;
-            	basicRemoveClass: newClass.
-            exception signal ].
+				basicSwapClassNames: oldClass with: newClass;
+				basicRemoveClass: newClass.
+			exception signal ].
 
 
 	self
 	self
 		rawRenameClass: oldClass to: tmp;
 		rawRenameClass: oldClass to: tmp;
-        rawRenameClass: newClass to: aString.
+		rawRenameClass: newClass to: aString.
 
 
 	oldClass subclasses do: [ :each |
 	oldClass subclasses do: [ :each |
-    	self migrateClass: each superclass: newClass ].
+		self migrateClass: each superclass: newClass ].
 
 
-    self basicRemoveClass: oldClass.
+	self basicRemoveClass: oldClass.
 	^newClass
 	^newClass
 !
 !
 
 
 renameClass: aClass to: aString
 renameClass: aClass to: aString
 	self basicRenameClass: aClass to: aString.
 	self basicRenameClass: aClass to: aString.
-    
-    SystemAnnouncer current
-    	announce: (ClassRenamed new
-        	theClass: aClass;
-            yourself)
+	
+	SystemAnnouncer current
+		announce: (ClassRenamed new
+			theClass: aClass;
+			yourself)
 ! !
 ! !
 
 
 !ClassBuilder methodsFor: 'copying'!
 !ClassBuilder methodsFor: 'copying'!
@@ -537,14 +537,14 @@ renameClass: aClass to: aString
 copyClass: aClass named: aString
 copyClass: aClass named: aString
 	| newClass |
 	| newClass |
 
 
-	newClass := self 
+	newClass := self
 		addSubclassOf: aClass superclass
 		addSubclassOf: aClass superclass
-		named: aString 
-		instanceVariableNames: aClass instanceVariableNames 
+		named: aString
+		instanceVariableNames: aClass instanceVariableNames
 		package: aClass package name.
 		package: aClass package name.
 
 
 	self copyClass: aClass to: newClass.
 	self copyClass: aClass to: newClass.
-    
+	
 	^newClass
 	^newClass
 !
 !
 
 
@@ -568,7 +568,7 @@ copyClass: aClass to: anotherClass
 installMethod: aCompiledMethod forClass: aBehavior category: aString
 installMethod: aCompiledMethod forClass: aBehavior category: aString
 	aCompiledMethod category: aString.
 	aCompiledMethod category: aString.
 	aBehavior addCompiledMethod: aCompiledMethod.
 	aBehavior addCompiledMethod: aCompiledMethod.
-    self setupClass: aBehavior.
+	self setupClass: aBehavior.
 	^aCompiledMethod
 	^aCompiledMethod
 ! !
 ! !
 
 
@@ -607,7 +607,7 @@ basicSwapClassNames: aClass with: anotherClass
 	<
 	<
 		var tmp = aClass.className;
 		var tmp = aClass.className;
 		aClass.className = anotherClass.className;
 		aClass.className = anotherClass.className;
-        anotherClass.className = tmp;
+		anotherClass.className = tmp;
 	>
 	>
 !
 !
 
 
@@ -642,7 +642,7 @@ scanFrom: aChunkParser
 	| chunk |
 	| chunk |
 	[chunk := aChunkParser nextChunk.
 	[chunk := aChunkParser nextChunk.
 	chunk isEmpty] whileFalse: [
 	chunk isEmpty] whileFalse: [
-	    self compileMethod: chunk].
+		self compileMethod: chunk].
 	ClassBuilder new setupClass: class
 	ClassBuilder new setupClass: class
 ! !
 ! !
 
 
@@ -677,7 +677,7 @@ scanFrom: aChunkParser
 	| chunk |
 	| chunk |
 	chunk := aChunkParser nextChunk.
 	chunk := aChunkParser nextChunk.
 	chunk isEmpty ifFalse: [
 	chunk isEmpty ifFalse: [
-	    self setComment: chunk].
+		self setComment: chunk].
 ! !
 ! !
 
 
 !ClassCommentReader methodsFor: 'initialization'!
 !ClassCommentReader methodsFor: 'initialization'!
@@ -689,7 +689,7 @@ initialize
 !ClassCommentReader methodsFor: 'private'!
 !ClassCommentReader methodsFor: 'private'!
 
 
 setComment: aString
 setComment: aString
-    class comment: aString
+	class comment: aString
 ! !
 ! !
 
 
 Object subclass: #ClassSorterNode
 Object subclass: #ClassSorterNode

+ 99 - 99
st/Kernel-Collections.st

@@ -29,7 +29,7 @@ value: aValue
 
 
 = anAssociation
 = anAssociation
 	^self class = anAssociation class and: [
 	^self class = anAssociation class and: [
-	    self key = anAssociation key and: [
+		self key = anAssociation key and: [
 		self value = anAssociation value]]
 		self value = anAssociation value]]
 ! !
 ! !
 
 
@@ -52,7 +52,7 @@ storeOn: aStream
 !Association class methodsFor: 'instance creation'!
 !Association class methodsFor: 'instance creation'!
 
 
 key: aKey value: aValue
 key: aKey value: aValue
-	    ^self new
+		^self new
 		key: aKey;
 		key: aKey;
 		value: aValue;
 		value: aValue;
 		yourself
 		yourself
@@ -68,7 +68,7 @@ I provide a set of useful methods to the Collectiohn hierarchy such as enumerati
 
 
 !Collection methodsFor: 'accessing'!
 !Collection methodsFor: 'accessing'!
 
 
-occurrencesOf: anObject 
+occurrencesOf: anObject
 	"Answer how many of the receiver's elements are equal to anObject."
 	"Answer how many of the receiver's elements are equal to anObject."
 
 
 	| tally |
 	| tally |
@@ -105,16 +105,16 @@ add: anObject
 
 
 addAll: aCollection
 addAll: aCollection
 	aCollection do: [:each |
 	aCollection do: [:each |
-	    self add: each].
+		self add: each].
 	^aCollection
 	^aCollection
 !
 !
 
 
 remove: anObject
 remove: anObject
-    ^self remove: anObject ifAbsent: [self errorNotFound]
+	^self remove: anObject ifAbsent: [self errorNotFound]
 !
 !
 
 
 remove: anObject ifAbsent: aBlock
 remove: anObject ifAbsent: aBlock
-    self subclassResponsibility
+	self subclassResponsibility
 ! !
 ! !
 
 
 !Collection methodsFor: 'converting'!
 !Collection methodsFor: 'converting'!
@@ -138,9 +138,9 @@ asSet
 !Collection methodsFor: 'copying'!
 !Collection methodsFor: 'copying'!
 
 
 , aCollection
 , aCollection
-	^self copy 
-	    addAll: aCollection; 
-	    yourself
+	^self copy
+		addAll: aCollection;
+		yourself
 !
 !
 
 
 copyWith: anObject
 copyWith: anObject
@@ -152,7 +152,7 @@ copyWithAll: aCollection
 !
 !
 
 
 copyWithoutAll: aCollection
 copyWithoutAll: aCollection
-	"Answer a copy of the receiver that does not contain any elements 
+	"Answer a copy of the receiver that does not contain any elements
 	equal to those in aCollection."
 	equal to those in aCollection."
 
 
 	^ self reject: [:each | aCollection includes: each]
 	^ self reject: [:each | aCollection includes: each]
@@ -184,15 +184,15 @@ do: aBlock separatedBy: anotherBlock
 	| actionBeforeElement |
 	| actionBeforeElement |
 	actionBeforeElement := [actionBeforeElement := anotherBlock].
 	actionBeforeElement := [actionBeforeElement := anotherBlock].
 	self do: [:each |
 	self do: [:each |
-    	actionBeforeElement value.
-	    aBlock value: each]
+		actionBeforeElement value.
+		aBlock value: each]
 !
 !
 
 
 inject: anObject into: aBlock
 inject: anObject into: aBlock
 	| result |
 	| result |
 	result := anObject.
 	result := anObject.
-	self do: [:each | 
-	    result := aBlock value: result value: each].
+	self do: [:each |
+		result := aBlock value: result value: each].
 	^result
 	^result
 !
 !
 
 
@@ -206,7 +206,7 @@ intersection: aCollection
 	
 	
 	aCollection do: [ :each |
 	aCollection do: [ :each |
 		((set includes: each) and: [(outputSet includes: each) not])
 		((set includes: each) and: [(outputSet includes: each) not])
-			ifTrue: [ 
+			ifTrue: [
 				outputSet add: each]].
 				outputSet add: each]].
 		
 		
 	^ self class withAll: outputSet asArray
 	^ self class withAll: outputSet asArray
@@ -220,7 +220,7 @@ select: aBlock
 	| stream |
 	| stream |
 	stream := self class new writeStream.
 	stream := self class new writeStream.
 	self do: [:each |
 	self do: [:each |
-	    (aBlock value: each) ifTrue: [
+		(aBlock value: each) ifTrue: [
 		stream nextPut: each]].
 		stream nextPut: each]].
 	^stream contents
 	^stream contents
 ! !
 ! !
@@ -246,9 +246,9 @@ printString
 !Collection methodsFor: 'testing'!
 !Collection methodsFor: 'testing'!
 
 
 ifEmpty: aBlock
 ifEmpty: aBlock
-	"Evaluate the given block with the receiver as argument, answering its value if the receiver is empty, otherwise answer the receiver. Note that the fact that this method returns its argument in case the receiver is not empty allows one to write expressions like the following ones: self classifyMethodAs: 
+	"Evaluate the given block with the receiver as argument, answering its value if the receiver is empty, otherwise answer the receiver. Note that the fact that this method returns its argument in case the receiver is not empty allows one to write expressions like the following ones: self classifyMethodAs:
 		(myProtocol ifEmpty: ['As yet unclassified'])"
 		(myProtocol ifEmpty: ['As yet unclassified'])"
-	^ self isEmpty 
+	^ self isEmpty
 		ifTrue: [ aBlock value ]
 		ifTrue: [ aBlock value ]
 		ifFalse: [ self ]
 		ifFalse: [ self ]
 !
 !
@@ -259,8 +259,8 @@ ifNotEmpty: aBlock
 
 
 includes: anObject
 includes: anObject
 	| sentinel |
 	| sentinel |
-    sentinel := Object new.
-    ^(self detect: [ :each | each = anObject] ifNone: [ sentinel ]) ~= sentinel
+	sentinel := Object new.
+	^(self detect: [ :each | each = anObject] ifNone: [ sentinel ]) ~= sentinel
 !
 !
 
 
 isEmpty
 isEmpty
@@ -274,7 +274,7 @@ notEmpty
 !Collection class methodsFor: 'accessing'!
 !Collection class methodsFor: 'accessing'!
 
 
 streamClass
 streamClass
-	    ^Stream
+		^Stream
 ! !
 ! !
 
 
 !Collection class methodsFor: 'instance creation'!
 !Collection class methodsFor: 'instance creation'!
@@ -284,20 +284,20 @@ new: anInteger
 !
 !
 
 
 with: anObject
 with: anObject
-	    ^self new
+		^self new
 		add: anObject;
 		add: anObject;
 		yourself
 		yourself
 !
 !
 
 
 with: anObject with: anotherObject
 with: anObject with: anotherObject
-	    ^self new
+		^self new
 		add: anObject;
 		add: anObject;
 		add: anotherObject;
 		add: anotherObject;
 		yourself
 		yourself
 !
 !
 
 
 with: firstObject with: secondObject with: thirdObject
 with: firstObject with: secondObject with: thirdObject
-	    ^self new
+		^self new
 		add: firstObject;
 		add: firstObject;
 		add: secondObject;
 		add: secondObject;
 		add: thirdObject;
 		add: thirdObject;
@@ -305,7 +305,7 @@ with: firstObject with: secondObject with: thirdObject
 !
 !
 
 
 withAll: aCollection
 withAll: aCollection
-	    ^self new
+		^self new
 		addAll: aCollection;
 		addAll: aCollection;
 		yourself
 		yourself
 ! !
 ! !
@@ -323,31 +323,31 @@ it is an IndexableCollection.!
 !IndexableCollection methodsFor: 'accessing'!
 !IndexableCollection methodsFor: 'accessing'!
 
 
 at: anIndex
 at: anIndex
-	"Lookup the given index in the receiver. 
-	If it is present, answer the value stored at anIndex. 
+	"Lookup the given index in the receiver.
+	If it is present, answer the value stored at anIndex.
 	Otherwise, raise an error."
 	Otherwise, raise an error."
 
 
 	^self at: anIndex ifAbsent: [ self errorNotFound ]
 	^self at: anIndex ifAbsent: [ self errorNotFound ]
 !
 !
 
 
 at: anIndex ifAbsent: aBlock
 at: anIndex ifAbsent: aBlock
-	"Lookup the given index in the receiver. 
-	If it is present, answer the value stored at anIndex. 
+	"Lookup the given index in the receiver.
+	If it is present, answer the value stored at anIndex.
 	Otherwise, answer the value of aBlock."
 	Otherwise, answer the value of aBlock."
 
 
 	self subclassReponsibility
 	self subclassReponsibility
 !
 !
 
 
 at: anIndex ifPresent: aBlock
 at: anIndex ifPresent: aBlock
-	"Lookup the given index in the receiver. 
-	If it is present, answer the value of evaluating aBlock with the value stored at anIndex. 
+	"Lookup the given index in the receiver.
+	If it is present, answer the value of evaluating aBlock with the value stored at anIndex.
 	Otherwise, answer nil."
 	Otherwise, answer nil."
 
 
 	^self at: anIndex ifPresent: aBlock ifAbsent: [ nil ]
 	^self at: anIndex ifPresent: aBlock ifAbsent: [ nil ]
 !
 !
 
 
 at: anIndex ifPresent: aBlock ifAbsent: anotherBlock
 at: anIndex ifPresent: aBlock ifAbsent: anotherBlock
-	"Lookup the given index in the receiver. 
+	"Lookup the given index in the receiver.
 	If it is present, answer the value of evaluating aBlock with the value stored at anIndex.
 	If it is present, answer the value of evaluating aBlock with the value stored at anIndex.
 	Otherwise, answer the value of anotherBlock."
 	Otherwise, answer the value of anotherBlock."
 
 
@@ -404,7 +404,7 @@ Unlike a `Dictionary`, it can only have strings as keys.!
 associations
 associations
 	| associations |
 	| associations |
 	associations := #().
 	associations := #().
-	self associationsDo: [:each |  associations add: each].
+	self associationsDo: [:each | associations add: each].
 	^associations
 	^associations
 !
 !
 
 
@@ -416,12 +416,12 @@ at: aKey ifAbsent: aBlock
 
 
 at: aKey ifAbsentPut: aBlock
 at: aKey ifAbsentPut: aBlock
 	^self at: aKey ifAbsent: [
 	^self at: aKey ifAbsent: [
-	    self at: aKey put: aBlock value]
+		self at: aKey put: aBlock value]
 !
 !
 
 
 at: aKey ifPresent: aBlock ifAbsent: anotherBlock
 at: aKey ifPresent: aBlock ifAbsent: anotherBlock
-	"Lookup the given key in the receiver. 
-	If it is present, answer the value of evaluating the oneArgBlock with the value associated with the key, 
+	"Lookup the given key in the receiver.
+	If it is present, answer the value of evaluating the oneArgBlock with the value associated with the key,
 	otherwise answer the value of absentBlock."
 	otherwise answer the value of absentBlock."
 	^(self includesKey: aKey)
 	^(self includesKey: aKey)
 		ifTrue: [ aBlock value: (self at: aKey) ]
 		ifTrue: [ aBlock value: (self at: aKey) ]
@@ -470,15 +470,15 @@ addAll: aHashedCollection
 !
 !
 
 
 remove: aKey ifAbsent: aBlock
 remove: aKey ifAbsent: aBlock
-    ^self removeKey: aKey ifAbsent: aBlock
+	^self removeKey: aKey ifAbsent: aBlock
 !
 !
 
 
 removeKey: aKey
 removeKey: aKey
-    ^self remove: aKey
+	^self remove: aKey
 !
 !
 
 
 removeKey: aKey ifAbsent: aBlock
 removeKey: aKey ifAbsent: aBlock
-	^(self includesKey: aKey) 
+	^(self includesKey: aKey)
 		ifFalse: [aBlock value]
 		ifFalse: [aBlock value]
 		ifTrue: [self basicDelete: aKey]
 		ifTrue: [self basicDelete: aKey]
 ! !
 ! !
@@ -515,7 +515,7 @@ deepCopy
 	| copy |
 	| copy |
 	copy := self class new.
 	copy := self class new.
 	self keysAndValuesDo: [:key :value |
 	self keysAndValuesDo: [:key :value |
-	    copy at: key  put: value deepCopy].
+		copy at: key put: value deepCopy].
 	^copy
 	^copy
 !
 !
 
 
@@ -523,7 +523,7 @@ shallowCopy
 	| copy |
 	| copy |
 	copy := self class new.
 	copy := self class new.
 	self keysAndValuesDo: [:key :value |
 	self keysAndValuesDo: [:key :value |
-	    copy at: key  put: value].
+		copy at: key put: value].
 	^copy
 	^copy
 ! !
 ! !
 
 
@@ -531,14 +531,14 @@ shallowCopy
 
 
 associationsDo: aBlock
 associationsDo: aBlock
 	self keysAndValuesDo: [:key :value |
 	self keysAndValuesDo: [:key :value |
-	    aBlock value: (Association key: key value: value)]
+		aBlock value: (Association key: key value: value)]
 !
 !
 
 
 collect: aBlock
 collect: aBlock
 	| newDict |
 	| newDict |
 	newDict := self class new.
 	newDict := self class new.
 	self keysAndValuesDo: [:key :value |
 	self keysAndValuesDo: [:key :value |
-	    newDict at: key put: (aBlock value: value)].
+		newDict at: key put: (aBlock value: value)].
 	^newDict
 	^newDict
 !
 !
 
 
@@ -556,7 +556,7 @@ includes: anObject
 
 
 keysAndValuesDo: aBlock
 keysAndValuesDo: aBlock
 	self keysDo: [:each |
 	self keysDo: [:each |
-	    aBlock value: each value: (self at: each)]
+		aBlock value: each value: (self at: each)]
 !
 !
 
 
 keysDo: aBlock
 keysDo: aBlock
@@ -567,7 +567,7 @@ select: aBlock
 	| newDict |
 	| newDict |
 	newDict := self class new.
 	newDict := self class new.
 	self keysAndValuesDo: [:key :value |
 	self keysAndValuesDo: [:key :value |
-	    (aBlock value: value) ifTrue: [newDict at: key put: value]].
+		(aBlock value: value) ifTrue: [newDict at: key put: value]].
 	^newDict
 	^newDict
 !
 !
 
 
@@ -618,8 +618,8 @@ HashedCollection subclass: #Dictionary
 	instanceVariableNames: 'keys values'
 	instanceVariableNames: 'keys values'
 	package: 'Kernel-Collections'!
 	package: 'Kernel-Collections'!
 !Dictionary commentStamp!
 !Dictionary commentStamp!
-I represent a set of elements that can be viewed from one of two perspectives: a set of associations, 
-or a container of values that are externally named where the name can be any object that responds to `=`. 
+I represent a set of elements that can be viewed from one of two perspectives: a set of associations,
+or a container of values that are externally named where the name can be any object that responds to `=`.
 
 
 The external name is referred to as the key.!
 The external name is referred to as the key.!
 
 
@@ -648,8 +648,8 @@ at: aKey put: aValue
 indexOf: anObject ifAbsent: aBlock
 indexOf: anObject ifAbsent: aBlock
 
 
 	| index |
 	| index |
-    index := values indexOf: anObject ifAbsent: [0].
-    ^ index = 0 ifTrue: [ aBlock value ] ifFalse: [ keys at: index ]
+	index := values indexOf: anObject ifAbsent: [0].
+	^ index = 0 ifTrue: [ aBlock value ] ifFalse: [ keys at: index ]
 !
 !
 
 
 keys
 keys
@@ -776,7 +776,7 @@ indexOf: anObject ifAbsent: aBlock
 
 
 indexOf: anObject startingAt: start
 indexOf: anObject startingAt: start
 	"Answer the index of the first occurence of anElement after start
 	"Answer the index of the first occurence of anElement after start
-	within the receiver. If the receiver does not contain anElement, 
+	within the receiver. If the receiver does not contain anElement,
 	answer 0."
 	answer 0."
 	^self indexOf: anObject startingAt: start ifAbsent: [0]
 	^self indexOf: anObject startingAt: start ifAbsent: [0]
 !
 !
@@ -818,7 +818,7 @@ removeLast
 	(self class = aCollection class and: [
 	(self class = aCollection class and: [
 		self size = aCollection size]) ifFalse: [^false].
 		self size = aCollection size]) ifFalse: [^false].
 	self withIndexDo: [:each :i |
 	self withIndexDo: [:each :i |
-                 (aCollection at: i) = each ifFalse: [^false]].
+				 (aCollection at: i) = each ifFalse: [^false]].
 	^true
 	^true
 ! !
 ! !
 
 
@@ -835,14 +835,14 @@ copyFrom: anIndex to: anotherIndex
 	range := anIndex to: anotherIndex.
 	range := anIndex to: anotherIndex.
 	newCollection := self class new: range size.
 	newCollection := self class new: range size.
 	range withIndexDo: [:each :i |
 	range withIndexDo: [:each :i |
-	    newCollection at: i put: (self at: each)].
+		newCollection at: i put: (self at: each)].
 	^newCollection
 	^newCollection
 !
 !
 
 
 deepCopy
 deepCopy
 	| newCollection |
 	| newCollection |
 	newCollection := self class new: self size.
 	newCollection := self class new: self size.
-	self withIndexDo: [:each :index | 
+	self withIndexDo: [:each :index |
 		newCollection at: index put: each deepCopy].
 		newCollection at: index put: each deepCopy].
 	^newCollection
 	^newCollection
 !
 !
@@ -850,7 +850,7 @@ deepCopy
 shallowCopy
 shallowCopy
 	| newCollection |
 	| newCollection |
 	newCollection := self class new: self size.
 	newCollection := self class new: self size.
-	self withIndexDo: [ :each :index | 
+	self withIndexDo: [ :each :index |
 		newCollection at: index put: each].
 		newCollection at: index put: each].
 	^newCollection
 	^newCollection
 ! !
 ! !
@@ -922,7 +922,7 @@ remove: anObject ifAbsent: aBlock
 				return self;
 				return self;
 			}
 			}
 		};
 		};
-        aBlock._value();
+		aBlock._value();
 	>
 	>
 !
 !
 
 
@@ -933,7 +933,7 @@ removeFrom: aNumber to: anotherNumber
 !Array methodsFor: 'converting'!
 !Array methodsFor: 'converting'!
 
 
 asJavascript
 asJavascript
-	^'[', ((self collect: [:each | each asJavascript]) join: ', '),  ']'
+	^'[', ((self collect: [:each | each asJavascript]) join: ', '),	 ']'
 !
 !
 
 
 reversed
 reversed
@@ -947,7 +947,7 @@ join: aString
 !
 !
 
 
 sort
 sort
-    ^self basicPerform: 'sort'
+	^self basicPerform: 'sort'
 !
 !
 
 
 sort: aBlock
 sort: aBlock
@@ -973,20 +973,20 @@ new: anInteger
 !
 !
 
 
 with: anObject
 with: anObject
-	    ^(self new: 1)
+		^(self new: 1)
 		at: 1 put: anObject;
 		at: 1 put: anObject;
 		yourself
 		yourself
 !
 !
 
 
 with: anObject with: anObject2
 with: anObject with: anObject2
-	    ^(self new: 2)
+		^(self new: 2)
 		at: 1 put: anObject;
 		at: 1 put: anObject;
 		at: 2 put: anObject2;
 		at: 2 put: anObject2;
 		yourself
 		yourself
 !
 !
 
 
 with: anObject with: anObject2 with: anObject3
 with: anObject with: anObject2 with: anObject3
-	    ^(self new: 3)
+		^(self new: 3)
 		at: 1 put: anObject;
 		at: 1 put: anObject;
 		at: 2 put: anObject2;
 		at: 2 put: anObject2;
 		at: 3 put: anObject3;
 		at: 3 put: anObject3;
@@ -997,7 +997,7 @@ withAll: aCollection
 	| instance index |
 	| instance index |
 	index := 1.
 	index := 1.
 	instance := self new: aCollection size.
 	instance := self new: aCollection size.
-	aCollection do: [:each  |
+	aCollection do: [:each	|
 		instance at: index put: each.
 		instance at: index put: each.
 		index := index + 1].
 		index := index + 1].
 	^instance
 	^instance
@@ -1114,11 +1114,11 @@ unescaped
 
 
 = aString
 = aString
 	<
 	<
-    	if(!! aString._isString || !! aString._isString()) {
-        	return false;
-        }
-    	return String(self) === String(aString)
-    >
+		if(!! aString._isString || !! aString._isString()) {
+			return false;
+		}
+		return String(self) === String(aString)
+	>
 !
 !
 
 
 == aString
 == aString
@@ -1233,7 +1233,7 @@ match: aRegexp
 !
 !
 
 
 matchesOf: aRegularExpression
 matchesOf: aRegularExpression
-      <return self.match(aRegularExpression)>
+	<return self.match(aRegularExpression)>
 !
 !
 
 
 replace: aString with: anotherString
 replace: aString with: anotherString
@@ -1273,10 +1273,10 @@ trimRight: separators
 
 
 !String methodsFor: 'split join'!
 !String methodsFor: 'split join'!
 
 
-join: aCollection 
+join: aCollection
 	^ String
 	^ String
 		streamContents: [:stream | aCollection
 		streamContents: [:stream | aCollection
-				do: [:each | stream nextPutAll: each asString] 
+				do: [:each | stream nextPutAll: each asString]
 				separatedBy: [stream nextPutAll: self]]
 				separatedBy: [stream nextPutAll: self]]
 !
 !
 
 
@@ -1371,7 +1371,7 @@ space
 !
 !
 
 
 streamClass
 streamClass
-	    ^StringStream
+		^StringStream
 !
 !
 
 
 tab
 tab
@@ -1385,7 +1385,7 @@ fromCharCode: anInteger
 !
 !
 
 
 fromString: aString
 fromString: aString
-	    <return new self.fn(aString)>
+		<return new self.fn(aString)>
 !
 !
 
 
 streamContents: blockWithArg
 streamContents: blockWithArg
@@ -1404,7 +1404,7 @@ CharacterArray subclass: #Symbol
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Collections'!
 	package: 'Kernel-Collections'!
 !Symbol commentStamp!
 !Symbol commentStamp!
-I represent Strings that are created uniquely. 
+I represent Strings that are created uniquely.
 Symbols are unique through the system.
 Symbols are unique through the system.
 
 
 Thus, someString asSymbol == someString asSymbol.!
 Thus, someString asSymbol == someString asSymbol.!
@@ -1506,7 +1506,7 @@ withIndexDo: aBlock
 
 
 !Symbol methodsFor: 'evaluating'!
 !Symbol methodsFor: 'evaluating'!
 
 
-value: anObject 
+value: anObject
 	^anObject perform: self
 	^anObject perform: self
 ! !
 ! !
 
 
@@ -1569,7 +1569,7 @@ remove: anObject
 
 
 = aCollection
 = aCollection
 	self class = aCollection class ifFalse: [ ^ false ].
 	self class = aCollection class ifFalse: [ ^ false ].
-    self size = aCollection size ifFalse: [ ^ false ].
+	self size = aCollection size ifFalse: [ ^ false ].
 	self do: [:each | (aCollection includes: each) ifFalse: [ ^ false ] ].
 	self do: [:each | (aCollection includes: each) ifFalse: [ ^ false ] ].
 	^ true
 	^ true
 ! !
 ! !
@@ -1596,7 +1596,7 @@ do: aBlock
 
 
 select: aBlock
 select: aBlock
 	| collection |
 	| collection |
-	collection := self class new. 
+	collection := self class new.
 	self do: [:each |
 	self do: [:each |
 		(aBlock value: each) ifTrue: [
 		(aBlock value: each) ifTrue: [
 			collection add: each]].
 			collection add: each]].
@@ -1637,7 +1637,7 @@ back: anObject
 !
 !
 
 
 front
 front
-    ^self frontIfAbsent: [ self error: 'Cannot read from empty Queue.' ]
+	^self frontIfAbsent: [ self error: 'Cannot read from empty Queue.' ]
 !
 !
 
 
 frontIfAbsent: aBlock
 frontIfAbsent: aBlock
@@ -1646,13 +1646,13 @@ frontIfAbsent: aBlock
 		write isEmpty ifTrue: [
 		write isEmpty ifTrue: [
 			readIndex > 1 ifTrue: [ read := #(). readIndex := 1 ].
 			readIndex > 1 ifTrue: [ read := #(). readIndex := 1 ].
 			^aBlock value ].
 			^aBlock value ].
-    	read := write.
-    	readIndex := 1.
-    	write := OrderedCollection new.
-    	read first ].
-    read at: readIndex put: nil.
-    readIndex := readIndex + 1.
-    ^result
+		read := write.
+		readIndex := 1.
+		write := OrderedCollection new.
+		read first ].
+	read at: readIndex put: nil.
+	readIndex := readIndex + 1.
+	^result
 ! !
 ! !
 
 
 !Queue methodsFor: 'initialization'!
 !Queue methodsFor: 'initialization'!
@@ -1660,8 +1660,8 @@ frontIfAbsent: aBlock
 initialize
 initialize
 	super initialize.
 	super initialize.
 	read := OrderedCollection new.
 	read := OrderedCollection new.
-    write := OrderedCollection new.
-    readIndex := 1
+	write := OrderedCollection new.
+	readIndex := 1
 ! !
 ! !
 
 
 Object subclass: #RegularExpression
 Object subclass: #RegularExpression
@@ -1687,7 +1687,7 @@ test: aString
 !RegularExpression class methodsFor: 'instance creation'!
 !RegularExpression class methodsFor: 'instance creation'!
 
 
 fromString: aString
 fromString: aString
-	    ^self fromString: aString flag: ''
+		^self fromString: aString flag: ''
 !
 !
 
 
 fromString: aString flag: anotherString
 fromString: aString flag: anotherString
@@ -1709,8 +1709,8 @@ collection
 
 
 contents
 contents
 	^self collection
 	^self collection
-	    copyFrom: 1 
-	    to: self streamSize
+		copyFrom: 1
+		to: self streamSize
 !
 !
 
 
 position
 position
@@ -1773,10 +1773,10 @@ skip: anInteger
 !Stream methodsFor: 'reading'!
 !Stream methodsFor: 'reading'!
 
 
 next
 next
-	^self atEnd 
+	^self atEnd
 		ifTrue: [nil]
 		ifTrue: [nil]
 		ifFalse: [
 		ifFalse: [
-			self position: self position + 1. 
+			self position: self position + 1.
 			collection at: self position]
 			collection at: self position]
 !
 !
 
 
@@ -1784,14 +1784,14 @@ next: anInteger
 	| tempCollection |
 	| tempCollection |
 	tempCollection := self collection class new.
 	tempCollection := self collection class new.
 	anInteger timesRepeat: [
 	anInteger timesRepeat: [
-	    self atEnd ifFalse: [
+		self atEnd ifFalse: [
 		tempCollection add: self next]].
 		tempCollection add: self next]].
 	^tempCollection
 	^tempCollection
 !
 !
 
 
 peek
 peek
 	^self atEnd ifFalse: [
 	^self atEnd ifFalse: [
-	    self collection at: self position + 1]
+		self collection at: self position + 1]
 ! !
 ! !
 
 
 !Stream methodsFor: 'testing'!
 !Stream methodsFor: 'testing'!
@@ -1818,13 +1818,13 @@ nextPut: anObject
 
 
 nextPutAll: aCollection
 nextPutAll: aCollection
 	aCollection do: [:each |
 	aCollection do: [:each |
-	    self nextPut: each]
+		self nextPut: each]
 ! !
 ! !
 
 
 !Stream class methodsFor: 'instance creation'!
 !Stream class methodsFor: 'instance creation'!
 
 
 on: aCollection
 on: aCollection
-	    ^self new 
+		^self new
 		setCollection: aCollection;
 		setCollection: aCollection;
 		setStreamSize: aCollection size;
 		setStreamSize: aCollection size;
 		yourself
 		yourself
@@ -1842,7 +1842,7 @@ next: anInteger
 	| tempCollection |
 	| tempCollection |
 	tempCollection := self collection class new.
 	tempCollection := self collection class new.
 	anInteger timesRepeat: [
 	anInteger timesRepeat: [
-	    self atEnd ifFalse: [
+		self atEnd ifFalse: [
 		tempCollection := tempCollection, self next]].
 		tempCollection := tempCollection, self next]].
 	^tempCollection
 	^tempCollection
 ! !
 ! !
@@ -1866,10 +1866,10 @@ nextPut: aString
 !
 !
 
 
 nextPutAll: aString
 nextPutAll: aString
-	self setCollection: 
-	    (self collection copyFrom: 1 to: self position),
-	    aString,
-	    (self collection copyFrom: (self position + 1 + aString size) to: self collection size).
+	self setCollection:
+		(self collection copyFrom: 1 to: self position),
+		aString,
+		(self collection copyFrom: (self position + 1 + aString size) to: self collection size).
 	self position: self position + aString size.
 	self position: self position + aString size.
 	self setStreamSize: (self streamSize max: self position)
 	self setStreamSize: (self streamSize max: self position)
 !
 !

+ 13 - 13
st/Kernel-Exceptions.st

@@ -5,10 +5,10 @@ Object subclass: #Error
 !Error commentStamp!
 !Error commentStamp!
 From the ANSI standard:
 From the ANSI standard:
 
 
-This protocol describes the behavior of instances of class `Error`. 
-These are used to represent error conditions that prevent the normal continuation of processing. 
+This protocol describes the behavior of instances of class `Error`.
+These are used to represent error conditions that prevent the normal continuation of processing.
 Actual error exceptions used by an application may be subclasses of this class.
 Actual error exceptions used by an application may be subclasses of this class.
-As `Error` is explicitly specified  to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.!
+As `Error` is explicitly specified	to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.!
 
 
 !Error methodsFor: 'accessing'!
 !Error methodsFor: 'accessing'!
 
 
@@ -58,7 +58,7 @@ signal
 !
 !
 
 
 signal: aString
 signal: aString
-	    ^self new
+		^self new
 		signal: aString
 		signal: aString
 ! !
 ! !
 
 
@@ -73,9 +73,9 @@ See `boot.js` `inContext()` and `BlockClosure >> on:do:`!
 
 
 context: aMethodContext
 context: aMethodContext
 	"Set the context from the outside.
 	"Set the context from the outside.
-    See boot.js `inContext()` exception handling"
-    
-    <self.context = aMethodContext>
+	See boot.js `inContext()` exception handling"
+	
+	<self.context = aMethodContext>
 !
 !
 
 
 exception
 exception
@@ -94,15 +94,15 @@ messageText
 
 
 on: anException
 on: anException
 	^ self new
 	^ self new
-    	exception: anException;
-        yourself
+		exception: anException;
+		yourself
 !
 !
 
 
 on: anException context: aMethodContext
 on: anException context: aMethodContext
 	^ self new
 	^ self new
-    	exception: anException;
-        context: aMethodContext;
-        yourself
+		exception: anException;
+		context: aMethodContext;
+		yourself
 ! !
 ! !
 
 
 Error subclass: #MessageNotUnderstood
 Error subclass: #MessageNotUnderstood
@@ -153,7 +153,7 @@ Object subclass: #ErrorHandler
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Exceptions'!
 	package: 'Kernel-Exceptions'!
 !ErrorHandler commentStamp!
 !ErrorHandler commentStamp!
-ErrorHandler is used to manage Smalltalk errors. 
+ErrorHandler is used to manage Smalltalk errors.
 See `boot.js` `handleError()` function.
 See `boot.js` `handleError()` function.
 
 
 Subclasses of `ErrorHandler` can register themselves as the current handler with
 Subclasses of `ErrorHandler` can register themselves as the current handler with

+ 86 - 86
st/Kernel-Methods.st

@@ -48,16 +48,16 @@ asCompiledMethod: aString
 
 
 currySelf
 currySelf
 	"Transforms [ :selfarg :x :y | stcode ] block
 	"Transforms [ :selfarg :x :y | stcode ] block
-    which represents JS function (selfarg, x, y, ...) {jscode}
-    into function (x, y, ...) {jscode} that takes selfarg from 'this'.
-    IOW, it is usable as JS method and first arg takes the receiver."
-    
-    <
-    	return function () {
-    		var args = [ this ];
-        	args.push.apply(args, arguments);
-        	return self.apply(null, args);
-    	}
+	which represents JS function (selfarg, x, y, ...) {jscode}
+	into function (x, y, ...) {jscode} that takes selfarg from 'this'.
+	IOW, it is usable as JS method and first arg takes the receiver."
+	
+	<
+		return function () {
+			var args = [ this ];
+			args.push.apply(args, arguments);
+			return self.apply(null, args);
+		}
 	>
 	>
 ! !
 ! !
 
 
@@ -65,13 +65,13 @@ currySelf
 
 
 on: anErrorClass do: aBlock
 on: anErrorClass do: aBlock
 	"All exceptions thrown in the Smalltalk stack are cought.
 	"All exceptions thrown in the Smalltalk stack are cought.
-    Convert all JS exceptions to JavaScriptException instances."
-    
+	Convert all JS exceptions to JavaScriptException instances."
+	
 	^self try: self catch: [ :error | | smalltalkError |
 	^self try: self catch: [ :error | | smalltalkError |
-    	smalltalkError := Smalltalk current asSmalltalkException: error.
-	    (smalltalkError isKindOf: anErrorClass) 
-	     ifTrue: [ aBlock value: smalltalkError ]
-	     ifFalse: [ smalltalkError signal ] ]
+		smalltalkError := Smalltalk current asSmalltalkException: error.
+		(smalltalkError isKindOf: anErrorClass)
+		 ifTrue: [ aBlock value: smalltalkError ]
+		 ifFalse: [ smalltalkError signal ] ]
 ! !
 ! !
 
 
 !BlockClosure methodsFor: 'evaluating'!
 !BlockClosure methodsFor: 'evaluating'!
@@ -85,25 +85,25 @@ ensure: aBlock
 !
 !
 
 
 new
 new
-	"Use the receiver as a JS constructor. 
+	"Use the receiver as a JS constructor.
 	*Do not* use this method to instanciate Smalltalk objects!!"
 	*Do not* use this method to instanciate Smalltalk objects!!"
 	<return new self()>
 	<return new self()>
 !
 !
 
 
 newValue: anObject
 newValue: anObject
-	"Use the receiver as a JS constructor. 
+	"Use the receiver as a JS constructor.
 	*Do not* use this method to instanciate Smalltalk objects!!"
 	*Do not* use this method to instanciate Smalltalk objects!!"
 	<return new self(anObject)>
 	<return new self(anObject)>
 !
 !
 
 
-newValue:  anObject value: anObject2
-	"Use the receiver as a JS constructor. 
+newValue: anObject value: anObject2
+	"Use the receiver as a JS constructor.
 	*Do not* use this method to instanciate Smalltalk objects!!"
 	*Do not* use this method to instanciate Smalltalk objects!!"
 	<return new self(anObject, anObject2)>
 	<return new self(anObject, anObject2)>
 !
 !
 
 
-newValue:  anObject value: anObject2 value: anObject3
-	"Use the receiver as a JS constructor. 
+newValue: anObject value: anObject2 value: anObject3
+	"Use the receiver as a JS constructor.
 	*Do not* use this method to instanciate Smalltalk objects!!"
 	*Do not* use this method to instanciate Smalltalk objects!!"
 	<return new self(anObject, anObject2,anObject3)>
 	<return new self(anObject, anObject2,anObject3)>
 !
 !
@@ -146,16 +146,16 @@ fork
 
 
 valueWithInterval: aNumber
 valueWithInterval: aNumber
 	<
 	<
-    	var interval = setInterval(self, aNumber);
-    	return smalltalk.Timeout._on_(interval);
-    >
+		var interval = setInterval(self, aNumber);
+		return smalltalk.Timeout._on_(interval);
+	>
 !
 !
 
 
 valueWithTimeout: aNumber
 valueWithTimeout: aNumber
 	<
 	<
-    	var timeout = setTimeout(self, aNumber);
-    	return smalltalk.Timeout._on_(timeout);
-    >
+		var timeout = setTimeout(self, aNumber);
+		return smalltalk.Timeout._on_(timeout);
+	>
 ! !
 ! !
 
 
 Object subclass: #CompiledMethod
 Object subclass: #CompiledMethod
@@ -178,7 +178,7 @@ See referenced classes:
 
 
 or messages sent from this method:
 or messages sent from this method:
 	
 	
-	(String methodAt: 'lines')  messageSends!
+	(String methodAt: 'lines')	messageSends!
 
 
 !CompiledMethod methodsFor: 'accessing'!
 !CompiledMethod methodsFor: 'accessing'!
 
 
@@ -192,15 +192,15 @@ category
 
 
 category: aString
 category: aString
 	| oldCategory |
 	| oldCategory |
-    oldCategory := self category.
+	oldCategory := self category.
 	self basicAt: 'category' put: aString.
 	self basicAt: 'category' put: aString.
-    
-    self methodClass ifNotNil: [
-    	self methodClass organization addElement: aString.
-    
-		(self methodClass methods 
-    		select: [ :each | each category = oldCategory ])
-        	ifEmpty: [ self methodClass organization removeElement: oldCategory ] ]
+	
+	self methodClass ifNotNil: [
+		self methodClass organization addElement: aString.
+	
+		(self methodClass methods
+			select: [ :each | each category = oldCategory ])
+			ifEmpty: [ self methodClass organization removeElement: oldCategory ] ]
 !
 !
 
 
 fn
 fn
@@ -284,28 +284,28 @@ defaultMaxPoolSize
 !ForkPool methodsFor: 'initialization'!
 !ForkPool methodsFor: 'initialization'!
 
 
 initialize
 initialize
-    super initialize.
-    
+	super initialize.
+	
 	poolSize := 0.
 	poolSize := 0.
-    queue := Queue new.
-    worker := self makeWorker
+	queue := Queue new.
+	worker := self makeWorker
 !
 !
 
 
 makeWorker
 makeWorker
 	| sentinel |
 	| sentinel |
-    sentinel := Object new.
-    ^[ | block |
-        poolSize := poolSize - 1.
+	sentinel := Object new.
+	^[ | block |
+		poolSize := poolSize - 1.
 		block := queue frontIfAbsent: [ sentinel ].
 		block := queue frontIfAbsent: [ sentinel ].
-        block == sentinel ifFalse: [
-        	[ block value ] ensure: [ self addWorker ]]]
+		block == sentinel ifFalse: [
+			[ block value ] ensure: [ self addWorker ]]]
 ! !
 ! !
 
 
 !ForkPool methodsFor: 'private'!
 !ForkPool methodsFor: 'private'!
 
 
 addWorker
 addWorker
 	worker valueWithTimeout: 0.
 	worker valueWithTimeout: 0.
-    poolSize := poolSize + 1
+	poolSize := poolSize + 1
 ! !
 ! !
 
 
 ForkPool class instanceVariableNames: 'default'!
 ForkPool class instanceVariableNames: 'default'!
@@ -329,10 +329,10 @@ Object subclass: #Message
 	package: 'Kernel-Methods'!
 	package: 'Kernel-Methods'!
 !Message commentStamp!
 !Message commentStamp!
 Generally, the system does not use instances of Message for efficiency reasons.
 Generally, the system does not use instances of Message for efficiency reasons.
-However, when a message is not understood by its receiver, the interpreter will make up an instance of it in order to capture the information involved in an actual message transmission. 
+However, when a message is not understood by its receiver, the interpreter will make up an instance of it in order to capture the information involved in an actual message transmission.
 This instance is sent it as an argument with the message `doesNotUnderstand:` to the receiver.
 This instance is sent it as an argument with the message `doesNotUnderstand:` to the receiver.
 
 
-See boot.js, `messageNotUnderstood`  and its counterpart `Object>>doesNotUnderstand:`!
+See boot.js, `messageNotUnderstood`	 and its counterpart `Object>>doesNotUnderstand:`!
 
 
 !Message methodsFor: 'accessing'!
 !Message methodsFor: 'accessing'!
 
 
@@ -355,12 +355,12 @@ selector: aString
 !Message methodsFor: 'printing'!
 !Message methodsFor: 'printing'!
 
 
 printString
 printString
-	^ String streamContents: [:aStream|  
-                                  				aStream 
-                                  					nextPutAll: super printString;
-                                  					nextPutAll: '(';
-                                  					nextPutAll: selector;
-                                  					nextPutAll: ')' 				]
+	^ String streamContents: [:aStream| 
+												aStream
+													nextPutAll: super printString;
+													nextPutAll: '(';
+													nextPutAll: selector;
+													nextPutAll: ')'					]
 !
 !
 
 
 sendTo: anObject
 sendTo: anObject
@@ -381,7 +381,7 @@ Object subclass: #MethodContext
 	package: 'Kernel-Methods'!
 	package: 'Kernel-Methods'!
 !MethodContext commentStamp!
 !MethodContext commentStamp!
 MethodContext holds all the dynamic state associated with the execution of either a method activation resulting from a message send. That is used to build the call stack while debugging.
 MethodContext holds all the dynamic state associated with the execution of either a method activation resulting from a message send. That is used to build the call stack while debugging.
-  
+
 MethodContext instances are JavaScript `SmalltalkMethodContext` objects defined in boot.js!
 MethodContext instances are JavaScript `SmalltalkMethodContext` objects defined in boot.js!
 
 
 !MethodContext methodsFor: 'accessing'!
 !MethodContext methodsFor: 'accessing'!
@@ -400,8 +400,8 @@ method
 
 
 methodContext
 methodContext
 	self isBlockContext ifFalse: [ ^ self ].
 	self isBlockContext ifFalse: [ ^ self ].
-    
-    ^ self home
+	
+	^ self home
 !
 !
 
 
 outerContext
 outerContext
@@ -422,33 +422,33 @@ receiver
 
 
 selector
 selector
 	<
 	<
-    	if(self.selector) {
-        	return smalltalk.convertSelector(self.selector);
-        } else {
-        	return nil;
-        }
-    >
+		if(self.selector) {
+			return smalltalk.convertSelector(self.selector);
+		} else {
+			return nil;
+		}
+	>
 !
 !
 
 
 temps
 temps
 	self deprecatedAPI.
 	self deprecatedAPI.
-    
+	
 	^ self locals
 	^ self locals
 ! !
 ! !
 
 
 !MethodContext methodsFor: 'converting'!
 !MethodContext methodsFor: 'converting'!
 
 
 asString
 asString
-	^self isBlockContext 
-    	ifTrue: [ 'a block (in ', self methodContext receiver class printString, ')' ]
-      	ifFalse: [ self receiver class printString, ' >> ', self selector ]
+	^self isBlockContext
+		ifTrue: [ 'a block (in ', self methodContext receiver class printString, ')' ]
+		ifFalse: [ self receiver class printString, ' >> ', self selector ]
 ! !
 ! !
 
 
 !MethodContext methodsFor: 'testing'!
 !MethodContext methodsFor: 'testing'!
 
 
 isBlockContext
 isBlockContext
 	"Block context do not have selectors."
 	"Block context do not have selectors."
-    
+	
 	^ self selector isNil
 	^ self selector isNil
 ! !
 ! !
 
 
@@ -465,37 +465,37 @@ Created instances will most probably be instance of `JSObjectProxy`.
 
 
 Usage example:
 Usage example:
 
 
-    | ws |
-    ws := NativeFunction constructor: 'WebSocket' value: 'ws://localhost'.
-    ws at: 'onopen' put: [ ws send: 'hey there from Amber' ]!
+	| ws |
+	ws := NativeFunction constructor: 'WebSocket' value: 'ws://localhost'.
+	ws at: 'onopen' put: [ ws send: 'hey there from Amber' ]!
 
 
 !NativeFunction class methodsFor: 'instance creation'!
 !NativeFunction class methodsFor: 'instance creation'!
 
 
 constructor: aString
 constructor: aString
 	<
 	<
-    	var native=eval(aString); 
-        return new native();
+		var native=eval(aString);
+		return new native();
 	>
 	>
 !
 !
 
 
 constructor: aString value:anObject
 constructor: aString value:anObject
 	<
 	<
-    	var native=eval(aString); 
-        return new native(anObject);
+		var native=eval(aString);
+		return new native(anObject);
 	>
 	>
 !
 !
 
 
 constructor: aString value:anObject value: anObject2
 constructor: aString value:anObject value: anObject2
 	<
 	<
-    	var native=eval(aString); 
-        return new native(anObject,anObject2);
+		var native=eval(aString);
+		return new native(anObject,anObject2);
 	>
 	>
 !
 !
 
 
 constructor: aString value:anObject value: anObject2 value:anObject3
 constructor: aString value:anObject value: anObject2 value:anObject3
 	<
 	<
-    	var native=eval(aString); 
-        return new native(anObject,anObject2, anObject3);
+		var native=eval(aString);
+		return new native(anObject,anObject2, anObject3);
 	>
 	>
 ! !
 ! !
 
 
@@ -503,11 +503,11 @@ constructor: aString value:anObject value: anObject2 value:anObject3
 
 
 exists: aString
 exists: aString
 	<
 	<
-    	if(aString in window) {
-        	return true
-        } else {
-        	return false
-        }
-    >
+		if(aString in window) {
+			return true
+		} else {
+			return false
+		}
+	>
 ! !
 ! !
 
 

+ 149 - 149
st/Kernel-Objects.st

@@ -5,7 +5,7 @@ nil subclass: #Object
 !Object commentStamp!
 !Object commentStamp!
 *Object is the root of the Smalltalk class system*. All classes in the system are subclasses of Object.
 *Object is the root of the Smalltalk class system*. All classes in the system are subclasses of Object.
 
 
-Object provides default behavior common to all normal objects, such as: 
+Object provides default behavior common to all normal objects, such as:
 
 
 - access
 - access
 - copying
 - copying
@@ -30,14 +30,14 @@ The hook method `#postCopy` can be overriden in subclasses to copy fields as nec
 
 
 ##Comparison
 ##Comparison
 
 
-Objects understand equality  `#=` and identity `#==` comparison.
+Objects understand equality	 `#=` and identity `#==` comparison.
 
 
 ##Error handling
 ##Error handling
 
 
 - `#halt` is the typical message to use for inserting breakpoints during debugging.
 - `#halt` is the typical message to use for inserting breakpoints during debugging.
 - `#error:` throws a generic error exception
 - `#error:` throws a generic error exception
 - `#doesNotUnderstand:` handles the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message.
 - `#doesNotUnderstand:` handles the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message.
-  Overriding this message can be useful to implement proxies for example.!
+	Overriding this message can be useful to implement proxies for example.!
 
 
 !Object methodsFor: 'accessing'!
 !Object methodsFor: 'accessing'!
 
 
@@ -50,7 +50,7 @@ basicAt: aString put: anObject
 !
 !
 
 
 basicDelete: aString
 basicDelete: aString
-    <delete self[aString]; return aString>
+	<delete self[aString]; return aString>
 !
 !
 
 
 class
 class
@@ -133,8 +133,8 @@ asString
 
 
 test
 test
 	| a |
 	| a |
-    a := 1.
-    self halt
+	a := 1.
+	self halt
 ! !
 ! !
 
 
 !Object methodsFor: 'copying'!
 !Object methodsFor: 'copying'!
@@ -144,14 +144,14 @@ copy
 !
 !
 
 
 deepCopy
 deepCopy
-	<    
-	    var copy = self.klass._new();
-	    for(var i in self) {
+	<	
+		var copy = self.klass._new();
+		for(var i in self) {
 		if(/^@.+/.test(i)) {
 		if(/^@.+/.test(i)) {
-		    copy[i] = self[i]._deepCopy();
+			copy[i] = self[i]._deepCopy();
 		}
 		}
-	    }
-	    return copy;
+		}
+		return copy;
 	>
 	>
 !
 !
 
 
@@ -160,13 +160,13 @@ postCopy
 
 
 shallowCopy
 shallowCopy
 	<
 	<
-	    var copy = self.klass._new();
-	    for(var i in self) {
+		var copy = self.klass._new();
+		for(var i in self) {
 		if(/^@.+/.test(i)) {
 		if(/^@.+/.test(i)) {
-		    copy[i] = self[i];
+			copy[i] = self[i];
+		}
 		}
 		}
-	    }
-	    return copy;
+		return copy;
 	>
 	>
 ! !
 ! !
 
 
@@ -217,7 +217,7 @@ initialize
 
 
 !Object methodsFor: 'message handling'!
 !Object methodsFor: 'message handling'!
 
 
-basicPerform: aSymbol 
+basicPerform: aSymbol
 	^self basicPerform: aSymbol withArguments: #()
 	^self basicPerform: aSymbol withArguments: #()
 !
 !
 
 
@@ -238,7 +238,7 @@ perform: aSymbol withArguments: aCollection
 log: aString block: aBlock
 log: aString block: aBlock
 
 
 	| result |
 	| result |
-	console log:  aString,  ' time: ', (Date millisecondsToRun: [result := aBlock value]) printString.
+	console log: aString,	' time: ', (Date millisecondsToRun: [result := aBlock value]) printString.
 	^result
 	^result
 !
 !
 
 
@@ -255,7 +255,7 @@ storeOn: aStream
 !
 !
 
 
 storeString
 storeString
-	"Answer a String representation of the receiver from which the receiver 
+	"Answer a String representation of the receiver from which the receiver
 	can be reconstructed."
 	can be reconstructed."
 
 
 	^ String streamContents: [:s | self storeOn: s]
 	^ String streamContents: [:s | self storeOn: s]
@@ -293,8 +293,8 @@ isClass
 
 
 isKindOf: aClass
 isKindOf: aClass
 	^(self isMemberOf: aClass)
 	^(self isMemberOf: aClass)
-	    ifTrue: [true]
-	    ifFalse: [self class inheritsFrom: aClass]
+		ifTrue: [true]
+		ifFalse: [self class inheritsFrom: aClass]
 !
 !
 
 
 isMemberOf: aClass
 isMemberOf: aClass
@@ -352,11 +352,11 @@ Boolean instances are weither `true` or `false`.!
 
 
 = aBoolean
 = aBoolean
 	<
 	<
-    	if(!! aBoolean._isBoolean || !! aBoolean._isBoolean()) {
-        	return false;
-        }
-    	return Boolean(self == true) == aBoolean
-    >
+		if(!! aBoolean._isBoolean || !! aBoolean._isBoolean()) {
+			return false;
+		}
+		return Boolean(self == true) == aBoolean
+	>
 !
 !
 
 
 == aBoolean
 == aBoolean
@@ -367,18 +367,18 @@ Boolean instances are weither `true` or `false`.!
 
 
 & aBoolean
 & aBoolean
 	<
 	<
-	    if(self == true) {
+		if(self == true) {
 		return aBoolean;
 		return aBoolean;
-	    } else {
+		} else {
 		return false;
 		return false;
-	    }
+		}
 	>
 	>
 !
 !
 
 
 and: aBlock
 and: aBlock
 	^self = true
 	^self = true
-	    ifTrue: aBlock
-	    ifFalse: [false]
+		ifTrue: aBlock
+		ifFalse: [false]
 !
 !
 
 
 ifFalse: aBlock
 ifFalse: aBlock
@@ -399,11 +399,11 @@ ifTrue: aBlock
 ifTrue: aBlock ifFalse: anotherBlock
 ifTrue: aBlock ifFalse: anotherBlock
 	"inlined in the Compiler"
 	"inlined in the Compiler"
 	<
 	<
-	    if(self == true) {
+		if(self == true) {
 		return aBlock();
 		return aBlock();
-	    } else {
+		} else {
 		return anotherBlock();
 		return anotherBlock();
-	    }
+		}
 	>
 	>
 !
 !
 
 
@@ -413,17 +413,17 @@ not
 
 
 or: aBlock
 or: aBlock
 	^self = true
 	^self = true
-	    ifTrue: [true]
-	    ifFalse: aBlock
+		ifTrue: [true]
+		ifFalse: aBlock
 !
 !
 
 
 | aBoolean
 | aBoolean
 	<
 	<
-	    if(self == true) {
+		if(self == true) {
 		return true;
 		return true;
-	    } else {
+		} else {
 		return aBoolean;
 		return aBoolean;
-	    }
+		}
 	>
 	>
 ! !
 ! !
 
 
@@ -651,15 +651,15 @@ JSOjbectProxy makes intensive use of `#doesNotUnderstand:`.
 
 
 JSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.
 JSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.
 
 
-    window alert: 'hello world'.
-    window inspect.
-    (window jQuery: 'body') append: 'hello world'
+	window alert: 'hello world'.
+	window inspect.
+	(window jQuery: 'body') append: 'hello world'
 
 
-Smalltalk messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown. 
+Smalltalk messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown.
 
 
 ## Message conversion rules
 ## Message conversion rules
 
 
-- `someUser name` becomes  `someUser.name`
+- `someUser name` becomes `someUser.name`
 - `someUser name: 'John'` becomes `someUser name = "John"`
 - `someUser name: 'John'` becomes `someUser name = "John"`
 - `console log: 'hello world'` becomes `console.log('hello world')`
 - `console log: 'hello world'` becomes `console.log('hello world')`
 - `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`
 - `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`
@@ -675,8 +675,8 @@ at: aSymbol
 at: aSymbol ifAbsent: aBlock
 at: aSymbol ifAbsent: aBlock
 	"return the aSymbol property or evaluate aBlock if the property is not defined on the object"
 	"return the aSymbol property or evaluate aBlock if the property is not defined on the object"
 	<
 	<
-    	var obj = self['@jsObject'],
-        	symbol = aSymbol._asString();
+		var obj = self['@jsObject'],
+			symbol = aSymbol._asString();
 		return symbol in obj ? obj[symbol] : aBlock();
 		return symbol in obj ? obj[symbol] : aBlock();
 	>
 	>
 !
 !
@@ -695,7 +695,7 @@ jsObject: aJSObject
 
 
 value
 value
 	"if attribute 'value' exists on the JS object return it,
 	"if attribute 'value' exists on the JS object return it,
-    otherwise return the result of Object>>value."
+	otherwise return the result of Object>>value."
 	^ self at: 'value' ifAbsent: [super value]
 	^ self at: 'value' ifAbsent: [super value]
 ! !
 ! !
 
 
@@ -703,34 +703,34 @@ value
 
 
 keysAndValuesDo: aBlock
 keysAndValuesDo: aBlock
 	<
 	<
-    	var o = self['@jsObject'];
-    	for(var i in o) {
+		var o = self['@jsObject'];
+		for(var i in o) {
 			aBlock(i, o[i]);
 			aBlock(i, o[i]);
 		}
 		}
-    >
+	>
 ! !
 ! !
 
 
 !JSObjectProxy methodsFor: 'proxy'!
 !JSObjectProxy methodsFor: 'proxy'!
 
 
 addObjectVariablesTo: aDictionary
 addObjectVariablesTo: aDictionary
 	<
 	<
-    	for(var i in self['@jsObject']) {
+		for(var i in self['@jsObject']) {
 			aDictionary._at_put_(i, self['@jsObject'][i]);
 			aDictionary._at_put_(i, self['@jsObject'][i]);
 		}
 		}
-    >
+	>
 !
 !
 
 
 doesNotUnderstand: aMessage
 doesNotUnderstand: aMessage
-    
-   ^ (self canForwardMessage: aMessage) 
-    	ifTrue: [ self forwardMessage: aMessage ]
-        ifFalse: [ ^ super doesNotUnderstand: aMessage ]
+	
+	^ (self canForwardMessage: aMessage)
+		ifTrue: [ self forwardMessage: aMessage ]
+		ifFalse: [ ^ super doesNotUnderstand: aMessage ]
 !
 !
 
 
 forwardMessage: aMessage
 forwardMessage: aMessage
 	<
 	<
-    	return smalltalk.send(self._jsObject(), aMessage._selector()._asJavaScriptSelector(), aMessage._arguments());
-    >
+		return smalltalk.send(self._jsObject(), aMessage._selector()._asJavaScriptSelector(), aMessage._arguments());
+	>
 !
 !
 
 
 inspectOn: anInspector
 inspectOn: anInspector
@@ -750,13 +750,13 @@ printString
 
 
 canForwardMessage: aMessage
 canForwardMessage: aMessage
 	<
 	<
-    	var jsSelector = aMessage._selector()._asJavaScriptSelector();
-    	if(jsSelector in self._jsObject()) {
-        	return true
-        } else {
-        	return false;
-        }
-    >
+		var jsSelector = aMessage._selector()._asJavaScriptSelector();
+		if(jsSelector in self._jsObject()) {
+			return true
+		} else {
+			return false;
+		}
+	>
 ! !
 ! !
 
 
 !JSObjectProxy class methodsFor: 'instance creation'!
 !JSObjectProxy class methodsFor: 'instance creation'!
@@ -771,10 +771,10 @@ Object subclass: #Number
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Objects'!
 	package: 'Kernel-Objects'!
 !Number commentStamp!
 !Number commentStamp!
-Number holds the most general methods for dealing with numbers.  
+Number holds the most general methods for dealing with numbers. 
 Number is directly mapped to JavaScript Number.
 Number is directly mapped to JavaScript Number.
 
 
-Most arithmetic methods like `#+` `#/` `#-` `#max:` are directly inlined into javascript. 
+Most arithmetic methods like `#+` `#/` `#-` `#max:` are directly inlined into javascript.
 
 
 ##Enumerating
 ##Enumerating
 A Number can be used to evaluate a Block a fixed number of times:
 A Number can be used to evaluate a Block a fixed number of times:
@@ -859,11 +859,11 @@ squared
 
 
 = aNumber
 = aNumber
 	<
 	<
-    	if(!! aNumber._isNumber || !! aNumber._isNumber()) {
-        	return false;
-        }
-    	return Number(self) == aNumber
-    >
+		if(!! aNumber._isNumber || !! aNumber._isNumber()) {
+			return false;
+		}
+		return Number(self) == aNumber
+	>
 !
 !
 
 
 > aNumber
 > aNumber
@@ -903,7 +903,7 @@ asString
 !
 !
 
 
 atRandom
 atRandom
-    ^(Random new next * self) truncated + 1
+	^(Random new next * self) truncated + 1
 !
 !
 
 
 rounded
 rounded
@@ -917,9 +917,9 @@ to: aNumber
 	count := 1.
 	count := 1.
 	array := Array new.
 	array := Array new.
 	(last - first) timesRepeat: [
 	(last - first) timesRepeat: [
-	    array at: count put: first.
-	    count := count + 1.
-	    first := first + 1].
+		array at: count put: first.
+		count := count + 1.
+		first := first + 1].
 	^array
 	^array
 !
 !
 
 
@@ -931,24 +931,24 @@ to: stop by: step
 	step = 0 ifTrue: [self error: 'step must be non-zero'].
 	step = 0 ifTrue: [self error: 'step must be non-zero'].
 	step < 0
 	step < 0
 		ifTrue: [[ value >= stop ] whileTrue: [
 		ifTrue: [[ value >= stop ] whileTrue: [
-	    			array at: pos put: value.
-	    			pos := pos + 1.
-	    			value := value + step]]
+					array at: pos put: value.
+					pos := pos + 1.
+					value := value + step]]
 		ifFalse: [[ value <= stop ] whileTrue: [
 		ifFalse: [[ value <= stop ] whileTrue: [
-	    			array at: pos put: value.
-	  			pos := pos + 1.
-	    			value := value + step]].
+					array at: pos put: value.
+				pos := pos + 1.
+					value := value + step]].
 	^array
 	^array
 !
 !
 
 
 truncated
 truncated
 	<
 	<
-    	if(self >>= 0) {
-        	return Math.floor(self);
-        } else {
-        	return Math.floor(self * (-1)) * (-1);
-        };
-    >
+		if(self >>= 0) {
+			return Math.floor(self);
+		} else {
+			return Math.floor(self * (-1)) * (-1);
+		};
+	>
 !
 !
 
 
 | aNumber
 | aNumber
@@ -971,8 +971,8 @@ timesRepeat: aBlock
 	| count |
 	| count |
 	count := 1.
 	count := 1.
 	[count > self] whileFalse: [
 	[count > self] whileFalse: [
-	    aBlock value.
-	    count := count + 1]
+		aBlock value.
+		count := count + 1]
 !
 !
 
 
 to: stop by: step do: aBlock
 to: stop by: step do: aBlock
@@ -981,11 +981,11 @@ to: stop by: step do: aBlock
 	step = 0 ifTrue: [self error: 'step must be non-zero'].
 	step = 0 ifTrue: [self error: 'step must be non-zero'].
 	step < 0
 	step < 0
 		ifTrue: [[ value >= stop ] whileTrue: [
 		ifTrue: [[ value >= stop ] whileTrue: [
-	    			aBlock value: value.
-	    			value := value + step]]
+					aBlock value: value.
+					value := value + step]]
 		ifFalse: [[ value <= stop ] whileTrue: [
 		ifFalse: [[ value <= stop ] whileTrue: [
-	    			aBlock value: value.
-	    			value := value + step]]
+					aBlock value: value.
+					value := value + step]]
 !
 !
 
 
 to: stop do: aBlock
 to: stop do: aBlock
@@ -993,7 +993,7 @@ to: stop do: aBlock
 	| nextValue |
 	| nextValue |
 	nextValue := self.
 	nextValue := self.
 	[nextValue <= stop]
 	[nextValue <= stop]
-		whileTrue: 
+		whileTrue:
 			[aBlock value: nextValue.
 			[aBlock value: nextValue.
 			nextValue := nextValue + 1]
 			nextValue := nextValue + 1]
 ! !
 ! !
@@ -1072,18 +1072,18 @@ addElement: aString
 	super addElement: aString.
 	super addElement: aString.
 
 
 	SystemAnnouncer current announce: (ProtocolAdded new
 	SystemAnnouncer current announce: (ProtocolAdded new
-    	protocol: aString;
-        theClass: self theClass;
-        yourself)
+		protocol: aString;
+		theClass: self theClass;
+		yourself)
 !
 !
 
 
 removeElement: aString
 removeElement: aString
 	super removeElement: aString.
 	super removeElement: aString.
 
 
 	SystemAnnouncer current announce: (ProtocolRemoved new
 	SystemAnnouncer current announce: (ProtocolRemoved new
-    	protocol: aString;
-        theClass: self theClass;
-        yourself)
+		protocol: aString;
+		theClass: self theClass;
+		yourself)
 !
 !
 
 
 theClass
 theClass
@@ -1256,15 +1256,15 @@ defaultCommitPathSt: aString
 !
 !
 
 
 resetCommitPaths
 resetCommitPaths
-        defaultCommitPathJs := nil.
-        defaultCommitPathSt := nil.
+		defaultCommitPathJs := nil.
+		defaultCommitPathSt := nil.
 ! !
 ! !
 
 
 !Package class methodsFor: 'initialization'!
 !Package class methodsFor: 'initialization'!
 
 
 initialize
 initialize
 	super initialize.
 	super initialize.
-    self commitPathsFromLoader
+	self commitPathsFromLoader
 ! !
 ! !
 
 
 !Package class methodsFor: 'loading-storing'!
 !Package class methodsFor: 'loading-storing'!
@@ -1274,10 +1274,10 @@ fetch: aPackageName
 !
 !
 
 
 fetch: aPackageName prefix: aPrefix
 fetch: aPackageName prefix: aPrefix
-	jQuery 
-    	getScript: (aPrefix , aPackageName , '.js') 
-        onSuccess: [ 
-        	(Package named: aPackageName) setupClasses ]
+	jQuery
+		getScript: (aPrefix , aPackageName , '.js')
+		onSuccess: [
+			(Package named: aPackageName) setupClasses ]
 ! !
 ! !
 
 
 !Package class methodsFor: 'sorting'!
 !Package class methodsFor: 'sorting'!
@@ -1387,7 +1387,7 @@ printString
 
 
 !Point methodsFor: 'transforming'!
 !Point methodsFor: 'transforming'!
 
 
-translateBy: delta 
+translateBy: delta
 	"Answer a Point translated by delta (an instance of Point)."
 	"Answer a Point translated by delta (an instance of Point)."
 	^(delta x + x) @ (delta y + y)
 	^(delta x + x) @ (delta y + y)
 ! !
 ! !
@@ -1438,14 +1438,14 @@ next
 !
 !
 
 
 next: anInteger
 next: anInteger
-    ^(1 to: anInteger) collect: [:each | self next]
+	^(1 to: anInteger) collect: [:each | self next]
 ! !
 ! !
 
 
 Object subclass: #Smalltalk
 Object subclass: #Smalltalk
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Objects'!
 	package: 'Kernel-Objects'!
 !Smalltalk commentStamp!
 !Smalltalk commentStamp!
-Smalltalk has only one instance, accessed with `Smalltalk current`. 
+Smalltalk has only one instance, accessed with `Smalltalk current`.
 It represents the global JavaScript variable `smalltalk` declared in `js/boot.js`.
 It represents the global JavaScript variable `smalltalk` declared in `js/boot.js`.
 
 
 The `smalltalk` object holds all class and packages defined in the system.
 The `smalltalk` object holds all class and packages defined in the system.
@@ -1468,7 +1468,7 @@ __note:__ classes and packages are accessed using strings, not symbols
 
 
 ## Parsing
 ## Parsing
 
 
-The `#parse:` method is used to parse Smalltalk source code. 
+The `#parse:` method is used to parse Smalltalk source code.
 It requires the `Compiler` package and the `js/parser.js` parser file in order to work!
 It requires the `Compiler` package and the `js/parser.js` parser file in order to work!
 
 
 !Smalltalk methodsFor: 'accessing'!
 !Smalltalk methodsFor: 'accessing'!
@@ -1478,7 +1478,7 @@ at: aSymbol
 !
 !
 
 
 parse: aString
 parse: aString
-	| result | 
+	| result |
 	self try: [result := self basicParse: aString] catch: [:ex | (self parseError: ex parsing: aString) signal].
 	self try: [result := self basicParse: aString] catch: [:ex | (self parseError: ex parsing: aString) signal].
 	^result
 	^result
 !
 !
@@ -1494,8 +1494,8 @@ reservedWords
 
 
 version
 version
 	"Answer the version string of Amber"
 	"Answer the version string of Amber"
-    
-    ^ '0.10'
+	
+	^ '0.10'
 ! !
 ! !
 
 
 !Smalltalk methodsFor: 'classes'!
 !Smalltalk methodsFor: 'classes'!
@@ -1506,30 +1506,30 @@ classes
 
 
 deleteClass: aClass
 deleteClass: aClass
 	"Deletes a class by deleting its binding only. Use #removeClass instead"
 	"Deletes a class by deleting its binding only. Use #removeClass instead"
-    
+	
 	<self.removeClass(aClass)>
 	<self.removeClass(aClass)>
 !
 !
 
 
 removeClass: aClass
 removeClass: aClass
 	aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!!'].
 	aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!!'].
-    
+	
 	self deleteClass: aClass.
 	self deleteClass: aClass.
-    
-    SystemAnnouncer current
-    	announce: (ClassRemoved new
-        	theClass: aClass;
-            yourself)
+	
+	SystemAnnouncer current
+		announce: (ClassRemoved new
+			theClass: aClass;
+			yourself)
 ! !
 ! !
 
 
 !Smalltalk methodsFor: 'error handling'!
 !Smalltalk methodsFor: 'error handling'!
 
 
 asSmalltalkException: anObject
 asSmalltalkException: anObject
 	"A JavaScript exception may be thrown.
 	"A JavaScript exception may be thrown.
-    We then need to convert it back to a Smalltalk object"
-    
-    ^ ((self isSmalltalkObject: anObject) and: [ anObject isKindOf: Error ])
-    	ifTrue: [ anObject ]
-      	ifFalse: [ JavaScriptException on: anObject ]
+	We then need to convert it back to a Smalltalk object"
+	
+	^ ((self isSmalltalkObject: anObject) and: [ anObject isKindOf: Error ])
+		ifTrue: [ anObject ]
+		ifFalse: [ JavaScriptException on: anObject ]
 !
 !
 
 
 parseError: anException parsing: aString
 parseError: anException parsing: aString
@@ -1540,22 +1540,22 @@ parseError: anException parsing: aString
 
 
 createPackage: packageName
 createPackage: packageName
 	"Create and bind a new package with given name and return it."
 	"Create and bind a new package with given name and return it."
-       <return smalltalk.addPackage(packageName)>
+	<return smalltalk.addPackage(packageName)>
 !
 !
 
 
 deletePackage: packageName
 deletePackage: packageName
 	"Deletes a package by deleting its binding, but does not check if it contains classes etc.
 	"Deletes a package by deleting its binding, but does not check if it contains classes etc.
 	To remove a package, use #removePackage instead."
 	To remove a package, use #removePackage instead."
 
 
-       <delete smalltalk.packages[packageName]>
+	<delete smalltalk.packages[packageName]>
 !
 !
 
 
 packageAt: packageName
 packageAt: packageName
-       <return self.packages[packageName]>
+	<return self.packages[packageName]>
 !
 !
 
 
 packageAt: packageName ifAbsent: aBlock
 packageAt: packageName ifAbsent: aBlock
-       ^(self packageAt: packageName) ifNil: aBlock
+	^(self packageAt: packageName) ifNil: aBlock
 !
 !
 
 
 packages
 packages
@@ -1574,7 +1574,7 @@ removePackage: packageName
 	| pkg |
 	| pkg |
 	pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
 	pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
 	pkg classes do: [:each |
 	pkg classes do: [:each |
-        	self removeClass: each].
+			self removeClass: each].
 	self deletePackage: packageName
 	self deletePackage: packageName
 !
 !
 
 
@@ -1584,7 +1584,7 @@ renamePackage: packageName to: newName
 	| pkg |
 	| pkg |
 	pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
 	pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
 	(self packageAt: newName) ifNotNil: [self error: 'Already exists a package called: ', newName].
 	(self packageAt: newName) ifNotNil: [self error: 'Already exists a package called: ', newName].
-    (self basicAt: 'packages') at: newName put: pkg.
+	(self basicAt: 'packages') at: newName put: pkg.
 	pkg name: newName.
 	pkg name: newName.
 	self deletePackage: packageName.
 	self deletePackage: packageName.
 ! !
 ! !
@@ -1596,20 +1596,20 @@ basicParse: aString
 !
 !
 
 
 createPackage: packageName properties: aDict
 createPackage: packageName properties: aDict
-    "Needed to import .st files: they begin with this call."
-    self deprecatedAPI.
-    
-    aDict isEmpty ifFalse: [ self error: 'createPackage:properties: called with nonempty properties' ].
-    ^ self createPackage: packageName
+	"Needed to import .st files: they begin with this call."
+	self deprecatedAPI.
+	
+	aDict isEmpty ifFalse: [ self error: 'createPackage:properties: called with nonempty properties' ].
+	^ self createPackage: packageName
 ! !
 ! !
 
 
 !Smalltalk methodsFor: 'testing'!
 !Smalltalk methodsFor: 'testing'!
 
 
 isSmalltalkObject: anObject
 isSmalltalkObject: anObject
 	"Consider anObject a Smalltalk object if it has a 'klass' property.
 	"Consider anObject a Smalltalk object if it has a 'klass' property.
-    Note that this may be unaccurate"
-    
-    <return typeof anObject.klass !!== 'undefined'>
+	Note that this may be unaccurate"
+	
+	<return typeof anObject.klass !!== 'undefined'>
 ! !
 ! !
 
 
 Smalltalk class instanceVariableNames: 'current'!
 Smalltalk class instanceVariableNames: 'current'!
@@ -1638,16 +1638,16 @@ rawTimeout: anObject
 
 
 clearInterval
 clearInterval
 	<
 	<
-    	var interval = self["@rawTimeout"];
+		var interval = self["@rawTimeout"];
 		clearInterval(interval);
 		clearInterval(interval);
-    >
+	>
 !
 !
 
 
 clearTimeout
 clearTimeout
 	<
 	<
-    	var timeout = self["@rawTimeout"];
+		var timeout = self["@rawTimeout"];
 		clearTimeout(timeout);
 		clearTimeout(timeout);
-    >
+	>
 ! !
 ! !
 
 
 !Timeout class methodsFor: 'instance creation'!
 !Timeout class methodsFor: 'instance creation'!
@@ -1678,7 +1678,7 @@ subclass: aString instanceVariableNames: aString2 category: aString3
 
 
 subclass: aString instanceVariableNames: aString2 package: aString3
 subclass: aString instanceVariableNames: aString2 package: aString3
 	^ClassBuilder new
 	^ClassBuilder new
-	    superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3
+		superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3
 ! !
 ! !
 
 
 !UndefinedObject methodsFor: 'converting'!
 !UndefinedObject methodsFor: 'converting'!
@@ -1700,7 +1700,7 @@ shallowCopy
 !UndefinedObject methodsFor: 'printing'!
 !UndefinedObject methodsFor: 'printing'!
 
 
 printString
 printString
-    ^'nil'
+	^'nil'
 ! !
 ! !
 
 
 !UndefinedObject methodsFor: 'testing'!
 !UndefinedObject methodsFor: 'testing'!
@@ -1736,6 +1736,6 @@ notNil
 !UndefinedObject class methodsFor: 'instance creation'!
 !UndefinedObject class methodsFor: 'instance creation'!
 
 
 new
 new
-	    self error: 'You cannot create new instances of UndefinedObject. Use nil'
+		self error: 'You cannot create new instances of UndefinedObject. Use nil'
 ! !
 ! !
 
 

+ 185 - 185
st/Kernel-Tests.st

@@ -19,11 +19,11 @@ testCompiledSource
 
 
 testCurrySelf
 testCurrySelf
 	| curriedMethod array |
 	| curriedMethod array |
-    curriedMethod := [ :selfarg :x | selfarg at: x ] currySelf asCompiledMethod: 'foo:'.
-    array := #(3 1 4).
-    ClassBuilder new installMethod: curriedMethod forClass: Array category: '**test helper'.
-    [ self assert: (array foo: 2) equals: 1 ]
-    ensure: [ Array removeCompiledMethod: curriedMethod ]
+	curriedMethod := [ :selfarg :x | selfarg at: x ] currySelf asCompiledMethod: 'foo:'.
+	array := #(3 1 4).
+	ClassBuilder new installMethod: curriedMethod forClass: Array category: '**test helper'.
+	[ self assert: (array foo: 2) equals: 1 ]
+	ensure: [ Array removeCompiledMethod: curriedMethod ]
 !
 !
 
 
 testEnsure
 testEnsure
@@ -36,16 +36,16 @@ testEnsureRaises
 
 
 testExceptionSemantics
 testExceptionSemantics
 	"See https://github.com/NicolasPetton/amber/issues/314"
 	"See https://github.com/NicolasPetton/amber/issues/314"
-    self timeout: 100.
-    
-    (self async:  [ 
-    	[ 
-        	self assert: true. 
-            Error signal. 
-            "The following should *not* be run"
-            self deny: true.
-            self finished.
-  		] on: Error do: [ :ex | self finished ] 
+	self timeout: 100.
+	
+	(self async: [
+		[
+			self assert: true.
+			Error signal.
+			"The following should *not* be run"
+			self deny: true.
+			self finished.
+		] on: Error do: [ :ex | self finished ]
 	]) valueWithTimeout: 0
 	]) valueWithTimeout: 0
 !
 !
 
 
@@ -61,7 +61,7 @@ testOnDo
 testValue
 testValue
 	self assert: ([1+1] value) equals: 2.
 	self assert: ([1+1] value) equals: 2.
 	self assert: ([:x | x +1] value: 2) equals: 3.
 	self assert: ([:x | x +1] value: 2) equals: 3.
-	self assert: ([:x :y | x*y] value: 2 value: 4) equals: 8. 
+	self assert: ([:x :y | x*y] value: 2 value: 4) equals: 8.
 
 
 	"Arguments are optional in Amber. This isn't ANSI compliant."
 	"Arguments are optional in Amber. This isn't ANSI compliant."
 
 
@@ -105,7 +105,7 @@ TestCase subclass: #BooleanTest
 testEquality
 testEquality
 	"We're on top of JS...just be sure to check the basics!!"
 	"We're on top of JS...just be sure to check the basics!!"
 
 
-	self deny: 0 = false. 
+	self deny: 0 = false.
 	self deny: false = 0.
 	self deny: false = 0.
 	self deny: '' = false.
 	self deny: '' = false.
 	self deny: false = ''.
 	self deny: false = ''.
@@ -123,7 +123,7 @@ testEquality
 testIdentity
 testIdentity
 	"We're on top of JS...just be sure to check the basics!!"
 	"We're on top of JS...just be sure to check the basics!!"
 
 
-	self deny: 0 == false. 
+	self deny: 0 == false.
 	self deny: false == 0.
 	self deny: false == 0.
 	self deny: '' == false.
 	self deny: '' == false.
 	self deny: false == ''.
 	self deny: false == ''.
@@ -139,7 +139,7 @@ testIdentity
 !
 !
 
 
 testIfTrueIfFalse
 testIfTrueIfFalse
- 
+
 	self assert: (true ifTrue: ['alternative block']) equals: 'alternative block'.
 	self assert: (true ifTrue: ['alternative block']) equals: 'alternative block'.
 	self assert: (true ifFalse: ['alternative block']) equals: nil.
 	self assert: (true ifFalse: ['alternative block']) equals: nil.
 
 
@@ -154,7 +154,7 @@ testIfTrueIfFalse
 !
 !
 
 
 testIfTrueIfFalseWithBoxing
 testIfTrueIfFalseWithBoxing
- 
+
 	self assert: (true yourself ifTrue: ['alternative block']) equals: 'alternative block'.
 	self assert: (true yourself ifTrue: ['alternative block']) equals: 'alternative block'.
 	self assert: (true yourself ifFalse: ['alternative block']) equals: nil.
 	self assert: (true yourself ifFalse: ['alternative block']) equals: nil.
 
 
@@ -171,48 +171,48 @@ testIfTrueIfFalseWithBoxing
 testLogic
 testLogic
 	"Trivial logic table"
 	"Trivial logic table"
 	self assert: (true & true);
 	self assert: (true & true);
-    	deny: (true & false);
-        deny: (false & true);
-        deny: (false & false).
+		deny: (true & false);
+		deny: (false & true);
+		deny: (false & false).
 	self assert: (true | true);
 	self assert: (true | true);
-    	assert: (true | false);
-        assert: (false | true);
-        deny: (false | false).
+		assert: (true | false);
+		assert: (false | true);
+		deny: (false | false).
 	"Checking that expressions work fine too"
 	"Checking that expressions work fine too"
 	self assert: (true & (1 > 0));
 	self assert: (true & (1 > 0));
-    	deny: ((1 > 0) & false);
-        deny: ((1 > 0) & (1 > 2)).
+		deny: ((1 > 0) & false);
+		deny: ((1 > 0) & (1 > 2)).
 	self assert: (false | (1 > 0));
 	self assert: (false | (1 > 0));
-    	assert: ((1 > 0) | false);
-        assert: ((1 > 0) | (1 > 2))
+		assert: ((1 > 0) | false);
+		assert: ((1 > 0) | (1 > 2))
 !
 !
 
 
 testLogicKeywords
 testLogicKeywords
 	"Trivial logic table"
 	"Trivial logic table"
-	self 
-		assert: (true and: [ true]); 
-		deny: (true and: [ false ]); 
-		deny: (false and: [ true ]); 
+	self
+		assert: (true and: [ true]);
+		deny: (true and: [ false ]);
+		deny: (false and: [ true ]);
 		deny: (false and: [ false ]).
 		deny: (false and: [ false ]).
-	self 
-		assert: (true or: [ true ]); 
-		assert: (true or: [ false ]); 
-		assert: (false or: [ true ]); 
+	self
+		assert: (true or: [ true ]);
+		assert: (true or: [ false ]);
+		assert: (false or: [ true ]);
 		deny: (false or: [ false ]).
 		deny: (false or: [ false ]).
-        
+		
 	"Checking that expressions work fine too"
 	"Checking that expressions work fine too"
-	self 
-		assert: (true and: [ 1 > 0 ]); 
-		deny: ((1 > 0) and: [ false ]); 
+	self
+		assert: (true and: [ 1 > 0 ]);
+		deny: ((1 > 0) and: [ false ]);
 		deny: ((1 > 0) and: [ 1 > 2 ]).
 		deny: ((1 > 0) and: [ 1 > 2 ]).
-	self 
-		assert: (false or: [ 1 > 0 ]); 
-		assert: ((1 > 0) or: [ false ]); 
+	self
+		assert: (false or: [ 1 > 0 ]);
+		assert: ((1 > 0) or: [ false ]);
 		assert: ((1 > 0) or: [ 1 > 2 ])
 		assert: ((1 > 0) or: [ 1 > 2 ])
 !
 !
 
 
 testNonBooleanError
 testNonBooleanError
-    self should: [ '' ifTrue: [] ifFalse: [] ] raise: NonBooleanReceiver
+	self should: [ '' ifTrue: [] ifFalse: [] ] raise: NonBooleanReceiver
 ! !
 ! !
 
 
 TestCase subclass: #ClassBuilderTest
 TestCase subclass: #ClassBuilderTest
@@ -242,63 +242,63 @@ testClassCopy
 
 
 testClassMigration
 testClassMigration
 	| instance oldClass |
 	| instance oldClass |
-    
-    oldClass := builder copyClass: ObjectMock named: 'ObjectMock2'.
-    instance := (Smalltalk  current at: 'ObjectMock2') new.
-    
-    "Change the superclass of ObjectMock2"
-    ObjectMock subclass: (Smalltalk current at: 'ObjectMock2')
-    	instanceVariableNames: ''
-        package: 'Kernel-Tests'.
-    
-    self deny: oldClass == ObjectMock2.
-    
+	
+	oldClass := builder copyClass: ObjectMock named: 'ObjectMock2'.
+	instance := (Smalltalk	current at: 'ObjectMock2') new.
+	
+	"Change the superclass of ObjectMock2"
+	ObjectMock subclass: (Smalltalk current at: 'ObjectMock2')
+		instanceVariableNames: ''
+		package: 'Kernel-Tests'.
+	
+	self deny: oldClass == ObjectMock2.
+	
 	self assert: ObjectMock2 superclass == ObjectMock.
 	self assert: ObjectMock2 superclass == ObjectMock.
 	self assert: ObjectMock2 instanceVariableNames isEmpty.
 	self assert: ObjectMock2 instanceVariableNames isEmpty.
 	self assert: ObjectMock2 selectors equals: oldClass selectors.
 	self assert: ObjectMock2 selectors equals: oldClass selectors.
-    self assert: ObjectMock2 comment equals: oldClass comment.
-    self assert: ObjectMock2 package name equals: 'Kernel-Tests'.
-    
+	self assert: ObjectMock2 comment equals: oldClass comment.
+	self assert: ObjectMock2 package name equals: 'Kernel-Tests'.
+	
 	self deny: instance class == ObjectMock2.
 	self deny: instance class == ObjectMock2.
-    "Commeting this out. Tests implementation detail."
-    "self assert: instance class name equals: 'OldObjectMock2'."
-    
+	"Commeting this out. Tests implementation detail."
+	"self assert: instance class name equals: 'OldObjectMock2'."
+	
 	self assert: (Smalltalk current at: instance class name) isNil.
 	self assert: (Smalltalk current at: instance class name) isNil.
-    
-    Smalltalk current removeClass: ObjectMock2
+	
+	Smalltalk current removeClass: ObjectMock2
 !
 !
 
 
 testClassMigrationWithClassInstanceVariables
 testClassMigrationWithClassInstanceVariables
-    
-    builder copyClass: ObjectMock named: 'ObjectMock2'.
-    ObjectMock2 class instanceVariableNames: 'foo bar'.
-    
-    "Change the superclass of ObjectMock2"
-    ObjectMock subclass: (Smalltalk current at: 'ObjectMock2')
-    	instanceVariableNames: ''
-        package: 'Kernel-Tests'.
-    
-    self assert: ObjectMock2 class instanceVariableNames equals: #('foo' 'bar').
-    
-    Smalltalk current removeClass: ObjectMock2
+	
+	builder copyClass: ObjectMock named: 'ObjectMock2'.
+	ObjectMock2 class instanceVariableNames: 'foo bar'.
+	
+	"Change the superclass of ObjectMock2"
+	ObjectMock subclass: (Smalltalk current at: 'ObjectMock2')
+		instanceVariableNames: ''
+		package: 'Kernel-Tests'.
+	
+	self assert: ObjectMock2 class instanceVariableNames equals: #('foo' 'bar').
+	
+	Smalltalk current removeClass: ObjectMock2
 !
 !
 
 
 testClassMigrationWithSubclasses
 testClassMigrationWithSubclasses
-    
-    builder copyClass: ObjectMock named: 'ObjectMock2'.
-    ObjectMock2 subclass: 'ObjectMock3' instanceVariableNames: '' package: 'Kernel-Tests'.
-    ObjectMock3 subclass: 'ObjectMock4' instanceVariableNames: '' package: 'Kernel-Tests'.
-    
-    "Change the superclass of ObjectMock2"
-    ObjectMock subclass: (Smalltalk current at: 'ObjectMock2')
-    	instanceVariableNames: ''
-        package: 'Kernel-Tests'.
-    
-    self assert: (ObjectMock subclasses includes: ObjectMock2).
-    self assert: (ObjectMock2 subclasses includes: ObjectMock3).
-    self assert: (ObjectMock3 subclasses includes: ObjectMock4).
-    
-    ObjectMock allSubclasses do: [ :each | Smalltalk current removeClass: each ]
+	
+	builder copyClass: ObjectMock named: 'ObjectMock2'.
+	ObjectMock2 subclass: 'ObjectMock3' instanceVariableNames: '' package: 'Kernel-Tests'.
+	ObjectMock3 subclass: 'ObjectMock4' instanceVariableNames: '' package: 'Kernel-Tests'.
+	
+	"Change the superclass of ObjectMock2"
+	ObjectMock subclass: (Smalltalk current at: 'ObjectMock2')
+		instanceVariableNames: ''
+		package: 'Kernel-Tests'.
+	
+	self assert: (ObjectMock subclasses includes: ObjectMock2).
+	self assert: (ObjectMock2 subclasses includes: ObjectMock3).
+	self assert: (ObjectMock3 subclasses includes: ObjectMock4).
+	
+	ObjectMock allSubclasses do: [ :each | Smalltalk current removeClass: each ]
 !
 !
 
 
 testInstanceVariableNames
 testInstanceVariableNames
@@ -344,14 +344,14 @@ isCollectionReadOnly
 !CollectionTest methodsFor: 'tests'!
 !CollectionTest methodsFor: 'tests'!
 
 
 testAsArray
 testAsArray
-	self 
-		assertSameContents: self collection 
+	self
+		assertSameContents: self collection
 		as: self collection asArray
 		as: self collection asArray
 !
 !
 
 
 testAsOrderedCollection
 testAsOrderedCollection
-	self 
-		assertSameContents: self collection 
+	self
+		assertSameContents: self collection
 		as: self collection asOrderedCollection
 		as: self collection asOrderedCollection
 !
 !
 
 
@@ -366,8 +366,8 @@ testAsSet
 
 
 testCollect
 testCollect
 	| newCollection |
 	| newCollection |
-	newCollection :=  #(1 2 3 4).
-	self 
+	newCollection := #(1 2 3 4).
+	self
 		assertSameContents: (self collection collect: [ :each |
 		assertSameContents: (self collection collect: [ :each |
 			each abs ])
 			each abs ])
 		as: newCollection
 		as: newCollection
@@ -375,7 +375,7 @@ testCollect
 
 
 testDetect
 testDetect
 	self assert: (self collection detect: [ :each | each < 0 ]) equals: -4.
 	self assert: (self collection detect: [ :each | each < 0 ]) equals: -4.
-	self 
+	self
 		should: [ self collection detect: [ :each | each = 6 ] ]
 		should: [ self collection detect: [ :each | each = 6 ] ]
 		raise: Error
 		raise: Error
 !
 !
@@ -385,8 +385,8 @@ testDo
 	newCollection := OrderedCollection new.
 	newCollection := OrderedCollection new.
 	self collection do: [ :each |
 	self collection do: [ :each |
 		newCollection add: each ].
 		newCollection add: each ].
-	self 
-		assertSameContents: self collection 
+	self
+		assertSameContents: self collection
 		as: newCollection
 		as: newCollection
 !
 !
 
 
@@ -398,7 +398,7 @@ testIsEmpty
 testSelect
 testSelect
 	| newCollection |
 	| newCollection |
 	newCollection := #(2 -4).
 	newCollection := #(2 -4).
-	self 
+	self
 		assertSameContents: (self collection select: [ :each |
 		assertSameContents: (self collection select: [ :each |
 			each even ])
 			each even ])
 		as: newCollection
 		as: newCollection
@@ -578,59 +578,59 @@ testPointKey
 	| d |
 	| d |
 
 
 	d := Dictionary new.
 	d := Dictionary new.
-    
-    d at: 1@1 put: 'foo'.
+	
+	d at: 1@1 put: 'foo'.
 	self assert: (d at: 1@1) equals: 'foo'.
 	self assert: (d at: 1@1) equals: 'foo'.
-    d at: 1@1 put: 'bar'.
+	d at: 1@1 put: 'bar'.
 	self assert: (d at: 1@1) equals: 'bar'.
 	self assert: (d at: 1@1) equals: 'bar'.
-    d removeKey: 1@1.
-    self assert: (d at: 1@1 ifAbsent: [ 'baz' ]) equals: 'baz'.
-    self deny: (d includesKey: 1@1)
+	d removeKey: 1@1.
+	self assert: (d at: 1@1 ifAbsent: [ 'baz' ]) equals: 'baz'.
+	self deny: (d includesKey: 1@1)
 !
 !
 
 
 testPrintString
 testPrintString
 	self
 	self
-		assert: (Dictionary new 
-                         	at:'firstname' put: 'James';
-                        	at:'lastname' put: 'Bond';
-                        	printString)
+		assert: (Dictionary new
+							at:'firstname' put: 'James';
+							at:'lastname' put: 'Bond';
+							printString)
 		equals: 'a Dictionary(''firstname''->''James'' , ''lastname''->''Bond'')'
 		equals: 'a Dictionary(''firstname''->''James'' , ''lastname''->''Bond'')'
 !
 !
 
 
 testRemoveKey
 testRemoveKey
-    | d key |
+	| d key |
 
 
-    d := Dictionary new.
-    d at: 1 put: 2.
-    d at: 2 put: 3.
-    d at: 3 put: 4.
+	d := Dictionary new.
+	d at: 1 put: 2.
+	d at: 2 put: 3.
+	d at: 3 put: 4.
 
 
-    key := 2.
+	key := 2.
 
 
-    self assert: d keys equals: #(1 2 3).
+	self assert: d keys equals: #(1 2 3).
 
 
-    d removeKey: key.
-    self assert: d keys equals: #(1 3).
-    self assert: d values equals: #(2 4).
-    self deny: (d includesKey: 2)
+	d removeKey: key.
+	self assert: d keys equals: #(1 3).
+	self assert: d values equals: #(2 4).
+	self deny: (d includesKey: 2)
 !
 !
 
 
 testRemoveKeyIfAbsent
 testRemoveKeyIfAbsent
-    | d key |
+	| d key |
 
 
-    d := Dictionary new.
-    d at: 1 put: 2.
-    d at: 2 put: 3.
-    d at: 3 put: 4.
+	d := Dictionary new.
+	d at: 1 put: 2.
+	d at: 2 put: 3.
+	d at: 3 put: 4.
 
 
-    key := 2.
-    self assert: (d removeKey: key) equals: 3.
+	key := 2.
+	self assert: (d removeKey: key) equals: 3.
 
 
-    key := 3.
-    self assert: (d removeKey: key ifAbsent: [42]) equals: 4.
+	key := 3.
+	self assert: (d removeKey: key ifAbsent: [42]) equals: 4.
 
 
-    key := 'why'.
-    self assert: (d removeKey: key ifAbsent: [42] ) equals: 42.
+	key := 'why'.
+	self assert: (d removeKey: key ifAbsent: [42] ) equals: 42.
 !
 !
 
 
 testSize
 testSize
@@ -764,21 +764,21 @@ testAtPut
 testCollect
 testCollect
 	| newCollection |
 	| newCollection |
 	newCollection := 'hheelllloo'.
 	newCollection := 'hheelllloo'.
-	self 
+	self
 		assertSameContents: (self collection collect: [ :each |
 		assertSameContents: (self collection collect: [ :each |
 			each, each ])
 			each, each ])
 		as: newCollection
 		as: newCollection
 !
 !
 
 
 testCopyWithoutAll
 testCopyWithoutAll
-	self 
+	self
 		assert: ('*hello* *world*' copyWithoutAll: '*')
 		assert: ('*hello* *world*' copyWithoutAll: '*')
-        equals: 'hello world'
+		equals: 'hello world'
 !
 !
 
 
 testDetect
 testDetect
 	self assert: (self collection detect: [ :each | each = 'h' ]) equals: 'h'.
 	self assert: (self collection detect: [ :each | each = 'h' ]) equals: 'h'.
-	self 
+	self
 		should: [ self collection detect: [ :each | each = 6 ] ]
 		should: [ self collection detect: [ :each | each = 6 ] ]
 		raise: Error
 		raise: Error
 !
 !
@@ -787,7 +787,7 @@ testEquality
 	self assert: 'hello' equals: 'hello'.
 	self assert: 'hello' equals: 'hello'.
 	self deny: 'hello' = 'world'.
 	self deny: 'hello' = 'world'.
 
 
-	self assert: 'hello'  equals: 'hello' yourself.
+	self assert: 'hello' equals: 'hello' yourself.
 	self assert: 'hello' yourself equals: 'hello'.
 	self assert: 'hello' yourself equals: 'hello'.
 
 
 	"test JS falsy value"
 	"test JS falsy value"
@@ -817,7 +817,7 @@ testJoin
 testSelect
 testSelect
 	| newCollection |
 	| newCollection |
 	newCollection := 'o'.
 	newCollection := 'o'.
-	self 
+	self
 		assertSameContents: (self collection select: [ :each |
 		assertSameContents: (self collection select: [ :each |
 			each = 'o' ])
 			each = 'o' ])
 		as: newCollection
 		as: newCollection
@@ -829,10 +829,10 @@ testSize
 !
 !
 
 
 testStreamContents
 testStreamContents
-	self 
-		assert: (String streamContents: [ :aStream | 
-			aStream 
-				nextPutAll: 'hello'; space; 
+	self
+		assert: (String streamContents: [ :aStream |
+			aStream
+				nextPutAll: 'hello'; space;
 				nextPutAll: 'world' ])
 				nextPutAll: 'world' ])
 		equals: 'hello world'
 		equals: 'hello world'
 ! !
 ! !
@@ -881,7 +881,7 @@ testAtPut
 testCollect
 testCollect
 	| newCollection |
 	| newCollection |
 	newCollection := #hheelllloo.
 	newCollection := #hheelllloo.
-	self 
+	self
 		assertSameContents: (self collection collect: [ :each |
 		assertSameContents: (self collection collect: [ :each |
 			each, each ])
 			each, each ])
 		as: newCollection
 		as: newCollection
@@ -908,7 +908,7 @@ testCopying
 
 
 testDetect
 testDetect
 	self assert: (self collection detect: [ :each | each = 'h' ]) equals: 'h'.
 	self assert: (self collection detect: [ :each | each = 'h' ]) equals: 'h'.
-	self 
+	self
 		should: [ self collection detect: [ :each | each = 'z' ] ]
 		should: [ self collection detect: [ :each | each = 'z' ] ]
 		raise: Error
 		raise: Error
 !
 !
@@ -928,7 +928,7 @@ testIdentity
 	self assert: #hello == #hello.
 	self assert: #hello == #hello.
 	self deny: #hello == #world.
 	self deny: #hello == #world.
 
 
-	self assert: #hello  = #hello yourself.
+	self assert: #hello	 = #hello yourself.
 	self assert: #hello yourself = #hello asString asSymbol
 	self assert: #hello yourself = #hello asString asSymbol
 !
 !
 
 
@@ -947,7 +947,7 @@ testIsSymbolIsString
 testSelect
 testSelect
 	| newCollection |
 	| newCollection |
 	newCollection := 'o'.
 	newCollection := 'o'.
-	self 
+	self
 		assertSameContents: (self collection select: [ :each |
 		assertSameContents: (self collection select: [ :each |
 			each = 'o' ])
 			each = 'o' ])
 		as: newCollection
 		as: newCollection
@@ -978,11 +978,11 @@ jsObject
 
 
 testAtIfAbsent
 testAtIfAbsent
 	| testObject |
 	| testObject |
-    testObject := self jsObject.
+	testObject := self jsObject.
 	self assert: (testObject at: 'abc' ifAbsent: ['Property does not exist']) equals: 'Property does not exist'.
 	self assert: (testObject at: 'abc' ifAbsent: ['Property does not exist']) equals: 'Property does not exist'.
 	self assert: (testObject at: 'e' ifAbsent: ['Property does not exist']) equals: nil.
 	self assert: (testObject at: 'e' ifAbsent: ['Property does not exist']) equals: nil.
-    self assert: (testObject at: 'a' ifAbsent: ['Property does not exist']) equals: 1.
-    self assert: (testObject at: 'f' ifAbsent: ['Property does not exist']) equals: nil.
+	self assert: (testObject at: 'a' ifAbsent: ['Property does not exist']) equals: 1.
+	self assert: (testObject at: 'f' ifAbsent: ['Property does not exist']) equals: nil.
 !
 !
 
 
 testDNU
 testDNU
@@ -1018,15 +1018,15 @@ testPropertyThatReturnsUndefined
 	| object |
 	| object |
 
 
 	object := self jsObject.
 	object := self jsObject.
-	self shouldnt: [ object e ]  raise: MessageNotUnderstood.
-    self assert: object e isNil
+	self shouldnt: [ object e ]	 raise: MessageNotUnderstood.
+	self assert: object e isNil
 !
 !
 
 
 testValue
 testValue
 	| testObject |
 	| testObject |
-    testObject := self jsObject.
+	testObject := self jsObject.
 	self assert: testObject value printString equals: '[object Object]'.
 	self assert: testObject value printString equals: '[object Object]'.
-    testObject at: 'value' put: 'aValue'.
+	testObject at: 'value' put: 'aValue'.
 	self assert: testObject value equals: 'aValue'
 	self assert: testObject value equals: 'aValue'
 !
 !
 
 
@@ -1053,8 +1053,8 @@ throwException
 
 
 testCatchingException
 testCatchingException
 	[ self throwException ]
 	[ self throwException ]
-  		on: Error
-        do: [ :error | 
+		on: Error
+		do: [ :error |
 			self assert: error exception = 'test' ]
 			self assert: error exception = 'test' ]
 !
 !
 
 
@@ -1075,7 +1075,7 @@ testAbs
 
 
 testArithmetic
 testArithmetic
 	
 	
-	"We rely on JS here, so we won't test complex behavior, just check if 
+	"We rely on JS here, so we won't test complex behavior, just check if
 	message sends are corrects"
 	message sends are corrects"
 
 
 	self assert: 1.5 + 1 equals: 2.5.
 	self assert: 1.5 + 1 equals: 2.5.
@@ -1149,46 +1149,46 @@ testIdentity
 testInvalidHexNumbers
 testInvalidHexNumbers
 
 
 	self should: [16rG] raise: MessageNotUnderstood.
 	self should: [16rG] raise: MessageNotUnderstood.
-   	self should: [16rg] raise: MessageNotUnderstood.
+	self should: [16rg] raise: MessageNotUnderstood.
 	self should: [16rH] raise: MessageNotUnderstood.
 	self should: [16rH] raise: MessageNotUnderstood.
-   	self should: [16rh] raise: MessageNotUnderstood.
+	self should: [16rh] raise: MessageNotUnderstood.
 	self should: [16rI] raise: MessageNotUnderstood.
 	self should: [16rI] raise: MessageNotUnderstood.
-   	self should: [16ri] raise: MessageNotUnderstood.
+	self should: [16ri] raise: MessageNotUnderstood.
 	self should: [16rJ] raise: MessageNotUnderstood.
 	self should: [16rJ] raise: MessageNotUnderstood.
-   	self should: [16rj] raise: MessageNotUnderstood.
+	self should: [16rj] raise: MessageNotUnderstood.
 	self should: [16rK] raise: MessageNotUnderstood.
 	self should: [16rK] raise: MessageNotUnderstood.
-   	self should: [16rk] raise: MessageNotUnderstood.
+	self should: [16rk] raise: MessageNotUnderstood.
 	self should: [16rL] raise: MessageNotUnderstood.
 	self should: [16rL] raise: MessageNotUnderstood.
-   	self should: [16rl] raise: MessageNotUnderstood.
+	self should: [16rl] raise: MessageNotUnderstood.
 	self should: [16rM] raise: MessageNotUnderstood.
 	self should: [16rM] raise: MessageNotUnderstood.
-   	self should: [16rm] raise: MessageNotUnderstood.
+	self should: [16rm] raise: MessageNotUnderstood.
 	self should: [16rN] raise: MessageNotUnderstood.
 	self should: [16rN] raise: MessageNotUnderstood.
-   	self should: [16rn] raise: MessageNotUnderstood.
+	self should: [16rn] raise: MessageNotUnderstood.
 	self should: [16rO] raise: MessageNotUnderstood.
 	self should: [16rO] raise: MessageNotUnderstood.
-   	self should: [16ro] raise: MessageNotUnderstood.
+	self should: [16ro] raise: MessageNotUnderstood.
 	self should: [16rP] raise: MessageNotUnderstood.
 	self should: [16rP] raise: MessageNotUnderstood.
-   	self should: [16rp] raise: MessageNotUnderstood.
+	self should: [16rp] raise: MessageNotUnderstood.
 	self should: [16rQ] raise: MessageNotUnderstood.
 	self should: [16rQ] raise: MessageNotUnderstood.
-   	self should: [16rq] raise: MessageNotUnderstood.
+	self should: [16rq] raise: MessageNotUnderstood.
 	self should: [16rR] raise: MessageNotUnderstood.
 	self should: [16rR] raise: MessageNotUnderstood.
-   	self should: [16rr] raise: MessageNotUnderstood.
+	self should: [16rr] raise: MessageNotUnderstood.
 	self should: [16rS] raise: MessageNotUnderstood.
 	self should: [16rS] raise: MessageNotUnderstood.
-   	self should: [16rs] raise: MessageNotUnderstood.
+	self should: [16rs] raise: MessageNotUnderstood.
 	self should: [16rT] raise: MessageNotUnderstood.
 	self should: [16rT] raise: MessageNotUnderstood.
-   	self should: [16rt] raise: MessageNotUnderstood.
+	self should: [16rt] raise: MessageNotUnderstood.
 	self should: [16rU] raise: MessageNotUnderstood.
 	self should: [16rU] raise: MessageNotUnderstood.
-   	self should: [16ru] raise: MessageNotUnderstood.
+	self should: [16ru] raise: MessageNotUnderstood.
 	self should: [16rV] raise: MessageNotUnderstood.
 	self should: [16rV] raise: MessageNotUnderstood.
-   	self should: [16rv] raise: MessageNotUnderstood.
+	self should: [16rv] raise: MessageNotUnderstood.
 	self should: [16rW] raise: MessageNotUnderstood.
 	self should: [16rW] raise: MessageNotUnderstood.
-   	self should: [16rw] raise: MessageNotUnderstood.
+	self should: [16rw] raise: MessageNotUnderstood.
 	self should: [16rX] raise: MessageNotUnderstood.
 	self should: [16rX] raise: MessageNotUnderstood.
-   	self should: [16rx] raise: MessageNotUnderstood.
+	self should: [16rx] raise: MessageNotUnderstood.
 	self should: [16rY] raise: MessageNotUnderstood.
 	self should: [16rY] raise: MessageNotUnderstood.
-   	self should: [16ry] raise: MessageNotUnderstood.
+	self should: [16ry] raise: MessageNotUnderstood.
 	self should: [16rZ] raise: MessageNotUnderstood.
 	self should: [16rZ] raise: MessageNotUnderstood.
-   	self should: [16rz] raise: MessageNotUnderstood.
-    self should: [16rABcdEfZ] raise: MessageNotUnderstood.
+	self should: [16rz] raise: MessageNotUnderstood.
+	self should: [16rABcdEfZ] raise: MessageNotUnderstood.
 !
 !
 
 
 testMinMax
 testMinMax
@@ -1388,7 +1388,7 @@ setUp
 	Package resetCommitPaths.
 	Package resetCommitPaths.
 
 
 	zorkPackage := Package new name: 'Zork'.
 	zorkPackage := Package new name: 'Zork'.
-	grulPackage := Package new 
+	grulPackage := Package new
 					name: 'Grul';
 					name: 'Grul';
 					commitPathJs: 'server/grul/js';
 					commitPathJs: 'server/grul/js';
 					commitPathSt: 'grul/st';
 					commitPathSt: 'grul/st';
@@ -1396,7 +1396,7 @@ setUp
 !
 !
 
 
 tearDown
 tearDown
-	 Package 
+	 Package
 		defaultCommitPathJs: backUpCommitPathJs;
 		defaultCommitPathJs: backUpCommitPathJs;
 		defaultCommitPathSt: backUpCommitPathSt
 		defaultCommitPathSt: backUpCommitPathSt
 ! !
 ! !
@@ -1502,7 +1502,7 @@ TestCase subclass: #RandomTest
 textNext
 textNext
 
 
 	10000 timesRepeat: [
 	10000 timesRepeat: [
-			| current next | 
+			| current next |
 			next := Random new next.
 			next := Random new next.
 			self assert: (next >= 0).
 			self assert: (next >= 0).
 			self assert: (next < 1).
 			self assert: (next < 1).
@@ -1542,9 +1542,9 @@ testCollect
 
 
 testComparing
 testComparing
 	self assert: #(0 2) asSet equals: #(0 2) asSet.
 	self assert: #(0 2) asSet equals: #(0 2) asSet.
-    self assert: #(2 0) asSet equals: #(0 2) asSet.
-    self deny: #(0 2 3) asSet = #(0 2) asSet.
-    self deny: #(1 2) asSet = #(0 2) asSet
+	self assert: #(2 0) asSet equals: #(0 2) asSet.
+	self deny: #(0 2 3) asSet = #(0 2) asSet.
+	self deny: #(1 2) asSet = #(0 2) asSet
 !
 !
 
 
 testPrintString
 testPrintString

+ 6 - 6
st/Kernel-Transcript.st

@@ -37,15 +37,15 @@ Transcript class instanceVariableNames: 'current'!
 !Transcript class methodsFor: 'instance creation'!
 !Transcript class methodsFor: 'instance creation'!
 
 
 current
 current
-    ^current
+	^current
 !
 !
 
 
 new
 new
-    self shouldNotImplement
+	self shouldNotImplement
 !
 !
 
 
 open
 open
-    self current open
+	self current open
 !
 !
 
 
 register: aTranscript
 register: aTranscript
@@ -55,14 +55,14 @@ register: aTranscript
 !Transcript class methodsFor: 'printing'!
 !Transcript class methodsFor: 'printing'!
 
 
 clear
 clear
-    self current clear
+	self current clear
 !
 !
 
 
 cr
 cr
-    self current show: String cr
+	self current show: String cr
 !
 !
 
 
 show: anObject
 show: anObject
-    self current show: anObject
+	self current show: anObject
 ! !
 ! !
 
 

+ 40 - 40
st/SUnit-Tests.st

@@ -27,11 +27,11 @@ testGrow
 !
 !
 
 
 testIllegal
 testIllegal
-	self 
-		should: [empty at: 5] 
+	self
+		should: [empty at: 5]
 		raise: Error.
 		raise: Error.
-	self 
-		should: [empty at: 5 put: #abc] 
+	self
+		should: [empty at: 5 put: #abc]
 		raise: Error
 		raise: Error
 !
 !
 
 
@@ -62,40 +62,40 @@ TestCase subclass: #SUnitAsyncTest
 fakeError
 fakeError
 	flag := 'bad'.
 	flag := 'bad'.
 	self timeout: 10.
 	self timeout: 10.
-    flag := (self async: [ flag := 'ok'. self error: 'Intentional' ]) valueWithTimeout: 5
+	flag := (self async: [ flag := 'ok'. self error: 'Intentional' ]) valueWithTimeout: 5
 !
 !
 
 
 fakeErrorFailingInTearDown
 fakeErrorFailingInTearDown
 	flag := 'bad'.
 	flag := 'bad'.
 	self timeout: 10.
 	self timeout: 10.
-    flag := (self async: [ self error: 'Intentional' ]) valueWithTimeout: 5
+	flag := (self async: [ self error: 'Intentional' ]) valueWithTimeout: 5
 !
 !
 
 
 fakeFailure
 fakeFailure
 	flag := 'bad'.
 	flag := 'bad'.
 	self timeout: 10.
 	self timeout: 10.
-    flag := (self async: [ flag := 'ok'. self assert: false ]) valueWithTimeout: 5
+	flag := (self async: [ flag := 'ok'. self assert: false ]) valueWithTimeout: 5
 !
 !
 
 
 fakeMultipleTimeoutFailing
 fakeMultipleTimeoutFailing
 	self timeout: 100.
 	self timeout: 100.
-    (self async: [
+	(self async: [
 		self timeout: 5.
 		self timeout: 5.
-        (self async: [ self finished ]) valueWithTimeout: 10
+		(self async: [ self finished ]) valueWithTimeout: 10
 	]) valueWithTimeout: 5
 	]) valueWithTimeout: 5
 !
 !
 
 
 fakeMultipleTimeoutPassing
 fakeMultipleTimeoutPassing
 	self timeout: 10.
 	self timeout: 10.
-    (self async: [
+	(self async: [
 		self timeout: 20.
 		self timeout: 20.
-        (self async: [ self finished ]) valueWithTimeout: 10
+		(self async: [ self finished ]) valueWithTimeout: 10
 	]) valueWithTimeout: 5
 	]) valueWithTimeout: 5
 !
 !
 
 
 fakeTimeout
 fakeTimeout
 	self timeout: 4.
 	self timeout: 4.
-    (self async: [ self finished ]) valueWithTimeout: 5
+	(self async: [ self finished ]) valueWithTimeout: 5
 ! !
 ! !
 
 
 !SUnitAsyncTest methodsFor: 'private'!
 !SUnitAsyncTest methodsFor: 'private'!
@@ -119,59 +119,59 @@ tearDown
 testAsyncErrorsAndFailures
 testAsyncErrorsAndFailures
 	| suite runner result assertBlock |
 	| suite runner result assertBlock |
 	suite := #('fakeError' 'fakeErrorFailingInTearDown' 'fakeFailure' 'testPass') collect: [ :each | self class selector: each ].
 	suite := #('fakeError' 'fakeErrorFailingInTearDown' 'fakeFailure' 'testPass') collect: [ :each | self class selector: each ].
-    runner := TestSuiteRunner on: suite.
-    self timeout: 200.
+	runner := TestSuiteRunner on: suite.
+	self timeout: 200.
 	result := runner result.
 	result := runner result.
-    assertBlock := self async: [
+	assertBlock := self async: [
 		self assert: (self selectorSetOf: result errors) equals: #('fakeError') asSet.
 		self assert: (self selectorSetOf: result errors) equals: #('fakeError') asSet.
 		self assert: (self selectorSetOf: result failures) equals: #('fakeErrorFailingInTearDown' 'fakeFailure') asSet.
 		self assert: (self selectorSetOf: result failures) equals: #('fakeErrorFailingInTearDown' 'fakeFailure') asSet.
 		self finished
 		self finished
-  	].
-    runner announcer on: ResultAnnouncement do: [:ann |
-    	ann result == result  ifTrue: [ result runs = result total ifTrue: assertBlock ]].
+	].
+	runner announcer on: ResultAnnouncement do: [:ann |
+		ann result == result ifTrue: [ result runs = result total ifTrue: assertBlock ]].
 	runner run
 	runner run
 !
 !
 
 
 testAsyncNeedsTimeout
 testAsyncNeedsTimeout
-    self should: [ self async: [ ] ] raise: Error.
-    self timeout: 0.
-    self shouldnt: [ self async: [ ] ] raise: Error.
-    self finished
+	self should: [ self async: [ ] ] raise: Error.
+	self timeout: 0.
+	self shouldnt: [ self async: [ ] ] raise: Error.
+	self finished
 !
 !
 
 
 testFinishedNeedsTimeout
 testFinishedNeedsTimeout
-    self should: [ self finished ] raise: Error.
-    self timeout: 0.
-    self shouldnt: [ self finished ] raise: Error.
+	self should: [ self finished ] raise: Error.
+	self timeout: 0.
+	self shouldnt: [ self finished ] raise: Error.
 !
 !
 
 
 testIsAsyncReturnsCorrectValues
 testIsAsyncReturnsCorrectValues
-    self deny: self isAsync.
-    self timeout: 0.
-    self assert: self isAsync.
-    self finished.
-    self deny: self isAsync
+	self deny: self isAsync.
+	self timeout: 0.
+	self assert: self isAsync.
+	self finished.
+	self deny: self isAsync
 !
 !
 
 
 testPass
 testPass
 	flag := 'bad'.
 	flag := 'bad'.
 	self timeout: 10.
 	self timeout: 10.
-    flag := (self async: [ self assert: true. self finished. flag := 'ok' ]) valueWithTimeout: 5
+	flag := (self async: [ self assert: true. self finished. flag := 'ok' ]) valueWithTimeout: 5
 !
 !
 
 
 testTimeouts
 testTimeouts
 	| suite runner result assertBlock |
 	| suite runner result assertBlock |
 	suite := #('fakeTimeout' 'fakeMultipleTimeoutFailing' 'fakeMultipleTimeoutPassing' 'testPass') collect: [ :each | self class selector: each ].
 	suite := #('fakeTimeout' 'fakeMultipleTimeoutFailing' 'fakeMultipleTimeoutPassing' 'testPass') collect: [ :each | self class selector: each ].
-    runner := TestSuiteRunner on: suite.
-    self timeout: 200.
+	runner := TestSuiteRunner on: suite.
+	self timeout: 200.
 	result := runner result.
 	result := runner result.
-    assertBlock := self async: [
+	assertBlock := self async: [
 		self assert: (self selectorSetOf: result errors) equals: Set new.
 		self assert: (self selectorSetOf: result errors) equals: Set new.
 		self assert: (self selectorSetOf: result failures) equals: #('fakeMultipleTimeoutFailing' 'fakeTimeout') asSet.
 		self assert: (self selectorSetOf: result failures) equals: #('fakeMultipleTimeoutFailing' 'fakeTimeout') asSet.
 		self finished
 		self finished
-  	].
-    runner announcer on: ResultAnnouncement do: [:ann |
-    	ann result == result  ifTrue: [ result runs = result total ifTrue: assertBlock ]].
+	].
+	runner announcer on: ResultAnnouncement do: [:ann |
+		ann result == result ifTrue: [ result runs = result total ifTrue: assertBlock ]].
 	runner run
 	runner run
 !
 !
 
 
@@ -179,8 +179,8 @@ testTwoAsyncPassesWithFinishedOnlyOneIsRun
 	| x |
 	| x |
 	flag := 'bad'.
 	flag := 'bad'.
 	self timeout: 10.
 	self timeout: 10.
-    x := 0.
-    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.
-    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.
+	x := 0.
+	flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.
+	flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.
 ! !
 ! !
 
 

+ 63 - 63
st/SUnit.st

@@ -17,14 +17,14 @@ Object subclass: #TestCase
 	instanceVariableNames: 'testSelector asyncTimeout context'
 	instanceVariableNames: 'testSelector asyncTimeout context'
 	package: 'SUnit'!
 	package: 'SUnit'!
 !TestCase commentStamp!
 !TestCase commentStamp!
-A TestCase is an implementation of the command pattern to run a test.  
+A TestCase is an implementation of the command pattern to run a test.
 
 
-`TestCase` instances are created with the class method `#selector:`, 
+`TestCase` instances are created with the class method `#selector:`,
 passing the symbol that names the method to be executed when the test case runs.
 passing the symbol that names the method to be executed when the test case runs.
 
 
-When you discover a new fixture, subclass `TestCase` and create a `#test...` method for the first test.  
-As that method develops and more `#test...` methods are added, you will find yourself refactoring temps 
-into instance variables for the objects in the fixture and overriding `#setUp` to initialize these variables.  
+When you discover a new fixture, subclass `TestCase` and create a `#test...` method for the first test. 
+As that method develops and more `#test...` methods are added, you will find yourself refactoring temps
+into instance variables for the objects in the fixture and overriding `#setUp` to initialize these variables.
 As required, override `#tearDown` to nil references, release objects and deallocate.!
 As required, override `#tearDown` to nil references, release objects and deallocate.!
 
 
 !TestCase methodsFor: 'accessing'!
 !TestCase methodsFor: 'accessing'!
@@ -46,8 +46,8 @@ setTestSelector: aSelector
 async: aBlock
 async: aBlock
 	| c |
 	| c |
 	self errorIfNotAsync: '#async'.
 	self errorIfNotAsync: '#async'.
-    c := context.
-    ^ [ self isAsync ifTrue: [ c execute: aBlock ] ]
+	c := context.
+	^ [ self isAsync ifTrue: [ c execute: aBlock ] ]
 !
 !
 
 
 finished
 finished
@@ -57,22 +57,22 @@ finished
 
 
 timeout: aNumber
 timeout: aNumber
 	"Set a grace time timeout in milliseconds to run the test asynchronously"
 	"Set a grace time timeout in milliseconds to run the test asynchronously"
-    
+	
 	asyncTimeout ifNotNil: [ asyncTimeout clearTimeout ].
 	asyncTimeout ifNotNil: [ asyncTimeout clearTimeout ].
-    
-     "to allow #async: message send without throwing an error"
+	
+	 "to allow #async: message send without throwing an error"
 	asyncTimeout := 0.
 	asyncTimeout := 0.
-    
-	asyncTimeout := (self async: [ 
-    	self assert: false description: 'SUnit grace time exhausted' ])
-        	valueWithTimeout: aNumber
+	
+	asyncTimeout := (self async: [
+		self assert: false description: 'SUnit grace time exhausted' ])
+			valueWithTimeout: aNumber
 ! !
 ! !
 
 
 !TestCase methodsFor: 'error handling'!
 !TestCase methodsFor: 'error handling'!
 
 
 errorIfNotAsync: aString
 errorIfNotAsync: aString
-	self isAsync ifFalse: [ 
-    	self error: aString, ' used without prior #timeout:' ]
+	self isAsync ifFalse: [
+		self error: aString, ' used without prior #timeout:' ]
 ! !
 ! !
 
 
 !TestCase methodsFor: 'private'!
 !TestCase methodsFor: 'private'!
@@ -129,14 +129,14 @@ should: aBlock
 !
 !
 
 
 should: aBlock raise: anExceptionClass
 should: aBlock raise: anExceptionClass
-	self assert: ([aBlock value. false] 
-		on: anExceptionClass 
+	self assert: ([aBlock value. false]
+		on: anExceptionClass
 		do: [:ex | true])
 		do: [:ex | true])
 !
 !
 
 
 shouldnt: aBlock raise: anExceptionClass
 shouldnt: aBlock raise: anExceptionClass
-	self assert: ([aBlock value. true] 
-		on: anExceptionClass 
+	self assert: ([aBlock value. true]
+		on: anExceptionClass
 		do: [:ex | false])
 		do: [:ex | false])
 ! !
 ! !
 
 
@@ -198,34 +198,34 @@ testCase: aTestCase
 
 
 execute: aBlock
 execute: aBlock
 	| failed |
 	| failed |
-    
-    testCase context: self.
-    [ 
-    	failed := true. 
-        aBlock value. 
-        failed := false 
-	] 
-    	ensure: [
-        	testCase context: nil.
-            
-        	(failed and: [ testCase isAsync ]) ifTrue: [ 
-            	testCase finished ].
-        	testCase isAsync ifFalse: [ 
-        		testCase tearDown ] ]
+	
+	testCase context: self.
+	[
+		failed := true.
+		aBlock value.
+		failed := false
+	]
+		ensure: [
+			testCase context: nil.
+			
+			(failed and: [ testCase isAsync ]) ifTrue: [
+				testCase finished ].
+			testCase isAsync ifFalse: [
+				testCase tearDown ] ]
 !
 !
 
 
 start
 start
-	self execute: [ 
-    	testCase setUp. 
-        testCase performTest ]
+	self execute: [
+		testCase setUp.
+		testCase performTest ]
 ! !
 ! !
 
 
 !TestContext class methodsFor: 'instance creation'!
 !TestContext class methodsFor: 'instance creation'!
 
 
 testCase: aTestCase
 testCase: aTestCase
 	^self new
 	^self new
-        testCase: aTestCase;
-        yourself
+		testCase: aTestCase;
+		yourself
 ! !
 ! !
 
 
 TestContext subclass: #ReportingTestContext
 TestContext subclass: #ReportingTestContext
@@ -252,41 +252,41 @@ result: aTestResult
 !ReportingTestContext methodsFor: 'private'!
 !ReportingTestContext methodsFor: 'private'!
 
 
 withErrorReporting: aBlock
 withErrorReporting: aBlock
- 	[ aBlock
-		on: TestFailure 
-		do: [ :ex | result addFailure: testCase ] 
+	[ aBlock
+		on: TestFailure
+		do: [ :ex | result addFailure: testCase ]
 	]
 	]
-    	on: Error 
-        do: [ :ex | result addError: testCase ]
+		on: Error
+		do: [ :ex | result addError: testCase ]
 ! !
 ! !
 
 
 !ReportingTestContext methodsFor: 'running'!
 !ReportingTestContext methodsFor: 'running'!
 
 
 execute: aBlock
 execute: aBlock
-    [ 
-    	self withErrorReporting: [ super execute: aBlock ] 
+	[
+		self withErrorReporting: [ super execute: aBlock ]
 	]
 	]
-    	ensure: [ 
-        	testCase isAsync ifFalse: [ 
-            	result increaseRuns. finished value ] ]
+		ensure: [
+			testCase isAsync ifFalse: [
+				result increaseRuns. finished value ] ]
 ! !
 ! !
 
 
 !ReportingTestContext class methodsFor: 'instance creation'!
 !ReportingTestContext class methodsFor: 'instance creation'!
 
 
 testCase: aTestCase result: aTestResult finished: aBlock
 testCase: aTestCase result: aTestResult finished: aBlock
 	^(super testCase: aTestCase)
 	^(super testCase: aTestCase)
-        result: aTestResult;
-        finished: aBlock;
-        yourself
+		result: aTestResult;
+		finished: aBlock;
+		yourself
 ! !
 ! !
 
 
 Error subclass: #TestFailure
 Error subclass: #TestFailure
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'SUnit'!
 	package: 'SUnit'!
 !TestFailure commentStamp!
 !TestFailure commentStamp!
-The test framework distinguishes between failures and errors.  
-A failure is an event whose possibiity is explicitly anticipated and checked for in an assertion, 
-whereas an error is an unanticipated problem like a division by 0 or an index out of bounds.  
+The test framework distinguishes between failures and errors.
+A failure is an event whose possibiity is explicitly anticipated and checked for in an assertion,
+whereas an error is an unanticipated problem like a division by 0 or an index out of bounds.
 
 
 TestFailure is raised when the boolean parameter of an #`assert:` or `#deny:` call is the opposite of what the assertion claims.!
 TestFailure is raised when the boolean parameter of an #`assert:` or `#deny:` call is the opposite of what the assertion claims.!
 
 
@@ -294,7 +294,7 @@ Object subclass: #TestResult
 	instanceVariableNames: 'timestamp runs errors failures total'
 	instanceVariableNames: 'timestamp runs errors failures total'
 	package: 'SUnit'!
 	package: 'SUnit'!
 !TestResult commentStamp!
 !TestResult commentStamp!
-A TestResult implements the collecting parameter pattern for running a bunch of tests.  
+A TestResult implements the collecting parameter pattern for running a bunch of tests.	
 
 
 A TestResult holds tests that have run, sorted into the result categories of passed, failures and errors.
 A TestResult holds tests that have run, sorted into the result categories of passed, failures and errors.
 
 
@@ -327,9 +327,9 @@ runs
 !
 !
 
 
 status
 status
-	^self errors isEmpty 
+	^self errors isEmpty
 		ifTrue: [
 		ifTrue: [
-			self failures isEmpty 
+			self failures isEmpty
 				ifTrue: ['success']
 				ifTrue: ['success']
 				ifFalse: ['failure']]
 				ifFalse: ['failure']]
 		ifFalse: ['error']
 		ifFalse: ['error']
@@ -369,7 +369,7 @@ or does nothing if no more runs"
 
 
 runCase: aTestCase
 runCase: aTestCase
 	[[	self increaseRuns.
 	[[	self increaseRuns.
-    	aTestCase runCase]
+		aTestCase runCase]
 	on: TestFailure do: [:ex | self addFailure: aTestCase]]
 	on: TestFailure do: [:ex | self addFailure: aTestCase]]
 	on: Error do: [:ex | self addError: aTestCase]
 	on: Error do: [:ex | self addError: aTestCase]
 ! !
 ! !
@@ -396,7 +396,7 @@ suite: aCollection
 
 
 resume
 resume
 	runNextTest fork.
 	runNextTest fork.
-    announcer announce: (ResultAnnouncement new result: result)
+	announcer announce: (ResultAnnouncement new result: result)
 !
 !
 
 
 run
 run
@@ -409,14 +409,14 @@ run
 initialize
 initialize
 	super initialize.
 	super initialize.
 	announcer := Announcer new.
 	announcer := Announcer new.
-    result := TestResult new.
-    runNextTest := [ | runs | runs := result runs. runs < result total ifTrue: [ (self contextOf: runs + 1) start ]].
+	result := TestResult new.
+	runNextTest := [ | runs | runs := result runs. runs < result total ifTrue: [ (self contextOf: runs + 1) start ]].
 ! !
 ! !
 
 
 !TestSuiteRunner methodsFor: 'private'!
 !TestSuiteRunner methodsFor: 'private'!
 
 
 contextOf: anInteger
 contextOf: anInteger
-   	^ReportingTestContext testCase: (suite at: anInteger) result: result finished: [ self resume ]
+	^ReportingTestContext testCase: (suite at: anInteger) result: result finished: [ self resume ]
 ! !
 ! !
 
 
 !TestSuiteRunner class methodsFor: 'instance creation'!
 !TestSuiteRunner class methodsFor: 'instance creation'!

+ 8 - 8
st/Spaces.st

@@ -10,13 +10,13 @@ The implementation creates an iframe on the same location as the window, and con
 
 
 ## Usage example:
 ## Usage example:
 
 
-    | space |
-    
-    space := ObjectSpace new.
-    space do: [ smalltalk ] "Answers aSmalltalk"
-    (space do: [ smalltalk ]) == smalltalk "Answers false"
-    
-    space release "Remove the object space environment"!
+	| space |
+	
+	space := ObjectSpace new.
+	space do: [ smalltalk ] "Answers aSmalltalk"
+	(space do: [ smalltalk ]) == smalltalk "Answers false"
+	
+	space release "Remove the object space environment"!
 
 
 !ObjectSpace methodsFor: 'accessing'!
 !ObjectSpace methodsFor: 'accessing'!
 
 
@@ -34,7 +34,7 @@ do: aBlock
 !ObjectSpace methodsFor: 'events'!
 !ObjectSpace methodsFor: 'events'!
 
 
 whenReadyDo: aBlock
 whenReadyDo: aBlock
-	(window jQuery: frame) 
+	(window jQuery: frame)
 		bind: 'load'
 		bind: 'load'
 		do: aBlock
 		do: aBlock
 ! !
 ! !

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