fix: require parentheses for zero-argument join() method on Sequence

The zero-argument overload of `join` on `Sequence` was previously defined as a
getter-style method without parentheses. This change makes it a regular method
that requires explicit parentheses, consistent with the one-argument `join(sep)`
variant and standard Wren method syntax. The implementation now reads
`join() { join("") }` instead of `join { join("") }`.

All call sites in tests and documentation are updated accordingly.
This commit is contained in:
Bob Nystrom
2015-09-16 14:15:48 +00:00
parent ffe87c271d
commit e0984a5012
5 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ System.print([].join(",") == "") // expect: true
System.print([1, 2, 3].join("")) // expect: 123
// Handle a simple list with no separator.
System.print([1, 2, 3].join) // expect: 123
System.print([1, 2, 3].join()) // expect: 123
// Does not quote strings.
System.print([1, "2", true].join(",")) // expect: 1,2,true
+1 -1
View File
@@ -1,4 +1,4 @@
var a = 1..3
System.print(a.join) // expect: 123
System.print(a.join()) // expect: 123
System.print(a.join(", ")) // expect: 1, 2, 3