For example, I have pretty current versions of official Joyent NodeJS installed with of course the Google V8 JavaScript engine and also JXcore with the Mozilla SpiderMonkey JavaScript engine.
The former seems to come with native Promises support, the latter seems not to.
(And of course these are not the only two possible environments nodeJS code might run under.
How can my code test its environment to see whether it can use native Promises or not?
It's OK if it detects a proper polyfill as "native" in this case. But it shouldn't detect something like Q as native promises. (Or let me know if I'm wrong about this.)