|
@@ -2551,6 +2551,7 @@ fn: function (aBlock,anotherBlock){
|
|
var self=this;
|
|
var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
|
|
|
|
|
+ self = self._numericallyIndexable();
|
|
for(var i = 0; i < self.length; i++)
|
|
for(var i = 0; i < self.length; i++)
|
|
if(aBlock._value_(self[i]))
|
|
if(aBlock._value_(self[i]))
|
|
return self[i];
|
|
return self[i];
|
|
@@ -2558,7 +2559,7 @@ return smalltalk.withContext(function($ctx1) {
|
|
;
|
|
;
|
|
return self}, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.SequenceableCollection)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.SequenceableCollection)})},
|
|
args: ["aBlock", "anotherBlock"],
|
|
args: ["aBlock", "anotherBlock"],
|
|
-source: "detect: aBlock ifNone: anotherBlock\x0a\x09<\x0a\x09\x09for(var i = 0; i < self.length; i++)\x0a\x09\x09\x09if(aBlock._value_(self[i]))\x0a\x09\x09\x09\x09return self[i];\x0a\x09\x09return anotherBlock._value();\x0a\x09>",
|
|
|
|
|
|
+source: "detect: aBlock ifNone: anotherBlock\x0a\x09<\x0a\x09\x09self = self._numericallyIndexable();\x0a\x09\x09for(var i = 0; i < self.length; i++)\x0a\x09\x09\x09if(aBlock._value_(self[i]))\x0a\x09\x09\x09\x09return self[i];\x0a\x09\x09return anotherBlock._value();\x0a\x09>",
|
|
messageSends: [],
|
|
messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
@@ -2571,10 +2572,10 @@ category: 'enumerating',
|
|
fn: function (aBlock){
|
|
fn: function (aBlock){
|
|
var self=this;
|
|
var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
-for(var i=0;i<self.length;i++){aBlock._value_(self[i]);};
|
|
|
|
|
|
+self=self._numericallyIndexable();for(var i=0;i<self.length;i++){aBlock._value_(self[i]);};
|
|
return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
args: ["aBlock"],
|
|
args: ["aBlock"],
|
|
-source: "do: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock._value_(self[i]);}>",
|
|
|
|
|
|
+source: "do: aBlock\x0a\x09<self=self._numericallyIndexable();for(var i=0;i<self.length;i++){aBlock._value_(self[i]);}>",
|
|
messageSends: [],
|
|
messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
@@ -2663,6 +2664,7 @@ fn: function (anObject,aBlock){
|
|
var self=this;
|
|
var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
|
|
|
|
|
+ self = self._numericallyIndexable();
|
|
for(var i=0;i<self.length;i++) {
|
|
for(var i=0;i<self.length;i++) {
|
|
if(self[i].__eq(anObject)) {return i+1}
|
|
if(self[i].__eq(anObject)) {return i+1}
|
|
};
|
|
};
|
|
@@ -2670,7 +2672,7 @@ return smalltalk.withContext(function($ctx1) {
|
|
;
|
|
;
|
|
return self}, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
args: ["anObject", "aBlock"],
|
|
args: ["anObject", "aBlock"],
|
|
-source: "indexOf: anObject ifAbsent: aBlock\x0a\x09<\x0a\x09\x09for(var i=0;i<self.length;i++) {\x0a\x09\x09\x09if(self[i].__eq(anObject)) {return i+1}\x0a\x09\x09};\x0a\x09\x09return aBlock._value();\x0a\x09>",
|
|
|
|
|
|
+source: "indexOf: anObject ifAbsent: aBlock\x0a\x09<\x0a\x09\x09self = self._numericallyIndexable();\x0a\x09\x09for(var i=0;i<self.length;i++) {\x0a\x09\x09\x09if(self[i].__eq(anObject)) {return i+1}\x0a\x09\x09};\x0a\x09\x09return aBlock._value();\x0a\x09>",
|
|
messageSends: [],
|
|
messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
@@ -2705,6 +2707,7 @@ fn: function (anObject,start,aBlock){
|
|
var self=this;
|
|
var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
|
|
|
|
|
+ self = self._numericallyIndexable();
|
|
for(var i=start-1;i<self.length;i++){
|
|
for(var i=start-1;i<self.length;i++){
|
|
if(self[i].__eq(anObject)) {return i+1}
|
|
if(self[i].__eq(anObject)) {return i+1}
|
|
}
|
|
}
|
|
@@ -2712,7 +2715,7 @@ return smalltalk.withContext(function($ctx1) {
|
|
;
|
|
;
|
|
return self}, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:ifAbsent:",{anObject:anObject,start:start,aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:ifAbsent:",{anObject:anObject,start:start,aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
args: ["anObject", "start", "aBlock"],
|
|
args: ["anObject", "start", "aBlock"],
|
|
-source: "indexOf: anObject startingAt: start ifAbsent: aBlock\x0a\x09<\x0a\x09\x09for(var i=start-1;i<self.length;i++){\x0a\x09\x09\x09if(self[i].__eq(anObject)) {return i+1}\x0a\x09\x09}\x0a\x09\x09return aBlock._value();\x0a\x09>",
|
|
|
|
|
|
+source: "indexOf: anObject startingAt: start ifAbsent: aBlock\x0a\x09<\x0a\x09\x09self = self._numericallyIndexable();\x0a\x09\x09for(var i=start-1;i<self.length;i++){\x0a\x09\x09\x09if(self[i].__eq(anObject)) {return i+1}\x0a\x09\x09}\x0a\x09\x09return aBlock._value();\x0a\x09>",
|
|
messageSends: [],
|
|
messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
@@ -2754,6 +2757,22 @@ referencedClasses: []
|
|
}),
|
|
}),
|
|
smalltalk.SequenceableCollection);
|
|
smalltalk.SequenceableCollection);
|
|
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
|
+smalltalk.method({
|
|
|
|
+selector: "numericallyIndexable",
|
|
|
|
+category: 'private',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+return smalltalk.withContext(function($ctx1) {
|
|
|
|
+self._subclassResponsibility();
|
|
|
|
+return self}, function($ctx1) {$ctx1.fill(self,"numericallyIndexable",{},smalltalk.SequenceableCollection)})},
|
|
|
|
+args: [],
|
|
|
|
+source: "numericallyIndexable\x0a\x09\x22This is internal converting message.\x0a\x09It returns such representation of self\x0a\x09that can use foo[i] in JavaScript code.\x0a\x09It fixes IE8, where boxed String is unable\x0a\x09to numerically index its characters,\x0a\x09but primitive string can.\x22\x0a\x09self subclassResponsibility",
|
|
|
|
+messageSends: ["subclassResponsibility"],
|
|
|
|
+referencedClasses: []
|
|
|
|
+}),
|
|
|
|
+smalltalk.SequenceableCollection);
|
|
|
|
+
|
|
smalltalk.addMethod(
|
|
smalltalk.addMethod(
|
|
smalltalk.method({
|
|
smalltalk.method({
|
|
selector: "readStream",
|
|
selector: "readStream",
|
|
@@ -2909,10 +2928,16 @@ category: 'enumerating',
|
|
fn: function (anotherCollection,aBlock){
|
|
fn: function (anotherCollection,aBlock){
|
|
var self=this;
|
|
var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
-for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], anotherCollection[i]);};
|
|
|
|
|
|
+
|
|
|
|
+ self = self._numericallyIndexable();
|
|
|
|
+ anotherCollection = anotherCollection._numericallyIndexable();
|
|
|
|
+ for(var i=0; i<self.length; i++) {
|
|
|
|
+ aBlock._value_value_(self[i], anotherCollection[i]);
|
|
|
|
+ }
|
|
|
|
+ ;
|
|
return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anotherCollection:anotherCollection,aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anotherCollection:anotherCollection,aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
args: ["anotherCollection", "aBlock"],
|
|
args: ["anotherCollection", "aBlock"],
|
|
-source: "with: anotherCollection do: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], anotherCollection[i]);}>",
|
|
|
|
|
|
+source: "with: anotherCollection do: aBlock\x0a\x09<\x0a\x09\x09self = self._numericallyIndexable();\x0a\x09\x09anotherCollection = anotherCollection._numericallyIndexable();\x0a\x09\x09for(var i=0; i<self.length; i++) {\x0a\x09\x09\x09aBlock._value_value_(self[i], anotherCollection[i]);\x0a\x09\x09}\x0a\x09>",
|
|
messageSends: [],
|
|
messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
@@ -2925,10 +2950,10 @@ category: 'enumerating',
|
|
fn: function (aBlock){
|
|
fn: function (aBlock){
|
|
var self=this;
|
|
var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
-for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], i+1);};
|
|
|
|
|
|
+self=self._numericallyIndexable();for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], i+1);};
|
|
return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.SequenceableCollection)})},
|
|
args: ["aBlock"],
|
|
args: ["aBlock"],
|
|
-source: "withIndexDo: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], i+1);}>",
|
|
|
|
|
|
+source: "withIndexDo: aBlock\x0a\x09<self=self._numericallyIndexable();for(var i=0;i<self.length;i++){aBlock._value_value_(self[i], i+1);}>",
|
|
messageSends: [],
|
|
messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
@@ -3131,6 +3156,22 @@ referencedClasses: []
|
|
}),
|
|
}),
|
|
smalltalk.Array);
|
|
smalltalk.Array);
|
|
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
|
+smalltalk.method({
|
|
|
|
+selector: "numericallyIndexable",
|
|
|
|
+category: 'private',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+return smalltalk.withContext(function($ctx1) {
|
|
|
|
+return self;
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"numericallyIndexable",{},smalltalk.Array)})},
|
|
|
|
+args: [],
|
|
|
|
+source: "numericallyIndexable\x0a\x09^ self",
|
|
|
|
+messageSends: [],
|
|
|
|
+referencedClasses: []
|
|
|
|
+}),
|
|
|
|
+smalltalk.Array);
|
|
|
|
+
|
|
smalltalk.addMethod(
|
|
smalltalk.addMethod(
|
|
smalltalk.method({
|
|
smalltalk.method({
|
|
selector: "printOn:",
|
|
selector: "printOn:",
|
|
@@ -4156,22 +4197,6 @@ referencedClasses: []
|
|
}),
|
|
}),
|
|
smalltalk.String);
|
|
smalltalk.String);
|
|
|
|
|
|
-smalltalk.addMethod(
|
|
|
|
-smalltalk.method({
|
|
|
|
-selector: "do:",
|
|
|
|
-category: 'enumerating',
|
|
|
|
-fn: function (aBlock){
|
|
|
|
-var self=this;
|
|
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
|
-for(var i=0;i<self.length;i++){aBlock._value_(self.charAt(i));};
|
|
|
|
-return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.String)})},
|
|
|
|
-args: ["aBlock"],
|
|
|
|
-source: "do: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock._value_(self.charAt(i));}>",
|
|
|
|
-messageSends: [],
|
|
|
|
-referencedClasses: []
|
|
|
|
-}),
|
|
|
|
-smalltalk.String);
|
|
|
|
-
|
|
|
|
smalltalk.addMethod(
|
|
smalltalk.addMethod(
|
|
smalltalk.method({
|
|
smalltalk.method({
|
|
selector: "escaped",
|
|
selector: "escaped",
|
|
@@ -4533,6 +4558,22 @@ referencedClasses: []
|
|
}),
|
|
}),
|
|
smalltalk.String);
|
|
smalltalk.String);
|
|
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
|
+smalltalk.method({
|
|
|
|
+selector: "numericallyIndexable",
|
|
|
|
+category: 'private',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+return smalltalk.withContext(function($ctx1) {
|
|
|
|
+return String(self);
|
|
|
|
+return self}, function($ctx1) {$ctx1.fill(self,"numericallyIndexable",{},smalltalk.String)})},
|
|
|
|
+args: [],
|
|
|
|
+source: "numericallyIndexable\x0a\x09<return String(self)>",
|
|
|
|
+messageSends: [],
|
|
|
|
+referencedClasses: []
|
|
|
|
+}),
|
|
|
|
+smalltalk.String);
|
|
|
|
+
|
|
smalltalk.addMethod(
|
|
smalltalk.addMethod(
|
|
smalltalk.method({
|
|
smalltalk.method({
|
|
selector: "printNl",
|
|
selector: "printNl",
|
|
@@ -4885,22 +4926,6 @@ referencedClasses: []
|
|
}),
|
|
}),
|
|
smalltalk.String);
|
|
smalltalk.String);
|
|
|
|
|
|
-smalltalk.addMethod(
|
|
|
|
-smalltalk.method({
|
|
|
|
-selector: "withIndexDo:",
|
|
|
|
-category: 'enumerating',
|
|
|
|
-fn: function (aBlock){
|
|
|
|
-var self=this;
|
|
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
|
-for(var i=0;i<self.length;i++){aBlock._value_value_(self.charAt(i), i+1);};
|
|
|
|
-return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.String)})},
|
|
|
|
-args: ["aBlock"],
|
|
|
|
-source: "withIndexDo: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock._value_value_(self.charAt(i), i+1);}>",
|
|
|
|
-messageSends: [],
|
|
|
|
-referencedClasses: []
|
|
|
|
-}),
|
|
|
|
-smalltalk.String);
|
|
|
|
-
|
|
|
|
|
|
|
|
smalltalk.addMethod(
|
|
smalltalk.addMethod(
|
|
smalltalk.method({
|
|
smalltalk.method({
|