electricessence / TypeScript.NET

A JavaScript-Friendly .NET Based TypeScript Library (Moved)
https://github.com/electricessence/TypeScript.NET-Core
Other
251 stars 36 forks source link

Linq: skip() & takeExceptLast() together will result in exception #46

Closed davis-ip-20160713 closed 7 years ago

davis-ip-20160713 commented 7 years ago

console.log(Enumerable.from([1,2,3,4,5,6]).skip(1).takeExceptLast(2).toArray());

==========out put============

C:\Users\Admin\AppData\Roaming\npm\node_modules\typescript-dotnet-commonjs\System\Collections\Enumeration\EnumeratorBas e.js:130 throw e; ^ ArgumentOutOfRangeException: {stop} NaNis less than start at updateRange (C:\Users\Admin\AppData\Roaming\npm\node_modules\typescript-dotnet-commonjs\System\Collections\Array \Utility.js:110:15) at Object.clear (C:\Users\Admin\AppData\Roaming\npm\node_modules\typescript-dotnet-commonjs\System\Collections\Arra y\Utility.js:118:5) at Queue._clearInternal (C:\Users\Admin\AppData\Roaming\npm\node_modules\typescript-dotnet-commonjs\System\Collecti ons\Queue.js:80:16) at Queue.CollectionBase._onDispose (C:\Users\Admin\AppData\Roaming\npm\node_modules\typescript-dotnet-commonjs\Syst em\Collections\CollectionBase.js:142:14) at Queue._onDispose (C:\Users\Admin\AppData\Roaming\npm\node_modules\typescript-dotnet-commonjs\System\Collections\ Queue.js:90:37) at Queue.DisposableBase.dispose (C:\Users\Admin\AppData\Roaming\npm\node_modules\typescript-dotnet-commonjs\System\ Disposable\DisposableBase.js:30:19)

electricessence commented 7 years ago

Will fix this week.

electricessence commented 7 years ago

Fixed. Added the above check to the unit tests.

electricessence commented 7 years ago

Get the latest v3.2.5 from NPM.