|
@@ -187,7 +187,7 @@ unescape('_asJSON'),
|
|
|
smalltalk.method({
|
|
|
selector: unescape('asJSON'),
|
|
|
category: 'converting',
|
|
|
-fn: function (){
|
|
|
+fn: function () {
|
|
|
var self=this;
|
|
|
return smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asJSON", []);})]);
|
|
|
return self;},
|
|
@@ -389,7 +389,7 @@ unescape('_ifEmpty_'),
|
|
|
smalltalk.method({
|
|
|
selector: unescape('ifEmpty%3A'),
|
|
|
category: 'testing',
|
|
|
-fn: function (aBlock){
|
|
|
+fn: function (aBlock) {
|
|
|
var self=this;
|
|
|
return ((($receiver = smalltalk.send(self, "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : (function(){return self;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value", []);}), (function(){return self;})]));
|
|
|
return self;},
|
|
@@ -825,7 +825,7 @@ unescape('_asJSON'),
|
|
|
smalltalk.method({
|
|
|
selector: unescape('asJSON'),
|
|
|
category: 'converting',
|
|
|
-fn: function (){
|
|
|
+fn: function () {
|
|
|
var self=this;
|
|
|
var c=nil;
|
|
|
(c=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
|
@@ -1165,7 +1165,7 @@ unescape('_removeKey_'),
|
|
|
smalltalk.method({
|
|
|
selector: unescape('removeKey%3A'),
|
|
|
category: 'adding/removing',
|
|
|
-fn: function (aKey){
|
|
|
+fn: function (aKey) {
|
|
|
var self=this;
|
|
|
return smalltalk.send(self, "_remove_", [aKey]);
|
|
|
return self;},
|
|
@@ -1323,7 +1323,7 @@ unescape('_asJSON'),
|
|
|
smalltalk.method({
|
|
|
selector: unescape('asJSON'),
|
|
|
category: 'converting',
|
|
|
-fn: function (){
|
|
|
+fn: function () {
|
|
|
var self=this;
|
|
|
return smalltalk.send(smalltalk.send(self, "_asHashedCollection", []), "_asJSON", []);
|
|
|
return self;},
|
|
@@ -1441,7 +1441,7 @@ unescape('_removeKey_ifAbsent_'),
|
|
|
smalltalk.method({
|
|
|
selector: unescape('removeKey%3AifAbsent%3A'),
|
|
|
category: 'adding/removing',
|
|
|
-fn: function (aKey, aBlock){
|
|
|
+fn: function (aKey, aBlock) {
|
|
|
var self=this;
|
|
|
|
|
|
var index = self['@keys'].indexOf(aKey);
|
|
@@ -1673,7 +1673,7 @@ unescape('_first_'),
|
|
|
smalltalk.method({
|
|
|
selector: unescape('first%3A'),
|
|
|
category: 'accessing',
|
|
|
-fn: function (n){
|
|
|
+fn: function (n) {
|
|
|
var self=this;
|
|
|
return smalltalk.send(self, "_copyFrom_to_", [(1), n]);
|
|
|
return self;},
|
|
@@ -2224,318 +2224,6 @@ referencedClasses: []
|
|
|
smalltalk.Array.klass);
|
|
|
|
|
|
|
|
|
-smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_add_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('add%3A'),
|
|
|
-category: 'adding/removing',
|
|
|
-fn: function (anObject) {
|
|
|
-var self=this;
|
|
|
-self.push(anObject); return anObject;;
|
|
|
-return self;},
|
|
|
-args: ["anObject"],
|
|
|
-source: unescape('add%3A%20anObject%0A%09%3Cself.push%28anObject%29%3B%20return%20anObject%3B%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_asJavascript'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('asJavascript'),
|
|
|
-category: 'converting',
|
|
|
-fn: function () {
|
|
|
-var self=this;
|
|
|
-return smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [smalltalk.send(smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJavascript", []);})]), "_join_", [unescape("%2C%20")])]), "__comma", [unescape("%5D")]);
|
|
|
-return self;},
|
|
|
-args: [],
|
|
|
-source: unescape('asJavascript%0A%09%5E%27%5B%27%2C%20%28%28self%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJavascript%5D%29%20join%3A%20%27%2C%20%27%29%2C%20%20%27%5D%27'),
|
|
|
-messageSends: [unescape("%2C"), "join:", "collect:", "asJavascript"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_at_ifAbsent_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('at%3AifAbsent%3A'),
|
|
|
-category: 'accessing',
|
|
|
-fn: function (anIndex, aBlock) {
|
|
|
-var self=this;
|
|
|
-
|
|
|
- var value = self[anIndex - 1];
|
|
|
- if(value === undefined) {
|
|
|
- return aBlock();
|
|
|
- } else {
|
|
|
- return value;
|
|
|
- }
|
|
|
- ;
|
|
|
-return self;},
|
|
|
-args: ["anIndex", "aBlock"],
|
|
|
-source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%20%20%20%20var%20value%20%3D%20self%5BanIndex%20-%201%5D%3B%0A%09%20%20%20%20if%28value%20%3D%3D%3D%20undefined%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_at_put_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('at%3Aput%3A'),
|
|
|
-category: 'accessing',
|
|
|
-fn: function (anIndex, anObject) {
|
|
|
-var self=this;
|
|
|
-return self[anIndex - 1] = anObject;
|
|
|
-return self;},
|
|
|
-args: ["anIndex", "anObject"],
|
|
|
-source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%20%3D%20anObject%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_join_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('join%3A'),
|
|
|
-category: 'enumerating',
|
|
|
-fn: function (aString) {
|
|
|
-var self=this;
|
|
|
-return self.join(aString);
|
|
|
-return self;},
|
|
|
-args: ["aString"],
|
|
|
-source: unescape('join%3A%20aString%0A%09%3Creturn%20self.join%28aString%29%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_remove_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('remove%3A'),
|
|
|
-category: 'adding/removing',
|
|
|
-fn: function (anObject) {
|
|
|
-var self=this;
|
|
|
-
|
|
|
- for(var i=0;i<self.length;i++) {
|
|
|
- if(self[i] == anObject) {
|
|
|
- self.splice(i,1);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- ;
|
|
|
-return self;},
|
|
|
-args: ["anObject"],
|
|
|
-source: unescape('remove%3A%20anObject%0A%09%3C%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09%09%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09%09%09self.splice%28i%2C1%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_removeFrom_to_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('removeFrom%3Ato%3A'),
|
|
|
-category: 'adding/removing',
|
|
|
-fn: function (aNumber, anotherNumber) {
|
|
|
-var self=this;
|
|
|
-self.splice(aNumber - 1,anotherNumber - 1);
|
|
|
-return self;},
|
|
|
-args: ["aNumber", "anotherNumber"],
|
|
|
-source: unescape('removeFrom%3A%20aNumber%20to%3A%20anotherNumber%0A%09%3Cself.splice%28aNumber%20-%201%2CanotherNumber%20-%201%29%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_reversed'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('reversed'),
|
|
|
-category: 'converting',
|
|
|
-fn: function () {
|
|
|
-var self=this;
|
|
|
-return self._copy().reverse();
|
|
|
-return self;},
|
|
|
-args: [],
|
|
|
-source: unescape('reversed%0A%09%3Creturn%20self._copy%28%29.reverse%28%29%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_size'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('size'),
|
|
|
-category: 'accessing',
|
|
|
-fn: function () {
|
|
|
-var self=this;
|
|
|
-return self.length;
|
|
|
-return self;},
|
|
|
-args: [],
|
|
|
-source: unescape('size%0A%09%3Creturn%20self.length%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_sort'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('sort'),
|
|
|
-category: 'enumerating',
|
|
|
-fn: function () {
|
|
|
-var self=this;
|
|
|
-return smalltalk.send(self, "_basicPerform_", ["sort"]);
|
|
|
-return self;},
|
|
|
-args: [],
|
|
|
-source: unescape('sort%0A%20%20%20%20%5Eself%20basicPerform%3A%20%27sort%27'),
|
|
|
-messageSends: ["basicPerform:"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_sort_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('sort%3A'),
|
|
|
-category: 'enumerating',
|
|
|
-fn: function (aBlock) {
|
|
|
-var self=this;
|
|
|
-
|
|
|
- return self.sort(function(a, b) {
|
|
|
- if(aBlock(a,b)) {return -1} else {return 1}
|
|
|
- })
|
|
|
- ;
|
|
|
-return self;},
|
|
|
-args: ["aBlock"],
|
|
|
-source: unescape('sort%3A%20aBlock%0A%09%3C%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%20-1%7D%20else%20%7Breturn%201%7D%0A%09%09%7D%29%0A%09%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_sorted'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('sorted'),
|
|
|
-category: 'enumerating',
|
|
|
-fn: function () {
|
|
|
-var self=this;
|
|
|
-return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
|
|
|
-return self;},
|
|
|
-args: [],
|
|
|
-source: unescape('sorted%0A%09%5Eself%20copy%20sort'),
|
|
|
-messageSends: ["sort", "copy"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_sorted_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('sorted%3A'),
|
|
|
-category: 'enumerating',
|
|
|
-fn: function (aBlock) {
|
|
|
-var self=this;
|
|
|
-return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
|
|
|
-return self;},
|
|
|
-args: ["aBlock"],
|
|
|
-source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sort%3A%20aBlock'),
|
|
|
-messageSends: ["sort:", "copy"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array);
|
|
|
-
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_new_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('new%3A'),
|
|
|
-category: 'instance creation',
|
|
|
-fn: function (anInteger) {
|
|
|
-var self=this;
|
|
|
-return new Array(anInteger);
|
|
|
-return self;},
|
|
|
-args: ["anInteger"],
|
|
|
-source: unescape('new%3A%20anInteger%0A%09%3Creturn%20new%20Array%28anInteger%29%3E'),
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array.klass);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_with_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('with%3A'),
|
|
|
-category: 'instance creation',
|
|
|
-fn: function (anObject) {
|
|
|
-var self=this;
|
|
|
-return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(1)]));
|
|
|
-return self;},
|
|
|
-args: ["anObject"],
|
|
|
-source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5E%28self%20new%3A%201%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09yourself'),
|
|
|
-messageSends: ["at:put:", "yourself", "new:"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array.klass);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_with_with_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('with%3Awith%3A'),
|
|
|
-category: 'instance creation',
|
|
|
-fn: function (anObject, anObject2) {
|
|
|
-var self=this;
|
|
|
-return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(2)]));
|
|
|
-return self;},
|
|
|
-args: ["anObject", "anObject2"],
|
|
|
-source: unescape('with%3A%20anObject%20with%3A%20anObject2%0A%09%20%20%20%20%5E%28self%20new%3A%202%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09yourself'),
|
|
|
-messageSends: ["at:put:", "yourself", "new:"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array.klass);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_with_with_with_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('with%3Awith%3Awith%3A'),
|
|
|
-category: 'instance creation',
|
|
|
-fn: function (anObject, anObject2, anObject3) {
|
|
|
-var self=this;
|
|
|
-return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);smalltalk.send($rec, "_at_put_", [(3), anObject3]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(3)]));
|
|
|
-return self;},
|
|
|
-args: ["anObject", "anObject2", "anObject3"],
|
|
|
-source: unescape('with%3A%20anObject%20with%3A%20anObject2%20with%3A%20anObject3%0A%09%20%20%20%20%5E%28self%20new%3A%203%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09at%3A%203%20put%3A%20anObject3%3B%0A%09%09yourself'),
|
|
|
-messageSends: ["at:put:", "yourself", "new:"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array.klass);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-unescape('_withAll_'),
|
|
|
-smalltalk.method({
|
|
|
-selector: unescape('withAll%3A'),
|
|
|
-category: 'instance creation',
|
|
|
-fn: function (aCollection) {
|
|
|
-var self=this;
|
|
|
-var instance=nil;
|
|
|
-(instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
|
|
|
-smalltalk.send(aCollection, "_withIndexDo_", [(function(each, index){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
|
|
|
-return instance;
|
|
|
-return self;},
|
|
|
-args: ["aCollection"],
|
|
|
-source: unescape('withAll%3A%20aCollection%0A%09%7C%20instance%20%7C%0A%09instance%20%3A%3D%20self%20new%3A%20aCollection%20size.%0A%09aCollection%20withIndexDo%3A%20%5B%3Aeach%20%3Aindex%20%20%7C%0A%09%09instance%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Einstance'),
|
|
|
-messageSends: ["new:", "size", "withIndexDo:", "at:put:"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.Array.klass);
|
|
|
-
|
|
|
-
|
|
|
smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
|
|
|
smalltalk.addMethod(
|
|
|
unescape('__comma'),
|
|
@@ -2835,7 +2523,7 @@ unescape('_asJSON'),
|
|
|
smalltalk.method({
|
|
|
selector: unescape('asJSON'),
|
|
|
category: 'converting',
|
|
|
-fn: function (){
|
|
|
+fn: function () {
|
|
|
var self=this;
|
|
|
return self;
|
|
|
return self;},
|
|
@@ -3696,7 +3384,7 @@ unescape('_asJSON'),
|
|
|
smalltalk.method({
|
|
|
selector: unescape('asJSON'),
|
|
|
category: 'converting',
|
|
|
-fn: function (){
|
|
|
+fn: function () {
|
|
|
var self=this;
|
|
|
return smalltalk.send(smalltalk.send(self, "_asString", []), "_asJSON", []);
|
|
|
return self;},
|