Skip to content

Commit

Permalink
[lua] drop some refactored methods from lua.Boot
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonaldson committed Feb 28, 2020
1 parent 0bab113 commit 444ad1a
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions std/lua/Boot.hx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class Boot {

public static var platformBigEndian = NativeStringTools.byte(NativeStringTools.dump(function() {}), 7) > 0;

static var hiddenFields:Table<String,
Bool> = untyped __lua__("{__id__=true, hx__closures=true, super=true, prototype=true, __fields__=true, __ifields__=true, __class__=true, __properties__=true}");
static var hiddenFields:Table<String, Bool> = untyped __lua__("{__id__=true, hx__closures=true, super=true, prototype=true, __fields__=true, __ifields__=true, __class__=true, __properties__=true}");

static function __unhtml(s:String)
return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
Expand Down Expand Up @@ -271,32 +270,6 @@ class Boot {
}
}

public static function fieldIterator(o:Table<String, Dynamic>):Iterator<String> {
if (Lua.type(o) != "table") {
return {
next: function() return null,
hasNext: function() return false
}
}
var tbl:Table<String, String> = cast(untyped o.__fields__ != null) ? o.__fields__ : o;
var cur = Lua.pairs(tbl).next;
var next_valid = function(tbl, val) {
while (hiddenFields[untyped val] != null) {
val = cur(tbl, val).index;
}
return val;
}
var cur_val = next_valid(tbl, cur(tbl, null).index);
return {
next: function() {
var ret = cur_val;
cur_val = next_valid(tbl, cur(tbl, cur_val).index);
return ret;
},
hasNext: function() return cur_val != null
}
}

static var os_patterns = [
'Windows' => ['windows', '^mingw', '^cygwin'],
'Linux' => ['linux'],
Expand Down

0 comments on commit 444ad1a

Please sign in to comment.