kopia lustrzana https://github.com/backface/turtlestitch
				
				
				
			fixed type-issue for linked list indices
thanks, Nate, for reporting this issuepull/3/merge
							rodzic
							
								
									020cac64b1
								
							
						
					
					
						commit
						39ea1d542d
					
				|  | @ -1940,3 +1940,7 @@ ______ | |||
| * Objects: Prevent watcher cells from growing wider as their contents becomes taller | ||||
| * Objects: Keep watchers onstage when hiding/showing them, fixes #195 | ||||
| * BYOB, GUI, locale: New preference setting for plain block prototype labels | ||||
| 
 | ||||
| 131008 | ||||
| ------ | ||||
| * Lists: fixed type-issue for linked list indices (thanks, Nate, for reporting it!) | ||||
|  |  | |||
							
								
								
									
										8
									
								
								lists.js
								
								
								
								
							
							
						
						
									
										8
									
								
								lists.js
								
								
								
								
							|  | @ -61,7 +61,7 @@ PushButtonMorph, SyntaxElementMorph, Color, Point, WatcherMorph, | |||
| StringMorph, SpriteMorph, ScrollFrameMorph, CellMorph, ArrowMorph, | ||||
| MenuMorph, snapEquals, Morph, isNil, localize, MorphicPreferences*/ | ||||
| 
 | ||||
| modules.lists = '2013-June-20'; | ||||
| modules.lists = '2013-October-08'; | ||||
| 
 | ||||
| var List; | ||||
| var ListWatcherMorph; | ||||
|  | @ -200,11 +200,11 @@ List.prototype.length = function () { | |||
| }; | ||||
| 
 | ||||
| List.prototype.at = function (index) { | ||||
|     var value; | ||||
|     var value, idx = +index; | ||||
|     if (this.isLinked) { | ||||
|         return index === 1 ? this.first : this.rest.at(index - 1); | ||||
|         return idx === 1 ? this.first : this.rest.at(idx - 1); | ||||
|     } | ||||
|     value = this.contents[index - 1]; | ||||
|     value = this.contents[idx - 1]; | ||||
|     return isNil(value) ? '' : value; | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 jmoenig
						jmoenig