Issue6276.hx 619 B

123456789101112131415161718192021
  1. class Issue6276 {
  2. public static function main() {
  3. var s = "foo";
  4. var indexOf = Reflect.field(s, "indexOf");
  5. var isfunc = lua.Lua.type(indexOf) == "function";
  6. if (!isfunc){
  7. trace("DCE should not remove string functions in lua");
  8. Sys.exit(1);
  9. }
  10. var res = Reflect.callMethod(s, indexOf, ["o"]);
  11. if (res != 1){
  12. trace("Something went wrong with calling string methods via reflect");
  13. Sys.exit(1);
  14. }
  15. var eq = Reflect.compareMethods(Reflect.field(s, 'indexOf'), Reflect.field(s, 'indexOf'));
  16. if (!eq){
  17. trace("Reflect.compareMethods should work for string methods");
  18. Sys.exit(1);
  19. }
  20. }
  21. }