소스 검색

Fix for String>>at:ifAbsent: and IE7

Nicolas Petton 12 년 전
부모
커밋
9a0d97aa00
3개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      js/Kernel-Collections.deploy.js
  2. 2 2
      js/Kernel-Collections.js
  3. 1 1
      st/Kernel-Collections.st

+ 1 - 1
js/Kernel-Collections.deploy.js

@@ -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);

+ 2 - 2
js/Kernel-Collections.js

@@ -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: []
 }),

+ 1 - 1
st/Kernel-Collections.st

@@ -929,7 +929,7 @@ asciiValue
 !
 
 at: anIndex ifAbsent: aBlock
-	<return String(self)[anIndex - 1] || aBlock()>
+	<return String(self).charAt(anIndex - 1) || aBlock()>
 !
 
 escaped