Browse Source

Renamed Smalltalk >> asSmalltalkError: to #asSmalltalkException:

Nicolas Petton 11 years ago
parent
commit
c9904a91b8

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

@@ -108,7 +108,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $2,$1;
 $1=_st(self)._try_catch_(self,(function(error){
 var smalltalkError;
-return smalltalk.withContext(function($ctx2) {
smalltalkError=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._asSmalltalkError_(error);
+return smalltalk.withContext(function($ctx2) {
smalltalkError=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._asSmalltalkException_(error);
 smalltalkError;
 $2=_st(smalltalkError)._isKindOf_(anErrorClass);
 if(smalltalk.assert($2)){

+ 3 - 3
js/Kernel-Methods.js

@@ -155,7 +155,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $2,$1;
 $1=_st(self)._try_catch_(self,(function(error){
 var smalltalkError;
-return smalltalk.withContext(function($ctx2) {
smalltalkError=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._asSmalltalkError_(error);
+return smalltalk.withContext(function($ctx2) {
smalltalkError=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._asSmalltalkException_(error);
 smalltalkError;
 $2=_st(smalltalkError)._isKindOf_(anErrorClass);
 if(smalltalk.assert($2)){
@@ -167,8 +167,8 @@ return _st(smalltalkError)._signal();
 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    Convert all JS exceptions to JavaScriptException instances.\x22\x0a    \x0a\x09^self try: self catch: [ :error | | smalltalkError |\x0a    \x09smalltalkError := Smalltalk current asSmalltalkError: error.\x0a\x09    (smalltalkError isKindOf: anErrorClass) \x0a\x09     ifTrue: [ aBlock value: smalltalkError ]\x0a\x09     ifFalse: [ smalltalkError signal ] ]",
-messageSends: ["try:catch:", "asSmalltalkError:", "current", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:"],
+source: "on: anErrorClass do: aBlock\x0a\x09\x22All exceptions thrown in the Smalltalk stack are cought.\x0a    Convert all JS exceptions to JavaScriptException instances.\x22\x0a    \x0a\x09^self try: self catch: [ :error | | smalltalkError |\x0a    \x09smalltalkError := Smalltalk current asSmalltalkException: error.\x0a\x09    (smalltalkError isKindOf: anErrorClass) \x0a\x09     ifTrue: [ aBlock value: smalltalkError ]\x0a\x09     ifFalse: [ smalltalkError signal ] ]",
+messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:"],
 referencedClasses: ["Smalltalk"]
 }),
 smalltalk.BlockClosure);

+ 8 - 8
js/Kernel-Objects.deploy.js

@@ -2940,22 +2940,22 @@ smalltalk.Random);
 
 smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
 smalltalk.addMethod(
-"_asSmalltalkError_",
+"_asSmalltalkException_",
 smalltalk.method({
-selector: "asSmalltalkError:",
-fn: function (anError){
+selector: "asSmalltalkException:",
+fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $2,$1;
-$2=_st(_st(self)._isSmalltalkObject_(anError))._and_((function(){
-return smalltalk.withContext(function($ctx2) {
return _st(anError)._isKindOf_((smalltalk.Error || Error));
+$2=_st(_st(self)._isSmalltalkObject_(anObject))._and_((function(){
+return smalltalk.withContext(function($ctx2) {
return _st(anObject)._isKindOf_((smalltalk.Error || Error));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 if(smalltalk.assert($2)){
-$1=anError;
+$1=anObject;
 } else {
-$1=_st((smalltalk.JavaScriptException || JavaScriptException))._on_(anError);
+$1=_st((smalltalk.JavaScriptException || JavaScriptException))._on_(anObject);
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"asSmalltalkError:",{anError:anError}, smalltalk.Smalltalk)})}
+}, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject}, smalltalk.Smalltalk)})}
 }),
 smalltalk.Smalltalk);
 

+ 10 - 10
js/Kernel-Objects.js

@@ -4054,25 +4054,25 @@ smalltalk.Random);
 smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
 smalltalk.Smalltalk.comment="Smalltalk has only one instance, accessed with `Smalltalk current`. \x0aIt represents the global JavaScript variable `smalltalk` declared in `js/boot.js`.\x0a\x0aThe `smalltalk` object holds all class and packages defined in the system.\x0a\x0a## Classes\x0a\x0aClasses can be accessed using the following methods:\x0a\x0a- `#classes` answers the full list of Smalltalk classes in the system\x0a- `#at:` answers a specific class of `nil`\x0a\x0a## Packages\x0a\x0aPackages can be accessed using the following methods:\x0a\x0a- `#packages` answers the full list of packages\x0a- `#packageAt:` answers a specific class of `nil`\x0a\x0a__note:__ classes and packages are accessed using strings, not symbols\x0a\x0a## Parsing\x0a\x0aThe `#parse:` method is used to parse Smalltalk source code. \x0aIt requires the `Compiler` package and the `js/parser.js` parser file in order to work"
 smalltalk.addMethod(
-"_asSmalltalkError_",
+"_asSmalltalkException_",
 smalltalk.method({
-selector: "asSmalltalkError:",
+selector: "asSmalltalkException:",
 category: 'error handling',
-fn: function (anError){
+fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $2,$1;
-$2=_st(_st(self)._isSmalltalkObject_(anError))._and_((function(){
-return smalltalk.withContext(function($ctx2) {
return _st(anError)._isKindOf_((smalltalk.Error || Error));
+$2=_st(_st(self)._isSmalltalkObject_(anObject))._and_((function(){
+return smalltalk.withContext(function($ctx2) {
return _st(anObject)._isKindOf_((smalltalk.Error || Error));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 if(smalltalk.assert($2)){
-$1=anError;
+$1=anObject;
 } else {
-$1=_st((smalltalk.JavaScriptException || JavaScriptException))._on_(anError);
+$1=_st((smalltalk.JavaScriptException || JavaScriptException))._on_(anObject);
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"asSmalltalkError:",{anError:anError}, smalltalk.Smalltalk)})},
-args: ["anError"],
-source: "asSmalltalkError: anError\x0a\x09\x22A JavaScript error may be thrown.\x0a    We then need to convert it back to a Smalltalk object\x22\x0a    \x0a    ^ ((self isSmalltalkObject: anError) and: [ anError isKindOf: Error ])\x0a    \x09ifTrue: [ anError ]\x0a      \x09ifFalse: [ JavaScriptException on: anError ]",
+}, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject}, smalltalk.Smalltalk)})},
+args: ["anObject"],
+source: "asSmalltalkException: anObject\x0a\x09\x22A JavaScript exception may be thrown.\x0a    We then need to convert it back to a Smalltalk object\x22\x0a    \x0a    ^ ((self isSmalltalkObject: anObject) and: [ anObject isKindOf: Error ])\x0a    \x09ifTrue: [ anObject ]\x0a      \x09ifFalse: [ JavaScriptException on: anObject ]",
 messageSends: ["ifTrue:ifFalse:", "on:", "and:", "isKindOf:", "isSmalltalkObject:"],
 referencedClasses: ["JavaScriptException", "Error"]
 }),

+ 1 - 1
st/Kernel-Methods.st

@@ -47,7 +47,7 @@ on: anErrorClass do: aBlock
     Convert all JS exceptions to JavaScriptException instances."
     
 	^self try: self catch: [ :error | | smalltalkError |
-    	smalltalkError := Smalltalk current asSmalltalkError: error.
+    	smalltalkError := Smalltalk current asSmalltalkException: error.
 	    (smalltalkError isKindOf: anErrorClass) 
 	     ifTrue: [ aBlock value: smalltalkError ]
 	     ifFalse: [ smalltalkError signal ] ]

+ 5 - 5
st/Kernel-Objects.st

@@ -1476,13 +1476,13 @@ removeClass: aClass
 
 !Smalltalk methodsFor: 'error handling'!
 
-asSmalltalkError: anError
-	"A JavaScript error may be thrown.
+asSmalltalkException: anObject
+	"A JavaScript exception may be thrown.
     We then need to convert it back to a Smalltalk object"
     
-    ^ ((self isSmalltalkObject: anError) and: [ anError isKindOf: Error ])
-    	ifTrue: [ anError ]
-      	ifFalse: [ JavaScriptException on: anError ]
+    ^ ((self isSmalltalkObject: anObject) and: [ anObject isKindOf: Error ])
+    	ifTrue: [ anObject ]
+      	ifFalse: [ JavaScriptException on: anObject ]
 !
 
 parseError: anException parsing: aString