Browse Source

Merge branch 'master' into helios

Nicolas Petton 12 years ago
parent
commit
1b907c59a5

+ 6 - 4
CHANGELOG

@@ -1,5 +1,5 @@
-Release 0.10 (on it's way)
-==========================
+13th March 2013 - Release 0.10
+==============================
 
 
 Here's a summary of change since the 0.9.1 release:
 Here's a summary of change since the 0.9.1 release:
 
 
@@ -16,13 +16,15 @@ Here's a summary of change since the 0.9.1 release:
   - an AST interpreter
   - an AST interpreter
   - support for blocks contexts
   - support for blocks contexts
 
 
-- SUnit improvements and cleanup, with support for async assertions
 - New build system based on grunt.js, replacing the old makefiles
 - New build system based on grunt.js, replacing the old makefiles
-- Improved ClassBuilder with better class migration support
 - New bin/amberc compiler written in Amber/Node.js
 - New bin/amberc compiler written in Amber/Node.js
+- SUnit improvements and cleanup, with support for async assertions
+- Improved ClassBuilder with better class migration support
 - Improved loader for third party packages
 - Improved loader for third party packages
+- New: Announcements
 - Classes can be augmented by light-weight methods created from blocks
 - Classes can be augmented by light-weight methods created from blocks
 - Snippets of HTML can be marked to become virtual tags in HTMLCanvas
 - Snippets of HTML can be marked to become virtual tags in HTMLCanvas
+- Amber server supports Basic HTTP authentication (not recommended for production environments/unencrypted connections)
 - New IDE on it's way for Amber 1.0
 - New IDE on it's way for Amber 1.0
 
 
 
 

+ 10 - 0
README.md

@@ -24,6 +24,16 @@ License
 
 
 Amber is released under the MIT license. All contributions made for inclusion are considered to be under MIT.
 Amber is released under the MIT license. All contributions made for inclusion are considered to be under MIT.
 
 
+Building Amber
+--------------
+
+Since 0.10.0 Amber uses [Grunt.js](http://gruntjs.com/) as build system.
+To compile Amber on the commandline execute the following commands:
+
+#    cd ${Amber_DIR}
+#    npm install
+#    ./node_modules/grunt/bin/grunt
+
 More infos
 More infos
 ----------
 ----------
 
 

+ 0 - 15
js/Additional-Examples.deploy.js

@@ -1,15 +0,0 @@
-smalltalk.addPackage('Additional-Examples', {});
-smalltalk.addClass('ClassInitializationExample', smalltalk.Object, [], 'Additional-Examples');
-
-smalltalk.addMethod(
-'_initialize',
-smalltalk.method({
-selector: 'initialize',
-fn: function (){
-var self=this;
-smalltalk.send((typeof window == 'undefined' ? nil : window), "_alert_", [smalltalk.send(smalltalk.send("Hello from inside the ", "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [" initialize method."])]);
-return self;}
-}),
-smalltalk.ClassInitializationExample.klass);
-
-

+ 0 - 21
js/Additional-Examples.js

@@ -1,21 +0,0 @@
-smalltalk.addPackage('Additional-Examples', {});
-smalltalk.addClass('ClassInitializationExample', smalltalk.Object, [], 'Additional-Examples');
-smalltalk.ClassInitializationExample.comment=unescape('This%20class%20will%20pop%20up%20an%20alert%20when%20it%20is%20loaded%20into%20Amber.')
-
-smalltalk.addMethod(
-unescape('_initialize'),
-smalltalk.method({
-selector: unescape('initialize'),
-category: 'initialization',
-fn: function (){
-var self=this;
-smalltalk.send((typeof window == 'undefined' ? nil : window), "_alert_", [smalltalk.send(smalltalk.send("Hello from inside the ", "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [" initialize method."])]);
-return self;},
-args: [],
-source: unescape('initialize%0A%09window%20alert%3A%20%27Hello%20from%20inside%20the%20%27%2C%20self%20printString%20%2C%20%27%20initialize%20method.%27'),
-messageSends: ["alert:", unescape("%2C"), "printString"],
-referencedClasses: []
-}),
-smalltalk.ClassInitializationExample.klass);
-
-

+ 30 - 0
js/Kernel-Objects.deploy.js

@@ -1482,6 +1482,36 @@ return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aSymbol:aSymbol,a
 messageSends: []}),
 messageSends: []}),
 smalltalk.JSObjectProxy);
 smalltalk.JSObjectProxy);
 
 
+smalltalk.addMethod(
+"_at_ifPresent_",
+smalltalk.method({
+selector: "at:ifPresent:",
+fn: function (aSymbol,aBlock){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+		var obj = self['@jsObject'],
+			symbol = aSymbol._asString();
+		return symbol in obj ? aBlock(obj[symbol]) : nil;
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aSymbol:aSymbol,aBlock:aBlock},smalltalk.JSObjectProxy)})},
+messageSends: []}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+"_at_ifPresent_ifAbsent_",
+smalltalk.method({
+selector: "at:ifPresent:ifAbsent:",
+fn: function (aSymbol,aBlock,anotherBlock){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+		var obj = self['@jsObject'],
+			symbol = aSymbol._asString();
+		return symbol in obj ? aBlock(obj[symbol]) : anotherBlock();
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aSymbol:aSymbol,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSObjectProxy)})},
+messageSends: []}),
+smalltalk.JSObjectProxy);
+
 smalltalk.addMethod(
 smalltalk.addMethod(
 "_at_put_",
 "_at_put_",
 smalltalk.method({
 smalltalk.method({

+ 40 - 0
js/Kernel-Objects.js

@@ -2076,6 +2076,46 @@ referencedClasses: []
 }),
 }),
 smalltalk.JSObjectProxy);
 smalltalk.JSObjectProxy);
 
 
+smalltalk.addMethod(
+"_at_ifPresent_",
+smalltalk.method({
+selector: "at:ifPresent:",
+category: 'accessing',
+fn: function (aSymbol,aBlock){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+		var obj = self['@jsObject'],
+			symbol = aSymbol._asString();
+		return symbol in obj ? aBlock(obj[symbol]) : nil;
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aSymbol:aSymbol,aBlock:aBlock},smalltalk.JSObjectProxy)})},
+args: ["aSymbol", "aBlock"],
+source: "at: aSymbol ifPresent: aBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined or return nil\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'],\x0a\x09\x09\x09symbol = aSymbol._asString();\x0a\x09\x09return symbol in obj ? aBlock(obj[symbol]) : nil;\x0a\x09>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+"_at_ifPresent_ifAbsent_",
+smalltalk.method({
+selector: "at:ifPresent:ifAbsent:",
+category: 'accessing',
+fn: function (aSymbol,aBlock,anotherBlock){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+		var obj = self['@jsObject'],
+			symbol = aSymbol._asString();
+		return symbol in obj ? aBlock(obj[symbol]) : anotherBlock();
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aSymbol:aSymbol,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSObjectProxy)})},
+args: ["aSymbol", "aBlock", "anotherBlock"],
+source: "at: aSymbol ifPresent: aBlock ifAbsent: anotherBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined\x0a\x09or return value of anotherBlock\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'],\x0a\x09\x09\x09symbol = aSymbol._asString();\x0a\x09\x09return symbol in obj ? aBlock(obj[symbol]) : anotherBlock();\x0a\x09>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy);
+
 smalltalk.addMethod(
 smalltalk.addMethod(
 "_at_put_",
 "_at_put_",
 smalltalk.method({
 smalltalk.method({

+ 56 - 0
js/Kernel-Tests.deploy.js

@@ -1884,6 +1884,62 @@ return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:test
 messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]}),
 messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]}),
 smalltalk.JSObjectProxyTest);
 smalltalk.JSObjectProxyTest);
 
 
+smalltalk.addMethod(
+"_testAtIfPresent",
+smalltalk.method({
+selector: "testAtIfPresent",
+fn: function (){
+var self=this;
+var testObject;
+return smalltalk.withContext(function($ctx1) { 
testObject=_st(self)._jsObject();
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_("abc",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),nil);
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_("e",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_("a",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello 1");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_("f",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
+return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
+messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+"_testAtIfPresentIfAbsent",
+smalltalk.method({
+selector: "testAtIfPresentIfAbsent",
+fn: function (){
+var self=this;
+var testObject;
+return smalltalk.withContext(function($ctx1) { 
testObject=_st(self)._jsObject();
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
+return smalltalk.withContext(function($ctx2) {
return "not present";
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not present");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
+return smalltalk.withContext(function($ctx2) {
return "not present";
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
+return smalltalk.withContext(function($ctx2) {
return "not present";
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello 1");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
+return smalltalk.withContext(function($ctx2) {
return "not present";
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
+return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
+messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]}),
+smalltalk.JSObjectProxyTest);
+
 smalltalk.addMethod(
 smalltalk.addMethod(
 "_testDNU",
 "_testDNU",
 smalltalk.method({
 smalltalk.method({

+ 66 - 0
js/Kernel-Tests.js

@@ -2419,6 +2419,72 @@ referencedClasses: []
 }),
 }),
 smalltalk.JSObjectProxyTest);
 smalltalk.JSObjectProxyTest);
 
 
+smalltalk.addMethod(
+"_testAtIfPresent",
+smalltalk.method({
+selector: "testAtIfPresent",
+category: 'tests',
+fn: function (){
+var self=this;
+var testObject;
+return smalltalk.withContext(function($ctx1) { 
testObject=_st(self)._jsObject();
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_("abc",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),nil);
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_("e",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_("a",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello 1");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_("f",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
+return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
+args: [],
+source: "testAtIfPresent\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09self assert: (testObject at: 'abc' ifPresent: [:x|'hello ',x asString]) equals: nil.\x0a\x09self assert: (testObject at: 'e' ifPresent: [:x|'hello ',x asString]) equals: 'hello nil'.\x0a\x09self assert: (testObject at: 'a' ifPresent: [:x|'hello ',x asString]) equals: 'hello 1'.\x0a\x09self assert: (testObject at: 'f' ifPresent: [:x|'hello ',x asString]) equals: 'hello nil'.",
+messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+"_testAtIfPresentIfAbsent",
+smalltalk.method({
+selector: "testAtIfPresentIfAbsent",
+category: 'tests',
+fn: function (){
+var self=this;
+var testObject;
+return smalltalk.withContext(function($ctx1) { 
testObject=_st(self)._jsObject();
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
+return smalltalk.withContext(function($ctx2) {
return "not present";
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not present");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
+return smalltalk.withContext(function($ctx2) {
return "not present";
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
+return smalltalk.withContext(function($ctx2) {
return "not present";
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello 1");
+_st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
+return smalltalk.withContext(function($ctx2) {
return _st("hello ").__comma(_st(x)._asString());
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
+return smalltalk.withContext(function($ctx2) {
return "not present";
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
+return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
+args: [],
+source: "testAtIfPresentIfAbsent\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09self assert: (testObject at: 'abc' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'not present'.\x0a\x09self assert: (testObject at: 'e' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'hello nil'.\x0a\x09self assert: (testObject at: 'a' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'hello 1'.\x0a\x09self assert: (testObject at: 'f' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'hello nil'.",
+messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxyTest);
+
 smalltalk.addMethod(
 smalltalk.addMethod(
 "_testDNU",
 "_testDNU",
 smalltalk.method({
 smalltalk.method({

+ 11 - 11
js/boot.js

@@ -823,23 +823,23 @@ smalltalk.wrapClassName("PackageOrganizer", "Kernel-Objects", SmalltalkPackageOr
 smalltalk.wrapClassName("ClassOrganizer", "Kernel-Objects", SmalltalkClassOrganizer, smalltalk.Organizer, false);
 smalltalk.wrapClassName("ClassOrganizer", "Kernel-Objects", SmalltalkClassOrganizer, smalltalk.Organizer, false);
 
 
 
 
-smalltalk.wrapClassName("Number", "Kernel", Number, smalltalk.Object);
-smalltalk.wrapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
-smalltalk.wrapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
-smalltalk.wrapClassName("Date", "Kernel", Date, smalltalk.Object);
-smalltalk.wrapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object, false);
+smalltalk.wrapClassName("Number", "Kernel-Objects", Number, smalltalk.Object);
+smalltalk.wrapClassName("BlockClosure", "Kernel-Methods", Function, smalltalk.Object);
+smalltalk.wrapClassName("Boolean", "Kernel-Objects", Boolean, smalltalk.Object);
+smalltalk.wrapClassName("Date", "Kernel-Objects", Date, smalltalk.Object);
+smalltalk.wrapClassName("UndefinedObject", "Kernel-Objects", SmalltalkNil, smalltalk.Object, false);
 
 
 smalltalk.addClass("Collection", smalltalk.Object, null, "Kernel");
 smalltalk.addClass("Collection", smalltalk.Object, null, "Kernel");
 smalltalk.addClass("IndexableCollection", smalltalk.Collection, null, "Kernel");
 smalltalk.addClass("IndexableCollection", smalltalk.Collection, null, "Kernel");
 smalltalk.addClass("SequenceableCollection", smalltalk.IndexableCollection, null, "Kernel");
 smalltalk.addClass("SequenceableCollection", smalltalk.IndexableCollection, null, "Kernel");
 smalltalk.addClass("CharacterArray", smalltalk.SequenceableCollection, null, "Kernel");
 smalltalk.addClass("CharacterArray", smalltalk.SequenceableCollection, null, "Kernel");
-smalltalk.wrapClassName("String", "Kernel", String, smalltalk.CharacterArray);
-smalltalk.wrapClassName("Symbol", "Kernel", SmalltalkSymbol, smalltalk.CharacterArray, false);
-smalltalk.wrapClassName("Array", "Kernel", Array, smalltalk.SequenceableCollection);
-smalltalk.wrapClassName("RegularExpression", "Kernel", RegExp, smalltalk.Object);
+smalltalk.wrapClassName("String", "Kernel-Collections", String, smalltalk.CharacterArray);
+smalltalk.wrapClassName("Symbol", "Kernel-Collections", SmalltalkSymbol, smalltalk.CharacterArray, false);
+smalltalk.wrapClassName("Array", "Kernel-Collections", Array, smalltalk.SequenceableCollection);
+smalltalk.wrapClassName("RegularExpression", "Kernel-Collections", RegExp, smalltalk.Object);
 
 
-smalltalk.wrapClassName("Error", "Kernel", Error, smalltalk.Object);
-smalltalk.wrapClassName("MethodContext", "Kernel", SmalltalkMethodContext, smalltalk.Object, false);
+smalltalk.wrapClassName("Error", "Kernel-Exceptions", Error, smalltalk.Object);
+smalltalk.wrapClassName("MethodContext", "Kernel-Methods", SmalltalkMethodContext, smalltalk.Object, false);
 
 
 /* Alias definitions */
 /* Alias definitions */
 
 

File diff suppressed because it is too large
+ 0 - 7
js/lib/peg-0.7.0.min.js


+ 19 - 0
st/Kernel-Objects.st

@@ -681,6 +681,25 @@ at: aSymbol ifAbsent: aBlock
 	>
 	>
 !
 !
 
 
+at: aSymbol ifPresent: aBlock
+	"return the evaluation of aBlock with the value if the property is defined or return nil"
+	<
+		var obj = self['@jsObject'],
+			symbol = aSymbol._asString();
+		return symbol in obj ? aBlock(obj[symbol]) : nil;
+	>
+!
+
+at: aSymbol ifPresent: aBlock ifAbsent: anotherBlock
+	"return the evaluation of aBlock with the value if the property is defined
+	or return value of anotherBlock"
+	<
+		var obj = self['@jsObject'],
+			symbol = aSymbol._asString();
+		return symbol in obj ? aBlock(obj[symbol]) : anotherBlock();
+	>
+!
+
 at: aSymbol put: anObject
 at: aSymbol put: anObject
 	<self['@jsObject'][aSymbol._asString()] = anObject>
 	<self['@jsObject'][aSymbol._asString()] = anObject>
 !
 !

+ 18 - 0
st/Kernel-Tests.st

@@ -985,6 +985,24 @@ testAtIfAbsent
 	self assert: (testObject at: 'f' ifAbsent: ['Property does not exist']) equals: nil.
 	self assert: (testObject at: 'f' ifAbsent: ['Property does not exist']) equals: nil.
 !
 !
 
 
+testAtIfPresent
+	| testObject |
+	testObject := self jsObject.
+	self assert: (testObject at: 'abc' ifPresent: [:x|'hello ',x asString]) equals: nil.
+	self assert: (testObject at: 'e' ifPresent: [:x|'hello ',x asString]) equals: 'hello nil'.
+	self assert: (testObject at: 'a' ifPresent: [:x|'hello ',x asString]) equals: 'hello 1'.
+	self assert: (testObject at: 'f' ifPresent: [:x|'hello ',x asString]) equals: 'hello nil'.
+!
+
+testAtIfPresentIfAbsent
+	| testObject |
+	testObject := self jsObject.
+	self assert: (testObject at: 'abc' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'not present'.
+	self assert: (testObject at: 'e' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'hello nil'.
+	self assert: (testObject at: 'a' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'hello 1'.
+	self assert: (testObject at: 'f' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'hello nil'.
+!
+
 testDNU
 testDNU
 	self should: [self jsObject foo] raise: MessageNotUnderstood
 	self should: [self jsObject foo] raise: MessageNotUnderstood
 !
 !

+ 0 - 10
test/run_build.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-cd `dirname ${0}`/..
-
-
-# Create the build file
-cat js/boot.js js/Kernel-Announcements.js js/Kernel-Classes.js js/Kernel-Collections.js  js/Kernel-Exceptions.js js/Kernel-Methods.js js/Kernel-Objects.js js/Kernel-Transcript.js js/Compiler-AST.js js/Compiler-Core.js js/Compiler-Exceptions.js js/Compiler-IR.js js/Compiler-Inlining.js js/Compiler-Interpreter.js js/Compiler-Semantic.js js/SUnit.js js/Kernel-Tests.js js/Compiler-Tests.js js/SUnit-Tests.js test/Test.js js/parser.js js/init.js > test/run.js
-
-
-#run it!
-node test/run.js

Some files were not shown because too many files changed in this diff