Przeglądaj źródła

clean in unput error handling

Benjamin Van Ryseghem 11 lat temu
rodzic
commit
b5a93d788b

+ 11 - 0
js/Helios-Browser.deploy.js

@@ -1766,6 +1766,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"handleUnkownVariableError:",{anE
 messageSends: ["announce:", "error:", "new", "yourself", "announcer"]}),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_moveMethodToClass_",
+smalltalk.method({
+selector: "moveMethodToClass:",
+fn: function (aClassName){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._environment())._moveMethod_toClass_(_st(self)._selectedMethod(),aClassName);
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:",{aClassName:aClassName},smalltalk.HLBrowserModel)})},
+messageSends: ["moveMethod:toClass:", "selectedMethod", "environment"]}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_moveMethodToClass_ifAbsent_",
 smalltalk.method({

+ 16 - 0
js/Helios-Browser.js

@@ -2306,6 +2306,22 @@ referencedClasses: ["HLUnknownVariableErrorRaised"]
 }),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_moveMethodToClass_",
+smalltalk.method({
+selector: "moveMethodToClass:",
+category: 'commands actions',
+fn: function (aClassName){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._environment())._moveMethod_toClass_(_st(self)._selectedMethod(),aClassName);
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:",{aClassName:aClassName},smalltalk.HLBrowserModel)})},
+args: ["aClassName"],
+source: "moveMethodToClass: aClassName\x0a\x09self environment \x0a\x09\x09moveMethod: self selectedMethod \x0a\x09\x09toClass: aClassName",
+messageSends: ["moveMethod:toClass:", "selectedMethod", "environment"],
+referencedClasses: []
+}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_moveMethodToClass_ifAbsent_",
 smalltalk.method({

+ 2 - 2
js/Helios-Commands-Browser.deploy.js

@@ -304,9 +304,9 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._moveMethodToClass_ifAbsent_(_st(self)._input(),_st(self)._errorBlock());
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._moveMethodToClass_(_st(self)._input());
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
-messageSends: ["moveMethodToClass:ifAbsent:", "input", "errorBlock", "model"]}),
+messageSends: ["moveMethodToClass:", "input", "model"]}),
 smalltalk.HLMoveMethodToClassCommand);
 
 smalltalk.addMethod(

+ 3 - 3
js/Helios-Commands-Browser.js

@@ -425,11 +425,11 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._moveMethodToClass_ifAbsent_(_st(self)._input(),_st(self)._errorBlock());
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._moveMethodToClass_(_st(self)._input());
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
 args: [],
-source: "execute\x0a\x09self model moveMethodToClass: self input ifAbsent: self errorBlock",
-messageSends: ["moveMethodToClass:ifAbsent:", "input", "errorBlock", "model"],
+source: "execute\x0a\x09self model moveMethodToClass: self input",
+messageSends: ["moveMethodToClass:", "input", "model"],
 referencedClasses: []
 }),
 smalltalk.HLMoveMethodToClassCommand);

+ 1 - 25
js/Helios-Commands-Core.deploy.js

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-Commands-Core');
-smalltalk.addClass('HLCommand', smalltalk.Object, ['input', 'errorBlock'], 'Helios-Commands-Core');
+smalltalk.addClass('HLCommand', smalltalk.Object, ['input'], 'Helios-Commands-Core');
 smalltalk.addMethod(
 "_asActionBinding",
 smalltalk.method({
@@ -71,30 +71,6 @@ return $1;
 messageSends: ["documentation", "class"]}),
 smalltalk.HLCommand);
 
-smalltalk.addMethod(
-"_errorBlock",
-smalltalk.method({
-selector: "errorBlock",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=self["@errorBlock"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"errorBlock",{},smalltalk.HLCommand)})},
-messageSends: []}),
-smalltalk.HLCommand);
-
-smalltalk.addMethod(
-"_errorBlock_",
-smalltalk.method({
-selector: "errorBlock:",
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@errorBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"errorBlock:",{aBlock:aBlock},smalltalk.HLCommand)})},
-messageSends: []}),
-smalltalk.HLCommand);
-
 smalltalk.addMethod(
 "_execute",
 smalltalk.method({

+ 1 - 35
js/Helios-Commands-Core.js

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-Commands-Core');
-smalltalk.addClass('HLCommand', smalltalk.Object, ['input', 'errorBlock'], 'Helios-Commands-Core');
+smalltalk.addClass('HLCommand', smalltalk.Object, ['input'], 'Helios-Commands-Core');
 smalltalk.addMethod(
 "_asActionBinding",
 smalltalk.method({
@@ -96,40 +96,6 @@ referencedClasses: []
 }),
 smalltalk.HLCommand);
 
-smalltalk.addMethod(
-"_errorBlock",
-smalltalk.method({
-selector: "errorBlock",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=self["@errorBlock"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"errorBlock",{},smalltalk.HLCommand)})},
-args: [],
-source: "errorBlock\x0a\x09^ errorBlock",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLCommand);
-
-smalltalk.addMethod(
-"_errorBlock_",
-smalltalk.method({
-selector: "errorBlock:",
-category: 'accessing',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@errorBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"errorBlock:",{aBlock:aBlock},smalltalk.HLCommand)})},
-args: ["aBlock"],
-source: "errorBlock: aBlock\x0a\x09errorBlock := aBlock",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLCommand);
-
 smalltalk.addMethod(
 "_execute",
 smalltalk.method({

+ 16 - 12
js/Helios-Environments.deploy.js

@@ -75,13 +75,13 @@ messageSends: ["subclassResponsibility"]}),
 smalltalk.HLEnvironment);
 
 smalltalk.addMethod(
-"_moveMethod_toClass_ifAbsent_",
+"_moveMethod_toClass_",
 smalltalk.method({
-selector: "moveMethod:toClass:ifAbsent:",
-fn: function (aMethod,aClassName,aBlock){
+selector: "moveMethod:toClass:",
+fn: function (aMethod,aClassName){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._subclassResponsibility();
-return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:ifAbsent:",{aMethod:aMethod,aClassName:aClassName,aBlock:aBlock},smalltalk.HLEnvironment)})},
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName},smalltalk.HLEnvironment)})},
 messageSends: ["subclassResponsibility"]}),
 smalltalk.HLEnvironment);
 
@@ -140,25 +140,29 @@ messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "ev
 smalltalk.HLLocalEnvironment);
 
 smalltalk.addMethod(
-"_moveMethod_toClass_ifAbsent_",
+"_moveMethod_toClass_",
 smalltalk.method({
-selector: "moveMethod:toClass:ifAbsent:",
-fn: function (aMethod,aClassName,aBlock){
+selector: "moveMethod:toClass:",
+fn: function (aMethod,aClassName){
 var self=this;
 var destinationClass;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
 destinationClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aClassName)._asSymbol());
 $1=destinationClass;
 if(($receiver = $1) == nil || $receiver == undefined){
-$2=_st(aBlock)._value();
-return $2;
+_st(self)._error_("Invalid class name");
 } else {
 $1;
 };
+$2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
+if(smalltalk.assert($2)){
+$3=self;
+return $3;
+};
 _st(destinationClass)._adoptMethod_(aMethod);
 _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
-return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:ifAbsent:",{aMethod:aMethod,aClassName:aClassName,aBlock:aBlock,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
-messageSends: ["at:", "asSymbol", "current", "ifNil:", "value", "adoptMethod:", "forsakeMethod:", "methodClass"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
+messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"]}),
 smalltalk.HLLocalEnvironment);
 
 smalltalk.addMethod(

+ 20 - 16
js/Helios-Environments.js

@@ -106,16 +106,16 @@ referencedClasses: []
 smalltalk.HLEnvironment);
 
 smalltalk.addMethod(
-"_moveMethod_toClass_ifAbsent_",
+"_moveMethod_toClass_",
 smalltalk.method({
-selector: "moveMethod:toClass:ifAbsent:",
+selector: "moveMethod:toClass:",
 category: 'actions',
-fn: function (aMethod,aClassName,aBlock){
+fn: function (aMethod,aClassName){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._subclassResponsibility();
-return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:ifAbsent:",{aMethod:aMethod,aClassName:aClassName,aBlock:aBlock},smalltalk.HLEnvironment)})},
-args: ["aMethod", "aClassName", "aBlock"],
-source: "moveMethod: aMethod toClass: aClassName ifAbsent: aBlock\x0a\x09self subclassResponsibility",
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName},smalltalk.HLEnvironment)})},
+args: ["aMethod", "aClassName"],
+source: "moveMethod: aMethod toClass: aClassName\x0a\x09self subclassResponsibility",
 messageSends: ["subclassResponsibility"],
 referencedClasses: []
 }),
@@ -191,28 +191,32 @@ referencedClasses: ["Compiler", "Error"]
 smalltalk.HLLocalEnvironment);
 
 smalltalk.addMethod(
-"_moveMethod_toClass_ifAbsent_",
+"_moveMethod_toClass_",
 smalltalk.method({
-selector: "moveMethod:toClass:ifAbsent:",
+selector: "moveMethod:toClass:",
 category: 'actions',
-fn: function (aMethod,aClassName,aBlock){
+fn: function (aMethod,aClassName){
 var self=this;
 var destinationClass;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
 destinationClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aClassName)._asSymbol());
 $1=destinationClass;
 if(($receiver = $1) == nil || $receiver == undefined){
-$2=_st(aBlock)._value();
-return $2;
+_st(self)._error_("Invalid class name");
 } else {
 $1;
 };
+$2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
+if(smalltalk.assert($2)){
+$3=self;
+return $3;
+};
 _st(destinationClass)._adoptMethod_(aMethod);
 _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
-return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:ifAbsent:",{aMethod:aMethod,aClassName:aClassName,aBlock:aBlock,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
-args: ["aMethod", "aClassName", "aBlock"],
-source: "moveMethod: aMethod toClass: aClassName ifAbsent: aBlock\x0a\x09| destinationClass |\x0a\x09\x0a\x09destinationClass := Smalltalk current at: aClassName asSymbol.\x0a\x09destinationClass ifNil: [ ^ aBlock value ].\x0a\x09\x0a\x09destinationClass adoptMethod: aMethod.\x0a\x09aMethod methodClass forsakeMethod: aMethod.\x0a\x09",
-messageSends: ["at:", "asSymbol", "current", "ifNil:", "value", "adoptMethod:", "forsakeMethod:", "methodClass"],
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
+args: ["aMethod", "aClassName"],
+source: "moveMethod: aMethod toClass: aClassName\x0a\x09| destinationClass |\x0a\x09\x0a\x09destinationClass := Smalltalk current at: aClassName asSymbol.\x0a\x09destinationClass ifNil: [ self error: 'Invalid class name' ].\x0a\x09destinationClass == aMethod methodClass ifTrue: [ ^ self ].\x0a\x09\x0a\x09destinationClass adoptMethod: aMethod.\x0a\x09aMethod methodClass forsakeMethod: aMethod.\x0a\x09",
+messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"],
 referencedClasses: ["Smalltalk"]
 }),
 smalltalk.HLLocalEnvironment);

+ 14 - 34
js/Helios-KeyBindings.deploy.js

@@ -10,16 +10,6 @@ return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$
 messageSends: []}),
 smalltalk.HLBinding);
 
-smalltalk.addMethod(
-"_applyOn_then_",
-smalltalk.method({
-selector: "applyOn:then:",
-fn: function (aKeyBinder,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"applyOn:then:",{aKeyBinder:aKeyBinder,aBlock:aBlock},smalltalk.HLBinding)})},
-messageSends: []}),
-smalltalk.HLBinding);
-
 smalltalk.addMethod(
 "_atKey_",
 smalltalk.method({
@@ -246,18 +236,17 @@ return smalltalk.withContext(function($ctx1) { 
var $2,$3,$4,$5,$1;
 $2=_st((smalltalk.HLBindingInput || HLBindingInput))._new();
 _st($2)._label_(_st(_st(self)._command())._inputLabel());
 _st($2)._ghostText_(_st(_st(self)._command())._displayLabel());
-_st($2)._callback_((function(val,errorBlock){
+_st($2)._callback_((function(val){
 return smalltalk.withContext(function($ctx2) {
$3=_st(self)._command();
 _st($3)._input_(val);
-_st($3)._errorBlock_(errorBlock);
 $4=_st($3)._execute();
 return $4;
-}, function($ctx2) {$ctx2.fillBlock({val:val,errorBlock:errorBlock},$ctx1)})}));
+}, function($ctx2) {$ctx2.fillBlock({val:val},$ctx1)})}));
 $5=_st($2)._yourself();
 $1=$5;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"inputBinding",{},smalltalk.HLBindingAction)})},
-messageSends: ["label:", "inputLabel", "command", "new", "ghostText:", "displayLabel", "callback:", "input:", "errorBlock:", "execute", "yourself"]}),
+messageSends: ["label:", "inputLabel", "command", "new", "ghostText:", "displayLabel", "callback:", "input:", "execute", "yourself"]}),
 smalltalk.HLBindingAction);
 
 smalltalk.addMethod(
@@ -482,13 +471,9 @@ fn: function (aKeyBinder){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._isFinal_(true);
 _st(self)._inputText_(_st(_st(_st(self)._input())._asJQuery())._val());
-_st(self)._evaluate_onError_(_st(self)._inputText(),(function(){
-return smalltalk.withContext(function($ctx2) {
_st(self)._errorStatus();
-_st(self)._refresh();
-return _st(self)._isFinal_(false);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+_st(self)._evaluate_(_st(self)._inputText());
 return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingInput)})},
-messageSends: ["isFinal:", "inputText:", "val", "asJQuery", "input", "evaluate:onError:", "inputText", "errorStatus", "refresh"]}),
+messageSends: ["isFinal:", "inputText:", "val", "asJQuery", "input", "evaluate:", "inputText"]}),
 smalltalk.HLBindingInput);
 
 smalltalk.addMethod(
@@ -544,8 +529,9 @@ selector: "errorStatus",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._status_("error");
+_st(self)._refresh();
 return self}, function($ctx1) {$ctx1.fill(self,"errorStatus",{},smalltalk.HLBindingInput)})},
-messageSends: ["status:"]}),
+messageSends: ["status:", "refresh"]}),
 smalltalk.HLBindingInput);
 
 smalltalk.addMethod(
@@ -554,20 +540,14 @@ smalltalk.method({
 selector: "evaluate:",
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._callback())._value_(aString);
+return smalltalk.withContext(function($ctx1) { 
_st((function(){
+return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._callback())._value_(aString);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
+return smalltalk.withContext(function($ctx2) {
_st(self)._errorStatus();
+return _st(self)._isFinal_(false);
+}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"evaluate:",{aString:aString},smalltalk.HLBindingInput)})},
-messageSends: ["value:", "callback"]}),
-smalltalk.HLBindingInput);
-
-smalltalk.addMethod(
-"_evaluate_onError_",
-smalltalk.method({
-selector: "evaluate:onError:",
-fn: function (aString,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._callback())._value_value_(aString,aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"evaluate:onError:",{aString:aString,aBlock:aBlock},smalltalk.HLBindingInput)})},
-messageSends: ["value:value:", "callback"]}),
+messageSends: ["on:do:", "errorStatus", "isFinal:", "value:", "callback"]}),
 smalltalk.HLBindingInput);
 
 smalltalk.addMethod(

+ 20 - 50
js/Helios-KeyBindings.js

@@ -15,21 +15,6 @@ referencedClasses: []
 }),
 smalltalk.HLBinding);
 
-smalltalk.addMethod(
-"_applyOn_then_",
-smalltalk.method({
-selector: "applyOn:then:",
-category: 'actions',
-fn: function (aKeyBinder,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"applyOn:then:",{aKeyBinder:aKeyBinder,aBlock:aBlock},smalltalk.HLBinding)})},
-args: ["aKeyBinder", "aBlock"],
-source: "applyOn: aKeyBinder then: aBlock",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLBinding);
-
 smalltalk.addMethod(
 "_atKey_",
 smalltalk.method({
@@ -337,20 +322,19 @@ return smalltalk.withContext(function($ctx1) { 
var $2,$3,$4,$5,$1;
 $2=_st((smalltalk.HLBindingInput || HLBindingInput))._new();
 _st($2)._label_(_st(_st(self)._command())._inputLabel());
 _st($2)._ghostText_(_st(_st(self)._command())._displayLabel());
-_st($2)._callback_((function(val,errorBlock){
+_st($2)._callback_((function(val){
 return smalltalk.withContext(function($ctx2) {
$3=_st(self)._command();
 _st($3)._input_(val);
-_st($3)._errorBlock_(errorBlock);
 $4=_st($3)._execute();
 return $4;
-}, function($ctx2) {$ctx2.fillBlock({val:val,errorBlock:errorBlock},$ctx1)})}));
+}, function($ctx2) {$ctx2.fillBlock({val:val},$ctx1)})}));
 $5=_st($2)._yourself();
 $1=$5;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"inputBinding",{},smalltalk.HLBindingAction)})},
 args: [],
-source: "inputBinding\x0a\x09^ HLBindingInput new\x0a\x09\x09label: self command inputLabel;\x0a\x09\x09ghostText: self command displayLabel;\x0a\x09\x09callback: [ :val :errorBlock | \x0a\x09\x09\x09self command \x0a\x09\x09\x09\x09input: val;\x0a\x09\x09\x09\x09errorBlock: errorBlock;\x0a\x09\x09\x09\x09execute ];\x0a\x09\x09yourself",
-messageSends: ["label:", "inputLabel", "command", "new", "ghostText:", "displayLabel", "callback:", "input:", "errorBlock:", "execute", "yourself"],
+source: "inputBinding\x0a\x09^ HLBindingInput new\x0a\x09\x09label: self command inputLabel;\x0a\x09\x09ghostText: self command displayLabel;\x0a\x09\x09callback: [ :val | \x0a\x09\x09\x09self command \x0a\x09\x09\x09\x09input: val;\x0a\x09\x09\x09\x09execute ];\x0a\x09\x09yourself",
+messageSends: ["label:", "inputLabel", "command", "new", "ghostText:", "displayLabel", "callback:", "input:", "execute", "yourself"],
 referencedClasses: ["HLBindingInput"]
 }),
 smalltalk.HLBindingAction);
@@ -648,15 +632,11 @@ fn: function (aKeyBinder){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._isFinal_(true);
 _st(self)._inputText_(_st(_st(_st(self)._input())._asJQuery())._val());
-_st(self)._evaluate_onError_(_st(self)._inputText(),(function(){
-return smalltalk.withContext(function($ctx2) {
_st(self)._errorStatus();
-_st(self)._refresh();
-return _st(self)._isFinal_(false);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+_st(self)._evaluate_(_st(self)._inputText());
 return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingInput)})},
 args: ["aKeyBinder"],
-source: "applyOn: aKeyBinder\x0a\x0a\x09self isFinal: true.\x0a\x09self inputText: self input asJQuery val.\x0a\x09self \x0a\x09\x09evaluate: self inputText\x0a\x09\x09onError: [ \x0a\x09\x09\x09self errorStatus.\x0a\x09\x09\x09self refresh.\x0a\x09\x09\x09self isFinal: false ]",
-messageSends: ["isFinal:", "inputText:", "val", "asJQuery", "input", "evaluate:onError:", "inputText", "errorStatus", "refresh"],
+source: "applyOn: aKeyBinder\x0a\x0a\x09self isFinal: true.\x0a\x09self inputText: self input asJQuery val.\x0a\x09self evaluate: self inputText",
+messageSends: ["isFinal:", "inputText:", "val", "asJQuery", "input", "evaluate:", "inputText"],
 referencedClasses: []
 }),
 smalltalk.HLBindingInput);
@@ -730,10 +710,11 @@ category: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._status_("error");
+_st(self)._refresh();
 return self}, function($ctx1) {$ctx1.fill(self,"errorStatus",{},smalltalk.HLBindingInput)})},
 args: [],
-source: "errorStatus\x0a\x09self status: 'error'",
-messageSends: ["status:"],
+source: "errorStatus\x0a\x09self status: 'error'.\x0a\x09self refresh",
+messageSends: ["status:", "refresh"],
 referencedClasses: []
 }),
 smalltalk.HLBindingInput);
@@ -745,28 +726,17 @@ selector: "evaluate:",
 category: 'actions',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._callback())._value_(aString);
+return smalltalk.withContext(function($ctx1) { 
_st((function(){
+return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._callback())._value_(aString);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
+return smalltalk.withContext(function($ctx2) {
_st(self)._errorStatus();
+return _st(self)._isFinal_(false);
+}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"evaluate:",{aString:aString},smalltalk.HLBindingInput)})},
 args: ["aString"],
-source: "evaluate: aString\x0a\x09self callback value: aString",
-messageSends: ["value:", "callback"],
-referencedClasses: []
-}),
-smalltalk.HLBindingInput);
-
-smalltalk.addMethod(
-"_evaluate_onError_",
-smalltalk.method({
-selector: "evaluate:onError:",
-category: 'actions',
-fn: function (aString,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._callback())._value_value_(aString,aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"evaluate:onError:",{aString:aString,aBlock:aBlock},smalltalk.HLBindingInput)})},
-args: ["aString", "aBlock"],
-source: "evaluate: aString onError: aBlock\x0a\x09self callback value: aString value: aBlock",
-messageSends: ["value:value:", "callback"],
-referencedClasses: []
+source: "evaluate: aString\x0a\x09\x0a\x09[ self callback value: aString ]\x0a\x09on: Error\x0a\x09do: [:ex | \x0a\x09\x09self errorStatus.\x0a\x09\x09self isFinal: false ].",
+messageSends: ["on:do:", "errorStatus", "isFinal:", "value:", "callback"],
+referencedClasses: ["Error"]
 }),
 smalltalk.HLBindingInput);
 
@@ -935,7 +905,7 @@ self["@input"]=$2;
 _st(_st(self["@input"])._asJQuery())._focus();
 return self}, function($ctx1) {$ctx1.fill(self,"privateRenderOn:html:",{aBinder:aBinder,html:html},smalltalk.HLBindingInput)})},
 args: ["aBinder", "html"],
-source: "privateRenderOn: aBinder html: html\x0a\x0a\x09input := html input\x0a\x09\x09class: 'controls';\x0a\x09\x09type: 'text';\x0a\x09\x09placeholder: self ghostText;\x0a\x09\x09with: self inputText.\x0a\x09\x09\x09\x09\x0a\x09\x22input onKeyPress: [ :event |\x0a\x09\x09event keyCode = 13 \x0a\x09\x09\x09ifTrue: [ self applyOn: aBinder ] ].\x0a\x09\x22\x09\x09\x09\x0a\x09input asJQuery focus",
+source: "privateRenderOn: aBinder html: html\x0a\x09input := html input\x0a\x09\x09class: 'controls';\x0a\x09\x09type: 'text';\x0a\x09\x09placeholder: self ghostText;\x0a\x09\x09with: self inputText.\x0a\x09\x09\x09\x0a\x09input asJQuery focus",
 messageSends: ["class:", "input", "type:", "placeholder:", "ghostText", "with:", "inputText", "focus", "asJQuery"],
 referencedClasses: []
 }),

+ 26 - 20
st/Helios-Browser.st

@@ -1,7 +1,7 @@
 Smalltalk current createPackage: 'Helios-Browser'!
 HLWidget subclass: #HLBrowser
- instanceVariableNames: 'model packagesListWidget classesListWidget protocolsListWidget methodsListWidget sourceWidget'
- package: 'Helios-Browser'!
+	instanceVariableNames: 'model packagesListWidget classesListWidget protocolsListWidget methodsListWidget sourceWidget'
+	package: 'Helios-Browser'!
 
 !HLBrowser methodsFor: 'accessing'!
 
@@ -118,8 +118,8 @@ canBeOpenAsTab
 ! !
 
 HLNavigationListWidget subclass: #HLBrowserListWidget
- instanceVariableNames: 'model'
- package: 'Helios-Browser'!
+	instanceVariableNames: 'model'
+	package: 'Helios-Browser'!
 
 !HLBrowserListWidget methodsFor: 'accessing'!
 
@@ -158,8 +158,8 @@ on: aModel
 ! !
 
 HLBrowserListWidget subclass: #HLClassesListWidget
- instanceVariableNames: ''
- package: 'Helios-Browser'!
+	instanceVariableNames: ''
+	package: 'Helios-Browser'!
 
 !HLClassesListWidget methodsFor: 'accessing'!
 
@@ -339,8 +339,8 @@ renderListOn: html
 ! !
 
 HLBrowserListWidget subclass: #HLMethodsListWidget
- instanceVariableNames: ''
- package: 'Helios-Browser'!
+	instanceVariableNames: ''
+	package: 'Helios-Browser'!
 
 !HLMethodsListWidget methodsFor: 'accessing'!
 
@@ -527,8 +527,8 @@ selectorsCache
 ! !
 
 HLBrowserListWidget subclass: #HLPackagesListWidget
- instanceVariableNames: ''
- package: 'Helios-Browser'!
+	instanceVariableNames: ''
+	package: 'Helios-Browser'!
 
 !HLPackagesListWidget methodsFor: 'accessing'!
 
@@ -594,8 +594,8 @@ renderButtonsOn: html
 ! !
 
 HLBrowserListWidget subclass: #HLProtocolsListWidget
- instanceVariableNames: ''
- package: 'Helios-Browser'!
+	instanceVariableNames: ''
+	package: 'Helios-Browser'!
 
 !HLProtocolsListWidget methodsFor: 'accessing'!
 
@@ -696,8 +696,8 @@ renderContentOn: html
 ! !
 
 Object subclass: #HLBrowserModel
- instanceVariableNames: 'announcer environment selectedPackage selectedClass selectedProtocol selectedSelector showInstance showComment'
- package: 'Helios-Browser'!
+	instanceVariableNames: 'announcer environment selectedPackage selectedClass selectedProtocol selectedSelector showInstance showComment'
+	package: 'Helios-Browser'!
 
 !HLBrowserModel methodsFor: 'accessing'!
 
@@ -846,6 +846,12 @@ saveSourceCode
 
 !HLBrowserModel methodsFor: 'commands actions'!
 
+moveMethodToClass: aClassName
+	self environment 
+		moveMethod: self selectedMethod 
+		toClass: aClassName
+!
+
 moveMethodToClass: aClassName ifAbsent: aBlock
 	self environment 
 		moveMethod: self selectedMethod 
@@ -963,8 +969,8 @@ on: anEnvironment
 ! !
 
 HLWidget subclass: #HLBrowserSourceWidget
- instanceVariableNames: 'model methodContents codeWidget'
- package: 'Helios-Browser'!
+	instanceVariableNames: 'model methodContents codeWidget'
+	package: 'Helios-Browser'!
 
 !HLBrowserSourceWidget methodsFor: 'accessing'!
 
@@ -1098,8 +1104,8 @@ on: aBrowserModel
 ! !
 
 Object subclass: #HLClassCache
- instanceVariableNames: 'class selectorsCache overrideCache overriddenCache'
- package: 'Helios-Browser'!
+	instanceVariableNames: 'class selectorsCache overrideCache overriddenCache'
+	package: 'Helios-Browser'!
 
 !HLClassCache methodsFor: 'accessing'!
 
@@ -1185,8 +1191,8 @@ on: aClass selectorsCache: aSelectorsCache
 ! !
 
 Object subclass: #HLSelectorsCache
- instanceVariableNames: 'classesCache'
- package: 'Helios-Browser'!
+	instanceVariableNames: 'classesCache'
+	package: 'Helios-Browser'!
 
 !HLSelectorsCache methodsFor: 'accessing'!
 

+ 1 - 1
st/Helios-Commands-Browser.st

@@ -186,7 +186,7 @@ inputLabel
 !HLMoveMethodToClassCommand methodsFor: 'executing'!
 
 execute
-	self model moveMethodToClass: self input ifAbsent: self errorBlock
+	self model moveMethodToClass: self input
 ! !
 
 !HLMoveMethodToClassCommand methodsFor: 'testing'!

+ 16 - 24
st/Helios-Commands-Core.st

@@ -1,7 +1,7 @@
 Smalltalk current createPackage: 'Helios-Commands-Core'!
 Object subclass: #HLCommand
- instanceVariableNames: 'input errorBlock'
- package: 'Helios-Commands-Core'!
+	instanceVariableNames: 'input'
+	package: 'Helios-Commands-Core'!
 
 !HLCommand methodsFor: 'accessing'!
 
@@ -9,14 +9,6 @@ documentation
 	^ self class documentation
 !
 
-errorBlock
-	^ errorBlock
-!
-
-errorBlock: aBlock
-	errorBlock := aBlock
-!
-
 input
 	^ input
 !
@@ -129,8 +121,8 @@ isConcrete
 ! !
 
 HLCommand subclass: #HLCloseTabCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Core'!
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Core'!
 
 !HLCloseTabCommand methodsFor: 'executing'!
 
@@ -149,8 +141,8 @@ label
 ! !
 
 HLCommand subclass: #HLModelCommand
- instanceVariableNames: 'model'
- package: 'Helios-Commands-Core'!
+	instanceVariableNames: 'model'
+	package: 'Helios-Commands-Core'!
 
 !HLModelCommand methodsFor: 'accessing'!
 
@@ -186,8 +178,8 @@ registerOn: aBinding for: aModel
 ! !
 
 HLCommand subclass: #HLOpenCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Core'!
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Core'!
 
 !HLOpenCommand class methodsFor: 'accessing'!
 
@@ -200,8 +192,8 @@ label
 ! !
 
 HLOpenCommand subclass: #HLOpenBrowserCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Core'!
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Core'!
 
 !HLOpenBrowserCommand methodsFor: 'executing'!
 
@@ -220,8 +212,8 @@ label
 ! !
 
 HLOpenCommand subclass: #HLOpenTranscriptCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Core'!
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Core'!
 
 !HLOpenTranscriptCommand methodsFor: 'executing'!
 
@@ -240,8 +232,8 @@ label
 ! !
 
 HLOpenCommand subclass: #HLOpenWorkspaceCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Core'!
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Core'!
 
 !HLOpenWorkspaceCommand methodsFor: 'executing'!
 
@@ -260,8 +252,8 @@ label
 ! !
 
 HLCommand subclass: #HLViewCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Core'!
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Core'!
 
 !HLViewCommand class methodsFor: 'accessing'!
 

+ 4 - 3
st/Helios-Environments.st

@@ -22,7 +22,7 @@ eval: someCode on: aReceiver
 	^ self subclassResponsibility
 !
 
-moveMethod: aMethod toClass: aClassName ifAbsent: aBlock
+moveMethod: aMethod toClass: aClassName
 	self subclassResponsibility
 ! !
 
@@ -74,11 +74,12 @@ eval: aString on: aReceiver
 	^ compiler evaluateExpression: aString on: aReceiver
 !
 
-moveMethod: aMethod toClass: aClassName ifAbsent: aBlock
+moveMethod: aMethod toClass: aClassName
 	| destinationClass |
 	
 	destinationClass := Smalltalk current at: aClassName asSymbol.
-	destinationClass ifNil: [ ^ aBlock value ].
+	destinationClass ifNil: [ self error: 'Invalid class name' ].
+	destinationClass == aMethod methodClass ifTrue: [ ^ self ].
 	
 	destinationClass adoptMethod: aMethod.
 	aMethod methodClass forsakeMethod: aMethod.

+ 11 - 23
st/Helios-KeyBindings.st

@@ -38,9 +38,6 @@ shortcut
 applyOn: aKeyBinder
 !
 
-applyOn: aKeyBinder then: aBlock
-!
-
 release
 ! !
 
@@ -99,10 +96,9 @@ inputBinding
 	^ HLBindingInput new
 		label: self command inputLabel;
 		ghostText: self command displayLabel;
-		callback: [ :val :errorBlock | 
+		callback: [ :val | 
 			self command 
 				input: val;
-				errorBlock: errorBlock;
 				execute ];
 		yourself
 ! !
@@ -249,24 +245,21 @@ applyOn: aKeyBinder
 
 	self isFinal: true.
 	self inputText: self input asJQuery val.
-	self 
-		evaluate: self inputText
-		onError: [ 
-			self errorStatus.
-			self refresh.
-			self isFinal: false ]
+	self evaluate: self inputText
 !
 
 errorStatus
-	self status: 'error'
+	self status: 'error'.
+	self refresh
 !
 
 evaluate: aString
-	self callback value: aString
-!
-
-evaluate: aString onError: aBlock
-	self callback value: aString value: aBlock
+	
+	[ self callback value: aString ]
+	on: Error
+	do: [:ex | 
+		self errorStatus.
+		self isFinal: false ].
 !
 
 release
@@ -279,17 +272,12 @@ release
 !HLBindingInput methodsFor: 'rendering'!
 
 privateRenderOn: aBinder html: html
-
 	input := html input
 		class: 'controls';
 		type: 'text';
 		placeholder: self ghostText;
 		with: self inputText.
-				
-	"input onKeyPress: [ :event |
-		event keyCode = 13 
-			ifTrue: [ self applyOn: aBinder ] ].
-	"			
+			
 	input asJQuery focus
 !