3 Commits 265f765388 ... 81713dec83

Author SHA1 Message Date
  Herby Vojčík 81713dec83 Working on 0.30.4 2 years ago
  Herby Vojčík 753bafbb1e Recompile (while version set to 0.30.3) 2 years ago
  Herby Vojčík 8e2c773f41 Release version 0.30.3 2 years ago
4 changed files with 80 additions and 6 deletions
  1. 76 2
      cli/dist/amber-cli.js
  2. 1 1
      lang/package.json
  3. 2 2
      lang/src/Kernel-Infrastructure.js
  4. 1 1
      lang/src/Kernel-Infrastructure.st

+ 76 - 2
cli/dist/amber-cli.js

@@ -2519,6 +2519,11 @@ define('amber/kernel-runtime',['./junk-drawer'], function ($goodies) {
             function resultWithNoErrorHandling (worker) {
                 try {
                     return worker(thisContext);
+                } catch (error) {
+                    if (error.context == null) {
+                        error.context = thisContext;
+                    }
+                    throw error;                                
                 } finally {
                     thisContext = null;
                 }
@@ -27361,13 +27366,13 @@ $core.method({
 selector: "version",
 protocol: "accessing",
 args: [],
-source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.30.2'",
+source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.30.3'",
 referencedClasses: [],
 pragmas: [],
 messageSends: []
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
-return "0.30.2";
+return "0.30.3";
 
 }; }),
 $globals.SmalltalkImage);
@@ -69101,6 +69106,75 @@ return self;
 $globals.TKeyValueCollectionTest);
 
 
+$core.addClass("TypeErrorTest", $globals.TestCase, "Kernel-Tests");
+$core.addMethod(
+$core.method({
+selector: "testCatchingException",
+protocol: "tests",
+args: [],
+source: "testCatchingException\x0a\x09[ self throwException ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error |\x0a\x09\x09\x09self assert: (error basicAt: #name) equals: #TypeError.\x0a\x09\x09\x09\x22self assert: error context notNil\x22 \x22TODO context only in uncaught exceptions; make it so caught ones have it, too\x22 ]",
+referencedClasses: ["Error"],
+pragmas: [],
+messageSends: ["on:do:", "throwException", "assert:equals:", "basicAt:"]
+}, function ($methodClass){ return function (){
+var self=this,$self=this;
+return $core.withContext(function($ctx1) {
+$recv((function(){
+return $core.withContext(function($ctx2) {
+return $self._throwException();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+}))._on_do_($globals.Error,(function(error){
+return $core.withContext(function($ctx2) {
+return $self._assert_equals_($recv(error)._basicAt_("name"),"TypeError");
+}, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
+}));
+return self;
+}, function($ctx1) {$ctx1.fill(self,"testCatchingException",{})});
+}; }),
+$globals.TypeErrorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRaisingException",
+protocol: "tests",
+args: [],
+source: "testRaisingException\x0a\x09self should: [ self throwException ] raise: Error",
+referencedClasses: ["Error"],
+pragmas: [],
+messageSends: ["should:raise:", "throwException"]
+}, function ($methodClass){ return function (){
+var self=this,$self=this;
+return $core.withContext(function($ctx1) {
+$self._should_raise_((function(){
+return $core.withContext(function($ctx2) {
+return $self._throwException();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+}),$globals.Error);
+return self;
+}, function($ctx1) {$ctx1.fill(self,"testRaisingException",{})});
+}; }),
+$globals.TypeErrorTest);
+
+$core.addMethod(
+$core.method({
+selector: "throwException",
+protocol: "helpers",
+args: [],
+source: "throwException\x0a\x09<inlineJS: 'var x; x.y;'>",
+referencedClasses: [],
+pragmas: [["inlineJS:", ["var x; x.y;"]]],
+messageSends: []
+}, function ($methodClass){ return function (){
+var self=this,$self=this;
+return $core.withContext(function($ctx1) {
+var x; x.y;;
+return self;
+}, function($ctx1) {$ctx1.fill(self,"throwException",{})});
+}; }),
+$globals.TypeErrorTest);
+
+
+
 $core.addClass("UndefinedTest", $globals.TestCase, "Kernel-Tests");
 $core.addMethod(
 $core.method({

+ 1 - 1
lang/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@ambers/lang",
-  "version": "0.30.3-pre",
+  "version": "0.30.4-pre",
   "description": "An implementation of the Smalltalk language that runs on top of the JS runtime.",
   "homepage": "http://amber-lang.net",
   "keywords": [

+ 2 - 2
lang/src/Kernel-Infrastructure.js

@@ -4204,14 +4204,14 @@ selector: "version",
 protocol: "accessing",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.30.3-pre'",
+source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.30.4-pre'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
 messageSends: []
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
-return "0.30.3-pre";
+return "0.30.4-pre";
 
 }; }),
 $globals.SmalltalkImage);

+ 1 - 1
lang/src/Kernel-Infrastructure.st

@@ -898,7 +898,7 @@ settings
 version
 	"Answer the version string of Amber"
 	
-	^ '0.30.3-pre'
+	^ '0.30.4-pre'
 ! !
 
 !SmalltalkImage methodsFor: 'accessing amd'!