@@ -1059,18 +1059,32 @@ $jsilcore.$ListExternals = function ($, T, type) {
10591059 }
10601060 ) ;
10611061
1062- $ . Method ( { Static :false , Public :true } , "get_Item" ,
1063- new JSIL . MethodSignature ( T , [ mscorlib . TypeRef ( "System.Int32" ) ] , [ ] ) ,
1064- function ( index ) {
1062+ var rangeCheckImpl = function ( index , size ) {
10651063 if ( index < 0 )
10661064 throw new System . ArgumentOutOfRangeException ( "index" ) ;
1067- else if ( index >= this . _size )
1065+ else if ( index >= size )
10681066 throw new System . ArgumentOutOfRangeException ( "index" ) ;
1067+ }
1068+
1069+ $ . Method ( { Static :false , Public :true } , "get_Item" ,
1070+ new JSIL . MethodSignature ( T , [ mscorlib . TypeRef ( "System.Int32" ) ] , [ ] ) ,
1071+ function ( index ) {
1072+ rangeCheckImpl ( index , this . _size ) ;
1073+ return this . _items [ index ] ;
1074+ }
1075+
1076+ ) ;
1077+
1078+ $ . Method ( { Static : false , Public : true } , "set_Item" ,
1079+ new JSIL . MethodSignature ( null , [ mscorlib . TypeRef ( "System.Int32" ) , T ] , [ ] ) ,
1080+ function ( index , value ) {
1081+ rangeCheckImpl ( index , this . _size ) ;
1082+ this . _items [ index ] = value ;
1083+ }
10691084
1070- return this . _items [ index ] ;
1071- }
10721085 ) ;
10731086
1087+
10741088 var getEnumeratorImpl = function ( ) {
10751089 // Detect whether we are a List<T> or an ArrayList.
10761090 if ( typeof ( this . $thisEnumeratorType ) === "undefined" ) {
@@ -1505,7 +1519,8 @@ JSIL.MakeClass("System.Object", "System.Collections.Generic.List`1", true, ["T"]
15051519 $ . ImplementInterfaces (
15061520 $jsilcore . TypeRef ( "System.Collections.Generic.IEnumerable`1" , [ new JSIL . GenericParameter ( "T" , "System.Collections.Generic.List`1" ) ] ) ,
15071521 "System.Collections.IEnumerable" ,
1508- $jsilcore . TypeRef ( "System.Collections.Generic.ICollection`1" , [ new JSIL . GenericParameter ( "T" , "System.Collections.Generic.List`1" ) ] )
1522+ $jsilcore . TypeRef ( "System.Collections.Generic.ICollection`1" , [ new JSIL . GenericParameter ( "T" , "System.Collections.Generic.List`1" ) ] ) ,
1523+ $jsilcore . TypeRef ( "System.Collections.Generic.IList`1" , [ new JSIL . GenericParameter ( "T" , "System.Collections.Generic.List`1" ) ] )
15091524 ) ;
15101525} ) ;
15111526
0 commit comments