-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fix for Thread.create issue with Haxe nightlies #188
base: master
Are you sure you want to change the base?
Conversation
produces errors when pulling in munit as a lix dependecy in a project
src/massive/munit/TestRunner.hx
Outdated
@@ -189,7 +189,11 @@ class TestRunner implements IAsyncDelegateObserver | |||
|
|||
#if (neko || cpp || java || hl || eval) | |||
var self = this; | |||
var runThread:Thread = Thread.create(function() | |||
var createThread = Thread.create; | |||
#if (haxe4 && (haxe >= version("4.2.0-rc.1"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not #if (haxe >= version("4.2.0-rc.1"))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mb?
var createThread = #if (haxe >= version("4.2.0-rc.1")) Thread.createWithEventLoop #else Thread.create #end;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to break compatibility with Haxe 3, version("x.x.x")
is a Haxe 4 feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that being said... I should have tested with Haxe 3, which makes a bit more ugly. I had to split the conditionals to make it work.
var runThread:Thread = Thread.create(function() | ||
var createThread = Thread.create; | ||
#if haxe4 | ||
#if (haxe >= version("4.2.0-rc.1")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if (haxe> = version (" 4.2.0-rc.1 "))
doesn't work without #if haxe4
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it works fine on Haxe 4, but not on Haxe 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't think it wouldn't compile, but I would still do one assignment instead of two))
looks good |
src/massive/munit/import.hx
Outdated
package massive.munit; | ||
|
||
#if haxe4 | ||
#if (haxe >= version("4.1.0")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add tab?
#if haxe4
#if (...
#else
...
#end
#else
...
#end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and
import Std.isOfType as isOfType;
;)
No description provided.