Skip to content

Fix for Thread.create issue with Haxe nightlies#188

Open
AlexHaxe wants to merge 8 commits intomassive-oss:masterfrom
AlexHaxe:fix_thread_create
Open

Fix for Thread.create issue with Haxe nightlies#188
AlexHaxe wants to merge 8 commits intomassive-oss:masterfrom
AlexHaxe:fix_thread_create

Conversation

@AlexHaxe
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/massive/munit/TestRunner.hx Outdated
var self = this;
var runThread:Thread = Thread.create(function()
var createThread = Thread.create;
#if (haxe4 && (haxe >= version("4.2.0-rc.1")))
Copy link
Copy Markdown
Contributor

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"))?

Copy link
Copy Markdown
Contributor

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;

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

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"))
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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))

@SlavaRa
Copy link
Copy Markdown
Contributor

SlavaRa commented Dec 19, 2020

looks good

Comment thread src/massive/munit/import.hx Outdated
package massive.munit;

#if haxe4
#if (haxe >= version("4.1.0"))
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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;

;)

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 this pull request may close these issues.

2 participants