Browse Source

Merge pull request #900 from herby/fix-errorhandler-new

Fix `Errorhandler new` calls
Nicolas Petton 11 năm trước cách đây
mục cha
commit
6e3cd2bf4c
5 tập tin đã thay đổi với 717 bổ sung73 xóa
  1. 4 4
      cli/src/AmberCli.js
  2. 1 1
      cli/src/AmberCli.st
  3. 707 63
      cli/support/amber-cli.js
  4. 4 4
      src/IDE.js
  5. 1 1
      src/IDE.st

+ 4 - 4
cli/src/AmberCli.js

@@ -1351,7 +1351,7 @@ protocol: 'private',
 fn: function (buffer,aBlock){
 var self=this;
 function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
-function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
+function $ConsoleErrorHandler(){return globals.ConsoleErrorHandler||(typeof ConsoleErrorHandler=="undefined"?nil:ConsoleErrorHandler)}
 return smalltalk.withContext(function($ctx1) { 
 var $3,$4,$2,$1;
 $1=self._parseAssignment_do_(buffer,(function(name,expr){
@@ -1379,7 +1379,7 @@ value=self._eval_on_($2,self["@session"]);
 return value;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}))._on_do_($Error(),(function(e){
 return smalltalk.withContext(function($ctx3) {
-_st(_st($ErrorHandler())._new())._logError_(e);
+_st(_st($ConsoleErrorHandler())._new())._logError_(e);
 value=nil;
 return value;
 }, function($ctx3) {$ctx3.fillBlock({e:e},$ctx2,5)})}));
@@ -1388,9 +1388,9 @@ return _st(aBlock)._value_value_(varName,value);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"assignNewVariable:do:",{buffer:buffer,aBlock:aBlock},globals.Repl)})},
 args: ["buffer", "aBlock"],
-source: "assignNewVariable: buffer do: aBlock\x0a\x09\x22Assigns a new variable and calls the given block with the variable's name and value\x0a\x09 if buffer contains an assignment expression. If it doesn't the block is called with nil for\x0a\x09 both arguments.\x22\x0a\x09^ self parseAssignment: buffer do: [ :name :expr || varName value |\x0a\x09\x09varName := name ifNil: [self nextResultName].\x0a\x09\x09session := self addVariableNamed: varName to: session.\x0a\x09\x09[ value := self eval: varName, ' := ', (expr ifNil: [buffer]) on: session ]\x0a\x09\x09\x09on: Error\x0a\x09\x09\x09do: [ :e | ErrorHandler new logError: e. value := nil].\x0a\x09\x09aBlock value: varName value: value]",
+source: "assignNewVariable: buffer do: aBlock\x0a\x09\x22Assigns a new variable and calls the given block with the variable's name and value\x0a\x09 if buffer contains an assignment expression. If it doesn't the block is called with nil for\x0a\x09 both arguments.\x22\x0a\x09^ self parseAssignment: buffer do: [ :name :expr || varName value |\x0a\x09\x09varName := name ifNil: [self nextResultName].\x0a\x09\x09session := self addVariableNamed: varName to: session.\x0a\x09\x09[ value := self eval: varName, ' := ', (expr ifNil: [buffer]) on: session ]\x0a\x09\x09\x09on: Error\x0a\x09\x09\x09do: [ :e | ConsoleErrorHandler new logError: e. value := nil].\x0a\x09\x09aBlock value: varName value: value]",
 messageSends: ["parseAssignment:do:", "ifNil:", "nextResultName", "addVariableNamed:to:", "on:do:", "eval:on:", ",", "logError:", "new", "value:value:"],
-referencedClasses: ["Error", "ErrorHandler"]
+referencedClasses: ["Error", "ConsoleErrorHandler"]
 }),
 globals.Repl);
 

+ 1 - 1
cli/src/AmberCli.st

@@ -1031,7 +1031,7 @@ assignNewVariable: buffer do: aBlock
 		session := self addVariableNamed: varName to: session.
 		[ value := self eval: varName, ' := ', (expr ifNil: [buffer]) on: session ]
 			on: Error
-			do: [ :e | ErrorHandler new logError: e. value := nil].
+			do: [ :e | ConsoleErrorHandler new logError: e. value := nil].
 		aBlock value: varName value: value]
 !
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 707 - 63
cli/support/amber-cli.js


+ 4 - 4
src/IDE.js

@@ -453,7 +453,7 @@ fn: function (anError){
 var self=this;
 function $Debugger(){return globals.Debugger||(typeof Debugger=="undefined"?nil:Debugger)}
 function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
-function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
+function $ConsoleErrorHandler(){return globals.ConsoleErrorHandler||(typeof ConsoleErrorHandler=="undefined"?nil:ConsoleErrorHandler)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 _st((function(){
@@ -465,13 +465,13 @@ $2=_st($1)._open();
 return $2;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(error){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st($ErrorHandler())._new())._handleError_(error);
+return _st(_st($ConsoleErrorHandler())._new())._handleError_(error);
 }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},globals.DebugErrorHandler)})},
 args: ["anError"],
-source: "handleError: anError\x0a\x09[ Debugger new\x0a\x09\x09error: anError;\x0a\x09\x09open ] on: Error do: [ :error |\x0a\x09\x09\x09ErrorHandler new handleError: error ]",
+source: "handleError: anError\x0a\x09[ Debugger new\x0a\x09\x09error: anError;\x0a\x09\x09open ] on: Error do: [ :error |\x0a\x09\x09\x09ConsoleErrorHandler new handleError: error ]",
 messageSends: ["on:do:", "error:", "new", "open", "handleError:"],
-referencedClasses: ["Debugger", "Error", "ErrorHandler"]
+referencedClasses: ["Debugger", "Error", "ConsoleErrorHandler"]
 }),
 globals.DebugErrorHandler);
 

+ 1 - 1
src/IDE.st

@@ -159,7 +159,7 @@ handleError: anError
 	[ Debugger new
 		error: anError;
 		open ] on: Error do: [ :error |
-			ErrorHandler new handleError: error ]
+			ConsoleErrorHandler new handleError: error ]
 ! !
 
 !DebugErrorHandler class methodsFor: 'initialization'!

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác