fjgandrade / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

JsRegExp native indexer #197

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
c#: foreach (var match in new JsRegExp(@"expression...").exec(str)) {}
js: ar $it34 = new RegExp("expression...").exec(str).GetEnumerator(); //wrong

JsRegExpResult inherits from JsArray<String>: public class JsRegExpResult : 
JsArray<JsString>
And this is the signature of JsArray<T>:
    [JsType(JsMode.Prototype, Name = "Array", NativeEnumerator = false, Export = false, IgnoreGenericTypeArguments = true, NativeArrayEnumerator = true, NativeCasts = true)]
    public class JsArray<T> : IJsArrayEnumerable<T>, IEnumerable<T>, IEnumerable

This means, JsRegExpResult should user native indexer, not callig 
GetEnumerator(wich doesnt exists)

Original issue reported on code.google.com by DanelK...@gmail.com on 14 Aug 2012 at 2:57

GoogleCodeExporter commented 9 years ago

Original comment by DanelK...@gmail.com on 19 Aug 2012 at 8:33

GoogleCodeExporter commented 9 years ago

Original comment by DanelK...@gmail.com on 19 Aug 2012 at 8:34