Permalink
Browse files

Merge branch 'master' of https://github.com/NicolasPetton/amber

  • Loading branch information...
2 parents 139b719 + 657ba49 commit 68a87d2885392b333b600b4c65e17b7c514a1c3c @pdebruic pdebruic committed Mar 15, 2012
Showing with 509 additions and 334 deletions.
  1. +125 −100 js/Kernel-Collections.deploy.js
  2. +183 −148 js/Kernel-Collections.js
  3. +44 −10 js/Kernel-Objects.deploy.js
  4. +64 −15 js/Kernel-Objects.js
  5. +71 −59 st/Kernel-Collections.st
  6. +22 −2 st/Kernel-Objects.st
@@ -1,4 +1,86 @@
smalltalk.addPackage('Kernel-Collections', {});
+smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
+smalltalk.addMethod(
+unescape('__eq'),
+smalltalk.method({
+selector: unescape('%3D'),
+fn: function (anAssociation) {
+var self=this;
+return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(anAssociation, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_key", []), "__eq", [smalltalk.send(anAssociation, "_key", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_value", []), "__eq", [smalltalk.send(anAssociation, "_value", [])]);})]);})]);
+return self;}
+}),
+smalltalk.Association);
+
+smalltalk.addMethod(
+unescape('_key_'),
+smalltalk.method({
+selector: unescape('key%3A'),
+fn: function (aKey) {
+var self=this;
+(self['@key']=aKey);
+return self;}
+}),
+smalltalk.Association);
+
+smalltalk.addMethod(
+unescape('_key'),
+smalltalk.method({
+selector: unescape('key'),
+fn: function () {
+var self=this;
+return self['@key'];
+return self;}
+}),
+smalltalk.Association);
+
+smalltalk.addMethod(
+unescape('_value_'),
+smalltalk.method({
+selector: unescape('value%3A'),
+fn: function (aValue) {
+var self=this;
+(self['@value']=aValue);
+return self;}
+}),
+smalltalk.Association);
+
+smalltalk.addMethod(
+unescape('_value'),
+smalltalk.method({
+selector: unescape('value'),
+fn: function () {
+var self=this;
+return self['@value'];
+return self;}
+}),
+smalltalk.Association);
+
+smalltalk.addMethod(
+unescape('_storeOn_'),
+smalltalk.method({
+selector: unescape('storeOn%3A'),
+fn: function (aStream) {
+var self=this;
+smalltalk.send(self['@key'], "_storeOn_", [aStream]);
+smalltalk.send(aStream, "_nextPutAll_", [unescape("-%3E")]);
+smalltalk.send(self['@value'], "_storeOn_", [aStream]);
+return self;}
+}),
+smalltalk.Association);
+
+
+smalltalk.addMethod(
+unescape('_key_value_'),
+smalltalk.method({
+selector: unescape('key%3Avalue%3A'),
+fn: function (aKey, aValue) {
+var self=this;
+return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
+return self;}
+}),
+smalltalk.Association.klass);
+
+
smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
smalltalk.addMethod(
unescape('_collection'),
@@ -272,88 +354,6 @@ return self;}
smalltalk.Stream.klass);
-smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
-smalltalk.addMethod(
-unescape('__eq'),
-smalltalk.method({
-selector: unescape('%3D'),
-fn: function (anAssociation) {
-var self=this;
-return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(anAssociation, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_key", []), "__eq", [smalltalk.send(anAssociation, "_key", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_value", []), "__eq", [smalltalk.send(anAssociation, "_value", [])]);})]);})]);
-return self;}
-}),
-smalltalk.Association);
-
-smalltalk.addMethod(
-unescape('_key_'),
-smalltalk.method({
-selector: unescape('key%3A'),
-fn: function (aKey) {
-var self=this;
-(self['@key']=aKey);
-return self;}
-}),
-smalltalk.Association);
-
-smalltalk.addMethod(
-unescape('_key'),
-smalltalk.method({
-selector: unescape('key'),
-fn: function () {
-var self=this;
-return self['@key'];
-return self;}
-}),
-smalltalk.Association);
-
-smalltalk.addMethod(
-unescape('_value_'),
-smalltalk.method({
-selector: unescape('value%3A'),
-fn: function (aValue) {
-var self=this;
-(self['@value']=aValue);
-return self;}
-}),
-smalltalk.Association);
-
-smalltalk.addMethod(
-unescape('_value'),
-smalltalk.method({
-selector: unescape('value'),
-fn: function () {
-var self=this;
-return self['@value'];
-return self;}
-}),
-smalltalk.Association);
-
-smalltalk.addMethod(
-unescape('_storeOn_'),
-smalltalk.method({
-selector: unescape('storeOn%3A'),
-fn: function (aStream) {
-var self=this;
-smalltalk.send(self['@key'], "_storeOn_", [aStream]);
-smalltalk.send(aStream, "_nextPutAll_", [unescape("-%3E")]);
-smalltalk.send(self['@value'], "_storeOn_", [aStream]);
-return self;}
-}),
-smalltalk.Association);
-
-
-smalltalk.addMethod(
-unescape('_key_value_'),
-smalltalk.method({
-selector: unescape('key%3Avalue%3A'),
-fn: function (aKey, aValue) {
-var self=this;
-return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
-return self;}
-}),
-smalltalk.Association.klass);
-
-
smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
smalltalk.addMethod(
unescape('_compile_'),
@@ -756,23 +756,23 @@ return self;}
smalltalk.Collection);
smalltalk.addMethod(
-unescape('_asJSONString'),
+unescape('_asOrderedCollection'),
smalltalk.method({
-selector: unescape('asJSONString'),
+selector: unescape('asOrderedCollection'),
fn: function () {
var self=this;
-return smalltalk.send((smalltalk.JSON || JSON), "_stringify_", [smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONString", []);})])]);
+return smalltalk.send(self, "_asArray", []);
return self;}
}),
smalltalk.Collection);
smalltalk.addMethod(
-unescape('_asOrderedCollection'),
+unescape('_asJSON'),
smalltalk.method({
-selector: unescape('asOrderedCollection'),
-fn: function () {
+selector: unescape('asJSON'),
+fn: function (){
var self=this;
-return smalltalk.send(self, "_asArray", []);
+return smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asJSON", []);})]);
return self;}
}),
smalltalk.Collection);
@@ -1779,23 +1779,23 @@ return self;}
smalltalk.String);
smalltalk.addMethod(
-unescape('_asJSONString'),
+unescape('_asSymbol'),
smalltalk.method({
-selector: unescape('asJSONString'),
+selector: unescape('asSymbol'),
fn: function () {
var self=this;
-return self;
+return smalltalk.send((smalltalk.Symbol || Symbol), "_lookup_", [self]);
return self;}
}),
smalltalk.String);
smalltalk.addMethod(
-unescape('_asSymbol'),
+unescape('_asJSON'),
smalltalk.method({
-selector: unescape('asSymbol'),
-fn: function () {
+selector: unescape('asJSON'),
+fn: function (){
var self=this;
-return smalltalk.send((smalltalk.Symbol || Symbol), "_lookup_", [self]);
+return self;
return self;}
}),
smalltalk.String);
@@ -2083,6 +2083,17 @@ return self;}
}),
smalltalk.Symbol);
+smalltalk.addMethod(
+unescape('_asJSON'),
+smalltalk.method({
+selector: unescape('asJSON'),
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_asString", []), "_asJSON", []);
+return self;}
+}),
+smalltalk.Symbol);
+
smalltalk.addMethod(
unescape('_lookup_'),
@@ -3144,6 +3155,20 @@ return self;}
}),
smalltalk.HashedCollection);
+smalltalk.addMethod(
+unescape('_asJSON'),
+smalltalk.method({
+selector: unescape('asJSON'),
+fn: function (){
+var self=this;
+var c=nil;
+(c=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
+smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(c, "_at_put_", [key, smalltalk.send(value, "_asJSON", [])]);})]);
+return c;
+return self;}
+}),
+smalltalk.HashedCollection);
+
smalltalk.addMethod(
unescape('_fromPairs_'),
@@ -3281,12 +3306,12 @@ return self;}
smalltalk.Dictionary);
smalltalk.addMethod(
-unescape('_asJSONString'),
+unescape('_asJSON'),
smalltalk.method({
-selector: unescape('asJSONString'),
-fn: function () {
+selector: unescape('asJSON'),
+fn: function (){
var self=this;
-return smalltalk.send(smalltalk.send(self, "_asHashedCollection", []), "_asJSONString", []);
+return smalltalk.send(smalltalk.send(self, "_asHashedCollection", []), "_asJSON", []);
return self;}
}),
smalltalk.Dictionary);
Oops, something went wrong.

0 comments on commit 68a87d2

Please sign in to comment.