Skip to content

Commit

Permalink
Fix for String>>at:ifAbsent: and IE7
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasPetton committed Jun 1, 2012
1 parent 5819794 commit 9a0d97a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/Kernel-Collections.deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ smalltalk.method({
selector: "at:ifAbsent:",
fn: function (anIndex, aBlock) {
var self=this;
return String(self)[anIndex - 1] || aBlock();
return String(self).charAt(anIndex - 1) || aBlock();
return self;}
}),
smalltalk.String);
Expand Down
4 changes: 2 additions & 2 deletions js/Kernel-Collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -2713,10 +2713,10 @@ selector: "at:ifAbsent:",
category: 'accessing',
fn: function (anIndex, aBlock) {
var self=this;
return String(self)[anIndex - 1] || aBlock();
return String(self).charAt(anIndex - 1) || aBlock();
return self;},
args: ["anIndex", "aBlock"],
source: "at: anIndex ifAbsent: aBlock\x0a\x09<return String(self)[anIndex - 1] || aBlock()>",
source: "at: anIndex ifAbsent: aBlock\x0a\x09<return String(self).charAt(anIndex - 1) || aBlock()>",
messageSends: [],
referencedClasses: []
}),
Expand Down
2 changes: 1 addition & 1 deletion st/Kernel-Collections.st
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ asciiValue
!

at: anIndex ifAbsent: aBlock
<return String(self)[anIndex - 1] || aBlock()>
<return String(self).charAt(anIndex - 1) || aBlock()>
!

escaped
Expand Down

0 comments on commit 9a0d97a

Please sign in to comment.