Browse Source

Cosmetic: no more "might not been initialized".

Herbert Vojčík 12 years ago
parent
commit
937d2ada37
3 changed files with 50 additions and 12 deletions
  1. 13 0
      js/Trapped-Tests.deploy.js
  2. 25 12
      js/Trapped-Tests.js
  3. 12 0
      st/Trapped-Tests.st

+ 13 - 0
js/Trapped-Tests.deploy.js

@@ -29,6 +29,7 @@ var $1,$2;
 var bb;
 var model;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", [(1), [(2), (5)]], "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])])]);
 $1=smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]);
 smalltalk.send($1,"_getBlock_",[(function(x){
@@ -57,6 +58,7 @@ var $1,$2;
 var bb;
 var model;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", [(1), [(2), (3)]], "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])])]);
 $1=smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]);
 smalltalk.send($1,"_getBlock_",[(function(x){
@@ -92,6 +94,7 @@ var self=this;
 var bb;
 var model;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", [(1), [(2), (3)]], "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])])]);
 model=smalltalk.send(smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]),"_getBlock_",[(function(x){
 return smalltalk.send(smalltalk.send(smalltalk.send(x,"_root",[]),"_at_",["foo"]),"_at_",[(2)]);
@@ -113,6 +116,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
 return smalltalk.send(r,"_second",[]);
@@ -134,6 +138,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(2), [(1), (0)]]]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
 result=r;
@@ -153,6 +158,8 @@ var self=this;
 var bb;
 var result;
 var newValue;
+result=nil;
+newValue=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
 newValue=r;
@@ -180,6 +187,7 @@ var self=this;
 var bb;
 var result;
 var newValue;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 newValue=smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
@@ -205,6 +213,7 @@ var self=this;
 var bb;
 var result;
 var newValue;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 newValue=smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
@@ -229,6 +238,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
 return smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]);
@@ -250,6 +260,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
 return smalltalk.send(smalltalk.send(r,"_at_",[(2)]),"_at_put_",[(1),(0)]);
@@ -271,6 +282,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (4)]]]);
 smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
 return smalltalk.send(r,"_at_put_",[(2),nil]);
@@ -292,6 +304,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
 result=r;

+ 25 - 12
js/Trapped-Tests.js

@@ -35,6 +35,7 @@ var $1,$2;
 var bb;
 var model;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", [(1), [(2), (5)]], "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])])]);
 $1=smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]);
 smalltalk.send($1,"_getBlock_",[(function(x){
@@ -51,7 +52,7 @@ return result;
 smalltalk.send(self,"_assert_equals_",[[(1), [(2), (5)]],result]);
 return self},
 args: [],
-source: "testNontrivialModelGetsAppropriateValueForModification\x0a| bb model result |\x0abb := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 5)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0abb model: model modify: [:r|result := r].\x0aself assert: #(1 #(2 5)) equals: result\x0a",
+source: "testNontrivialModelGetsAppropriateValueForModification\x0a| bb model result |\x0aresult := nil.\x0abb := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 5)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0abb model: model modify: [:r|result := r].\x0aself assert: #(1 #(2 5)) equals: result\x0a",
 messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "putBlock:", "at:put:", "model:modify:", "assert:equals:"],
 referencedClasses: ["Isolator", "EavModel"]
 }),
@@ -68,6 +69,7 @@ var $1,$2;
 var bb;
 var model;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", [(1), [(2), (3)]], "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])])]);
 $1=smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]);
 smalltalk.send($1,"_getBlock_",[(function(x){
@@ -92,7 +94,7 @@ return result;
 smalltalk.send(self,"_assert_equals_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", smalltalk.symbolFor("new"), "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])]),result]);
 return self},
 args: [],
-source: "testNontrivialModelModifiesAppropriateValue\x0a| bb model result |\x0abb := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0abb model: model modify: [:r|#new].\x0abb model: model read: [:r|result := r].\x0aself assert: #new equals: result.\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #{ 'foo' -> #('bar' #new 'baz'). 'moo' -> 'zoo' } equals: result\x0a",
+source: "testNontrivialModelModifiesAppropriateValue\x0a| bb model result |\x0aresult := nil.\x0abb := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0abb model: model modify: [:r|#new].\x0abb model: model read: [:r|result := r].\x0aself assert: #new equals: result.\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #{ 'foo' -> #('bar' #new 'baz'). 'moo' -> 'zoo' } equals: result\x0a",
 messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "putBlock:", "at:put:", "model:modify:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator", "EavModel"]
 }),
@@ -108,6 +110,7 @@ var self=this;
 var bb;
 var model;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", [(1), [(2), (3)]], "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])])]);
 model=smalltalk.send(smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]),"_getBlock_",[(function(x){
 return smalltalk.send(smalltalk.send(smalltalk.send(x,"_root",[]),"_at_",["foo"]),"_at_",[(2)]);
@@ -119,7 +122,7 @@ return result;
 smalltalk.send(self,"_assert_equals_",[[(1), [(2), (3)]],result]);
 return self},
 args: [],
-source: "testNontrivialModelReturnsAppropriateValue\x0a| bb model result |\x0abb := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new getBlock: [ :x | (x root at: 'foo') at: 2 ].\x0abb model: model read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result\x0a",
+source: "testNontrivialModelReturnsAppropriateValue\x0a| bb model result |\x0aresult := nil.\x0abb := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new getBlock: [ :x | (x root at: 'foo') at: 2 ].\x0abb model: model read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result\x0a",
 messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator", "EavModel"]
 }),
@@ -134,6 +137,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
 return smalltalk.send(r,"_second",[]);
@@ -145,7 +149,7 @@ return result;
 smalltalk.send(self,"_assert_equals_",[[(2), (3)],result]);
 return self},
 args: [],
-source: "testRootModelExaminesThenModifiesRoot\x0a| bb result |\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel modify: [:r|r second].\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #(2 3) equals: result\x0a",
+source: "testRootModelExaminesThenModifiesRoot\x0a| bb result |\x0aresult := nil.\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel modify: [:r|r second].\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #(2 3) equals: result\x0a",
 messageSends: ["on:", "model:modify:", "second", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
@@ -160,6 +164,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(2), [(1), (0)]]]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
 result=r;
@@ -168,7 +173,7 @@ return result;
 smalltalk.send(self,"_assert_equals_",[[(2), [(1), (0)]],result]);
 return self},
 args: [],
-source: "testRootModelGetsRootForModification\x0a| bb result |\x0abb := Isolator on: #(2 #(1 0)).\x0abb model: rootModel modify: [:r|result := r].\x0aself assert: #(2 #(1 0)) equals: result\x0a",
+source: "testRootModelGetsRootForModification\x0a| bb result |\x0aresult := nil.\x0abb := Isolator on: #(2 #(1 0)).\x0abb model: rootModel modify: [:r|result := r].\x0aself assert: #(2 #(1 0)) equals: result\x0a",
 messageSends: ["on:", "model:modify:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
@@ -184,6 +189,8 @@ var self=this;
 var bb;
 var result;
 var newValue;
+result=nil;
+newValue=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
 newValue=r;
@@ -200,7 +207,7 @@ smalltalk.send(newValue,"_at_put_",[(2),"baz"]);
 smalltalk.send(self,"_assert_equals_",[[(4), [(2), (3)]],result]);
 return self},
 args: [],
-source: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot\x0a| bb result newValue |\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel modify: [:r|newValue := r. r at: 1 put: 4. r].\x0anewValue at: 2 put: 'bar'.\x0abb model: rootModel read: [:r|result := r].\x0anewValue at: 2 put: 'baz'.\x0aself assert: #(4 #(2 3)) equals: result\x0a",
+source: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot\x0a| bb result newValue |\x0aresult := nil. newValue := nil.\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel modify: [:r|newValue := r. r at: 1 put: 4. r].\x0anewValue at: 2 put: 'bar'.\x0abb model: rootModel read: [:r|result := r].\x0anewValue at: 2 put: 'baz'.\x0aself assert: #(4 #(2 3)) equals: result\x0a",
 messageSends: ["on:", "model:modify:", "at:put:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
@@ -216,6 +223,7 @@ var self=this;
 var bb;
 var result;
 var newValue;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 newValue=smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
@@ -230,7 +238,7 @@ smalltalk.send(smalltalk.send(newValue,"_at_",["foo"]),"_at_put_",[(3),"baz"]);
 smalltalk.send(self,"_assert_equals_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]),result]);
 return self},
 args: [],
-source: "testRootModelModifiesAndDeeplyIsolatesRoot\x0a| bb result newValue |\x0abb := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0abb model: rootModel modify: [:r|newValue].\x0a(newValue at: 'foo') at: 1 put: 'bar'.\x0abb model: rootModel read: [:r|result := r].\x0a(newValue at: 'foo') at: 3 put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result\x0a",
+source: "testRootModelModifiesAndDeeplyIsolatesRoot\x0a| bb result newValue |\x0aresult := nil.\x0abb := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0abb model: rootModel modify: [:r|newValue].\x0a(newValue at: 'foo') at: 1 put: 'bar'.\x0abb model: rootModel read: [:r|result := r].\x0a(newValue at: 'foo') at: 3 put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result\x0a",
 messageSends: ["on:", "->", "model:modify:", "at:put:", "at:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
@@ -246,6 +254,7 @@ var self=this;
 var bb;
 var result;
 var newValue;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 newValue=smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
@@ -260,7 +269,7 @@ smalltalk.send(newValue,"_at_put_",["foo","baz"]);
 smalltalk.send(self,"_assert_equals_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]),result]);
 return self},
 args: [],
-source: "testRootModelModifiesAndIsolatesRoot\x0a| bb result newValue |\x0abb := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0abb model: rootModel modify: [:r|newValue].\x0anewValue at: 'foo' put: 'bar'.\x0abb model: rootModel read: [:r|result := r].\x0anewValue at: 'foo' put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result\x0a",
+source: "testRootModelModifiesAndIsolatesRoot\x0a| bb result newValue |\x0aresult := nil.\x0abb := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0abb model: rootModel modify: [:r|newValue].\x0anewValue at: 'foo' put: 'bar'.\x0abb model: rootModel read: [:r|result := r].\x0anewValue at: 'foo' put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result\x0a",
 messageSends: ["on:", "->", "model:modify:", "at:put:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
@@ -275,6 +284,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
 return smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]);
@@ -286,7 +296,7 @@ return result;
 smalltalk.send(self,"_assert_equals_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]),result]);
 return self},
 args: [],
-source: "testRootModelModifiesRoot\x0a| bb result |\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel modify: [:r|#{'foo'->#(4 5 6)}].\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #{'foo'->#(4 5 6)} equals: result\x0a",
+source: "testRootModelModifiesRoot\x0a| bb result |\x0aresult := nil.\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel modify: [:r|#{'foo'->#(4 5 6)}].\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #{'foo'->#(4 5 6)} equals: result\x0a",
 messageSends: ["on:", "model:modify:", "->", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
@@ -301,6 +311,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
 return smalltalk.send(smalltalk.send(r,"_at_",[(2)]),"_at_put_",[(1),(0)]);
@@ -312,7 +323,7 @@ return result;
 smalltalk.send(self,"_assert_equals_",[[(1), [(2), (3)]],result]);
 return self},
 args: [],
-source: "testRootModelReturnsDeeplyIsolatedRoot\x0a| bb result |\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel read: [:r|(r at: 2) at: 1 put: 0].\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result\x0a",
+source: "testRootModelReturnsDeeplyIsolatedRoot\x0a| bb result |\x0aresult := nil.\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel read: [:r|(r at: 2) at: 1 put: 0].\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result\x0a",
 messageSends: ["on:", "model:read:", "at:put:", "at:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
@@ -327,6 +338,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (4)]]]);
 smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
 return smalltalk.send(r,"_at_put_",[(2),nil]);
@@ -338,7 +350,7 @@ return result;
 smalltalk.send(self,"_assert_equals_",[[(1), [(2), (4)]],result]);
 return self},
 args: [],
-source: "testRootModelReturnsIsolatedRoot\x0a| bb result |\x0abb := Isolator on: #(1 #(2 4)).\x0abb model: rootModel read: [:r|r at: 2 put: nil].\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 4)) equals: result\x0a",
+source: "testRootModelReturnsIsolatedRoot\x0a| bb result |\x0aresult := nil.\x0abb := Isolator on: #(1 #(2 4)).\x0abb model: rootModel read: [:r|r at: 2 put: nil].\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 4)) equals: result\x0a",
 messageSends: ["on:", "model:read:", "at:put:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
@@ -353,6 +365,7 @@ fn: function (){
 var self=this;
 var bb;
 var result;
+result=nil;
 bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
 smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
 result=r;
@@ -361,7 +374,7 @@ return result;
 smalltalk.send(self,"_assert_equals_",[[(1), [(2), (3)]],result]);
 return self},
 args: [],
-source: "testRootModelReturnsRoot\x0a| bb result |\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result\x0a",
+source: "testRootModelReturnsRoot\x0a| bb result |\x0aresult := nil.\x0abb := Isolator on: #(1 #(2 3)).\x0abb model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result\x0a",
 messageSends: ["on:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),

+ 12 - 0
st/Trapped-Tests.st

@@ -16,6 +16,7 @@ rootModel := EavModel new
 
 testNontrivialModelGetsAppropriateValueForModification
 | bb model result |
+result := nil.
 bb := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 5)) 'baz'). 'moo' -> 'zoo' }.
 model := EavModel new
 	getBlock: [ :x | (x root at: 'foo') at: 2 ];
@@ -26,6 +27,7 @@ self assert: #(1 #(2 5)) equals: result
 
 testNontrivialModelModifiesAppropriateValue
 | bb model result |
+result := nil.
 bb := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.
 model := EavModel new
 	getBlock: [ :x | (x root at: 'foo') at: 2 ];
@@ -39,6 +41,7 @@ self assert: #{ 'foo' -> #('bar' #new 'baz'). 'moo' -> 'zoo' } equals: result
 
 testNontrivialModelReturnsAppropriateValue
 | bb model result |
+result := nil.
 bb := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.
 model := EavModel new getBlock: [ :x | (x root at: 'foo') at: 2 ].
 bb model: model read: [:r|result := r].
@@ -47,6 +50,7 @@ self assert: #(1 #(2 3)) equals: result
 
 testRootModelExaminesThenModifiesRoot
 | bb result |
+result := nil.
 bb := Isolator on: #(1 #(2 3)).
 bb model: rootModel modify: [:r|r second].
 bb model: rootModel read: [:r|result := r].
@@ -55,6 +59,7 @@ self assert: #(2 3) equals: result
 
 testRootModelGetsRootForModification
 | bb result |
+result := nil.
 bb := Isolator on: #(2 #(1 0)).
 bb model: rootModel modify: [:r|result := r].
 self assert: #(2 #(1 0)) equals: result
@@ -62,6 +67,7 @@ self assert: #(2 #(1 0)) equals: result
 
 testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot
 | bb result newValue |
+result := nil. newValue := nil.
 bb := Isolator on: #(1 #(2 3)).
 bb model: rootModel modify: [:r|newValue := r. r at: 1 put: 4. r].
 newValue at: 2 put: 'bar'.
@@ -72,6 +78,7 @@ self assert: #(4 #(2 3)) equals: result
 
 testRootModelModifiesAndDeeplyIsolatesRoot
 | bb result newValue |
+result := nil.
 bb := Isolator on: #(1 #(2 3)).
 newValue := #{'foo'->#(4 5 6)}.
 bb model: rootModel modify: [:r|newValue].
@@ -83,6 +90,7 @@ self assert: #{'foo'->#(4 5 6)} equals: result
 
 testRootModelModifiesAndIsolatesRoot
 | bb result newValue |
+result := nil.
 bb := Isolator on: #(1 #(2 3)).
 newValue := #{'foo'->#(4 5 6)}.
 bb model: rootModel modify: [:r|newValue].
@@ -94,6 +102,7 @@ self assert: #{'foo'->#(4 5 6)} equals: result
 
 testRootModelModifiesRoot
 | bb result |
+result := nil.
 bb := Isolator on: #(1 #(2 3)).
 bb model: rootModel modify: [:r|#{'foo'->#(4 5 6)}].
 bb model: rootModel read: [:r|result := r].
@@ -102,6 +111,7 @@ self assert: #{'foo'->#(4 5 6)} equals: result
 
 testRootModelReturnsDeeplyIsolatedRoot
 | bb result |
+result := nil.
 bb := Isolator on: #(1 #(2 3)).
 bb model: rootModel read: [:r|(r at: 2) at: 1 put: 0].
 bb model: rootModel read: [:r|result := r].
@@ -110,6 +120,7 @@ self assert: #(1 #(2 3)) equals: result
 
 testRootModelReturnsIsolatedRoot
 | bb result |
+result := nil.
 bb := Isolator on: #(1 #(2 4)).
 bb model: rootModel read: [:r|r at: 2 put: nil].
 bb model: rootModel read: [:r|result := r].
@@ -118,6 +129,7 @@ self assert: #(1 #(2 4)) equals: result
 
 testRootModelReturnsRoot
 | bb result |
+result := nil.
 bb := Isolator on: #(1 #(2 3)).
 bb model: rootModel read: [:r|result := r].
 self assert: #(1 #(2 3)) equals: result