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

Add support for Sphere Dispatch API #286

Merged
merged 1 commit into from
Apr 5, 2017
Merged

Add support for Sphere Dispatch API #286

merged 1 commit into from
Apr 5, 2017

Conversation

fatcerberus
Copy link
Contributor

miniSphere is JavaScript game engine maintained by myself and using the Duktape ES5 engine. My environment doesn't have any of the async harnesses (setTimeout, postMessage, etc.) supported by browsers, but does have a function, Dispatch.now(), that serves the same purpose. the core-js Promise implementation doesn't currently work in my environment because of this; this pull adds support for it.

@zloirock
Copy link
Owner

zloirock commented Apr 3, 2017

Hmm... Ok, makes sense.

modules/_task.js Outdated
@@ -41,6 +42,11 @@ if(!setTask || !clearTask){
defer = function(id){
process.nextTick(ctx(run, id, 1));
};
// Sphere (JS game engine) Dispatch API
} else if(Dispatch){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use Dispatch && Dispatch.now for preventing possible conflicts.

Sphere is a JavaScript game engine without any of the async harnesses
normally supported by browsers such as setTimeout(), etc.  It instead
has a unified Dispatch API serving this purpose.  This patch allows the
core-js Promise polyfill to work with this API.
@fatcerberus
Copy link
Contributor Author

Okay, made the requested change. Anything I need to do?

@zloirock
Copy link
Owner

zloirock commented Apr 5, 2017

Nope, thanks.

@zloirock zloirock merged commit f3ed642 into zloirock:master Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants