We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d17b0c commit f82650dCopy full SHA for f82650d
hscript/JsInterp.hx
@@ -25,6 +25,14 @@ class JsInterp extends Interp {
25
return f(this);
26
}
27
28
+ public static function defineArrayExtensions() {
29
+ var arr : Dynamic = Array;
30
+ arr.prototype.copy = function() { var v : Array<Dynamic> = js.Lib.nativeThis; return [for( v in v ) v]; };
31
+ arr.prototype.contains = function(i) return js.Lib.nativeThis.indexOf(i) >= 0;
32
+ arr.prototype.remove = function(x) return @:privateAccess HxOverrides.remove(js.Lib.nativeThis, x);
33
+ arr.prototype.resize = function(len) js.Lib.nativeThis.length = len;
34
+ }
35
+
36
function escapeString(s:String) {
37
return s.split("\\").join("\\\\").split("\r").join("\\r").split("\n").join("\\n").split('"').join('\\"');
38
0 commit comments