Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exceptions on windows not catched #211

Closed
AdrianV opened this issue Jul 29, 2020 · 0 comments · Fixed by #279
Closed

exceptions on windows not catched #211

AdrianV opened this issue Jul 29, 2020 · 0 comments · Fixed by #279

Comments

@AdrianV
Copy link

AdrianV commented Jul 29, 2020

This is a reopen of haxe issue HaxeFoundation/haxe#9780
Now I guess the problem is windows specific.

In the following code I tried to follow the problem. DateTools.format() calls the library function date_format which calls strftime. strftime should return 0 for an invalid format and date_format should then return a neko_error(). On linux this strftime ignores the wrong format so the code does not fail, but on windows this silently dies. I don't know whether strftime is the problem here or if all library code which returns neko_error() fails.

Same behaviour when I compile with Haxe 3.4 or 4.2beta. So it is not a regression.

class Main {
	static function main() {
		var date_format = neko.Lib.load("std", "date_format", 2);
		try untyped {
			var string = date_format(Date.now().__t, "%d.%m.%y %Q".__s); // This line should return neko_error()
			trace("here");  // this line is never reached on windows
			trace(__dollar__typeof(string));
			trace("here");
			if (__dollar__typeof(string) != __dollar__tstring)
				string = __dollar__string(string);
			trace(string);
			trace("here");
			trace(__dollar__ssize(string));
		} catch (e: Dynamic) {
			trace(e); // not catched
		}
		trace('Hello World'); // no output on windows
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant