瀏覽代碼

Use Error >> #resignal in BlockClosure >> #on:do:

Nicolas Petton 11 年之前
父節點
當前提交
51fa579ca8
共有 3 個文件被更改,包括 6 次插入6 次删除
  1. 2 2
      js/Kernel-Methods.deploy.js
  2. 3 3
      js/Kernel-Methods.js
  3. 1 1
      st/Kernel-Methods.st

+ 2 - 2
js/Kernel-Methods.deploy.js

@@ -145,12 +145,12 @@ $2=_st(smalltalkError)._isKindOf_(anErrorClass);
 if(smalltalk.assert($2)){
 return _st(aBlock)._value_(smalltalkError);
 } else {
-return _st(smalltalkError)._signal();
+return _st(smalltalkError)._resignal();
 };
 }, function($ctx2) {$ctx2.fillBlock({error:error,smalltalkError:smalltalkError},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:do:",{anErrorClass:anErrorClass,aBlock:aBlock},smalltalk.BlockClosure)})},
-messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:"]}),
+messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "value:", "resignal", "isKindOf:"]}),
 smalltalk.BlockClosure);
 
 smalltalk.addMethod(

+ 3 - 3
js/Kernel-Methods.js

@@ -202,14 +202,14 @@ $2=_st(smalltalkError)._isKindOf_(anErrorClass);
 if(smalltalk.assert($2)){
 return _st(aBlock)._value_(smalltalkError);
 } else {
-return _st(smalltalkError)._signal();
+return _st(smalltalkError)._resignal();
 };
 }, function($ctx2) {$ctx2.fillBlock({error:error,smalltalkError:smalltalkError},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:do:",{anErrorClass:anErrorClass,aBlock:aBlock},smalltalk.BlockClosure)})},
 args: ["anErrorClass", "aBlock"],
-source: "on: anErrorClass do: aBlock\x0a\x09\x22All exceptions thrown in the Smalltalk stack are cought.\x0a\x09Convert all JS exceptions to JavaScriptException instances.\x22\x0a\x09\x0a\x09^self try: self catch: [ :error | | smalltalkError |\x0a\x09\x09smalltalkError := Smalltalk current asSmalltalkException: error.\x0a\x09\x09(smalltalkError isKindOf: anErrorClass)\x0a\x09\x09ifTrue: [ aBlock value: smalltalkError ]\x0a\x09\x09ifFalse: [ smalltalkError signal ] ]",
-messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:"],
+source: "on: anErrorClass do: aBlock\x0a\x09\x22All exceptions thrown in the Smalltalk stack are cought.\x0a\x09Convert all JS exceptions to JavaScriptException instances.\x22\x0a\x09\x0a\x09^self try: self catch: [ :error | | smalltalkError |\x0a\x09\x09smalltalkError := Smalltalk current asSmalltalkException: error.\x0a\x09\x09(smalltalkError isKindOf: anErrorClass)\x0a\x09\x09ifTrue: [ aBlock value: smalltalkError ]\x0a\x09\x09ifFalse: [ smalltalkError resignal ] ]",
+messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "value:", "resignal", "isKindOf:"],
 referencedClasses: ["Smalltalk"]
 }),
 smalltalk.BlockClosure);

+ 1 - 1
st/Kernel-Methods.st

@@ -93,7 +93,7 @@ on: anErrorClass do: aBlock
 		smalltalkError := Smalltalk current asSmalltalkException: error.
 		(smalltalkError isKindOf: anErrorClass)
 		ifTrue: [ aBlock value: smalltalkError ]
-		ifFalse: [ smalltalkError signal ] ]
+		ifFalse: [ smalltalkError resignal ] ]
 ! !
 
 !BlockClosure methodsFor: 'evaluating'!