mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
String concatenation restricted to + and += signs
This commit is contained in:
@@ -28,4 +28,15 @@ a %= 8;
|
||||
|
||||
assert a == 4, "%= failed";
|
||||
|
||||
//strings as special cases
|
||||
var s = "foo";
|
||||
|
||||
assert s + "bar" == "foobar", "string addition failed";
|
||||
assert s == "foo", "string addition failed (was too sticky)";
|
||||
|
||||
s += "bar";
|
||||
|
||||
assert s == "foobar", "string addition failed (wasn't sticky enough)";
|
||||
|
||||
|
||||
print "All good";
|
||||
Reference in New Issue
Block a user