Browse Source

adds Error >> #resignal

Nicolas Petton 11 years ago
parent
commit
05ea8b5026
3 changed files with 33 additions and 0 deletions
  1. 11 0
      js/Kernel-Exceptions.deploy.js
  2. 16 0
      js/Kernel-Exceptions.js
  3. 6 0
      st/Kernel-Exceptions.st

+ 11 - 0
js/Kernel-Exceptions.deploy.js

@@ -68,6 +68,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"messageText:",{aString:aString},
 messageSends: []}),
 smalltalk.Error);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "resignal",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+throw(self);
+return self}, function($ctx1) {$ctx1.fill(self,"resignal",{},smalltalk.Error)})},
+messageSends: []}),
+smalltalk.Error);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "signal",

+ 16 - 0
js/Kernel-Exceptions.js

@@ -99,6 +99,22 @@ referencedClasses: []
 }),
 smalltalk.Error);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "resignal",
+category: 'signaling',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+throw(self);
+return self}, function($ctx1) {$ctx1.fill(self,"resignal",{},smalltalk.Error)})},
+args: [],
+source: "resignal\x0a\x09\x22Resignal the receiver without changing its exception context\x22\x0a\x09\x0a\x09<throw(self)>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Error);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "signal",

+ 6 - 0
st/Kernel-Exceptions.st

@@ -36,6 +36,12 @@ initialize
 
 !Error methodsFor: 'signaling'!
 
+resignal
+	"Resignal the receiver without changing its exception context"
+	
+	<throw(self)>
+!
+
 signal
 	<self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self)>
 !