瀏覽代碼

Fixed Smalltalk >> asSmalltalkException:

Nicolas Petton 11 年之前
父節點
當前提交
47c7a0440d
共有 3 個文件被更改,包括 7 次插入15 次删除
  1. 2 6
      js/Kernel-Objects.deploy.js
  2. 4 8
      js/Kernel-Objects.js
  3. 1 1
      st/Kernel-Objects.st

+ 2 - 6
js/Kernel-Objects.deploy.js

@@ -3565,13 +3565,9 @@ selector: "asSmalltalkException:",
 fn: function (anObject){
 var self=this;
 function $JavaScriptException(){return smalltalk.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
-function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
-$2=_st(_st(self)._isSmalltalkObject_(anObject))._and_((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(anObject)._isKindOf_($Error());
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+$2=_st(self)._isSmalltalkObject_(anObject);
 if(smalltalk.assert($2)){
 $1=anObject;
 } else {
@@ -3579,7 +3575,7 @@ $1=_st($JavaScriptException())._on_(anObject);
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},smalltalk.Smalltalk)})},
-messageSends: ["ifTrue:ifFalse:", "on:", "and:", "isKindOf:", "isSmalltalkObject:"]}),
+messageSends: ["ifTrue:ifFalse:", "on:", "isSmalltalkObject:"]}),
 smalltalk.Smalltalk);
 
 smalltalk.addMethod(

+ 4 - 8
js/Kernel-Objects.js

@@ -4865,13 +4865,9 @@ category: 'error handling',
 fn: function (anObject){
 var self=this;
 function $JavaScriptException(){return smalltalk.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
-function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
-$2=_st(_st(self)._isSmalltalkObject_(anObject))._and_((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(anObject)._isKindOf_($Error());
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+$2=_st(self)._isSmalltalkObject_(anObject);
 if(smalltalk.assert($2)){
 $1=anObject;
 } else {
@@ -4880,9 +4876,9 @@ $1=_st($JavaScriptException())._on_(anObject);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},smalltalk.Smalltalk)})},
 args: ["anObject"],
-source: "asSmalltalkException: anObject\x0a\x09\x22A JavaScript exception may be thrown.\x0a\x09We then need to convert it back to a Smalltalk object\x22\x0a\x09\x0a\x09^ ((self isSmalltalkObject: anObject) and: [ anObject isKindOf: Error ])\x0a\x09\x09ifTrue: [ anObject ]\x0a\x09\x09ifFalse: [ JavaScriptException on: anObject ]",
-messageSends: ["ifTrue:ifFalse:", "on:", "and:", "isKindOf:", "isSmalltalkObject:"],
-referencedClasses: ["JavaScriptException", "Error"]
+source: "asSmalltalkException: anObject\x0a\x09\x22A JavaScript exception may be thrown.\x0a\x09We then need to convert it back to a Smalltalk object\x22\x0a\x09\x0a\x09^ (self isSmalltalkObject: anObject)\x0a\x09\x09ifTrue: [ anObject ]\x0a\x09\x09ifFalse: [ JavaScriptException on: anObject ]",
+messageSends: ["ifTrue:ifFalse:", "on:", "isSmalltalkObject:"],
+referencedClasses: ["JavaScriptException"]
 }),
 smalltalk.Smalltalk);
 

+ 1 - 1
st/Kernel-Objects.st

@@ -1788,7 +1788,7 @@ asSmalltalkException: anObject
 	"A JavaScript exception may be thrown.
 	We then need to convert it back to a Smalltalk object"
 	
-	^ ((self isSmalltalkObject: anObject) and: [ anObject isKindOf: Error ])
+	^ (self isSmalltalkObject: anObject)
 		ifTrue: [ anObject ]
 		ifFalse: [ JavaScriptException on: anObject ]
 !