Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Commit

Permalink
Implement String.Join(string, IEnumerable<string>)
Browse files Browse the repository at this point in the history
This String.Join overload was not declared, although JSIL.JoinEnumerable
would already do the job if asked. This commit connects the two and
updates the existing test to cover the IEnumerable<String> case as well.
The other String.Join overloads are untouched.
  • Loading branch information
mwh committed Dec 15, 2015
1 parent 6bcee52 commit 7743d64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Proxies/String.cs
Expand Up @@ -99,6 +99,12 @@ public abstract class StringProxy {
throw new NotImplementedException();
}

[JSIsPure]
[JSReplacement("JSIL.JoinEnumerable($separator, $values)")]
public static string Join (string separator, IEnumerable<string> values) {
throw new NotImplementedException();
}

[JSChangeName("length")]
[JSAlwaysAccessAsProperty]
[JSNeverReplace]
Expand Down
3 changes: 3 additions & 0 deletions Tests/SimpleTestCases/StringJoinEnumerable.cs
Expand Up @@ -5,6 +5,9 @@ static class Program {
public static void Main () {
IEnumerable<A> items = new List<A>() { new A("Foo"), new A("Bar"), new A("Baz"), new A("Qux") };
Console.WriteLine(string.Join("; ", items));

IEnumerable<string> strings = new List<string> { "Foo", "Bar", "Baz", "Qux" };
Console.WriteLine(string.Join("; ", strings));
}
}

Expand Down

0 comments on commit 7743d64

Please sign in to comment.