2
0
Эх сурвалжийг харах

support for Dynamic strings concatenation

It also works for many other concatenation situations.

Dynamic example:
```
var x:Dynamic = null;
var y:Dynamic = "hello";
//Dynamic var + Dynamic var, where one is null, the other is a string:
var c = x + y;
```
This will *not* be compiled as `x .. y` and also will throw `arifmetic
on nil value` error.
PeyTy 10 жил өмнө
parent
commit
5e91f503af

+ 1 - 0
std/lua/_std/String.hx

@@ -32,6 +32,7 @@ class String {
 
 
 	static function __init__() : Void untyped{
 	static function __init__() : Void untyped{
 		__lua__("getmetatable('').__index = String.__index");
 		__lua__("getmetatable('').__index = String.__index");
+		__lua__("getmetatable('').__add = function(a,b) return Std.string(a)..Std.string(b) end");
 	}
 	}
 
 
 	@:keep
 	@:keep