LPGhatguy / roblox-lua-promise

(NO LONGER MAINTAINED) An implementation of promises akin to JavaScript's Promises/A+
Creative Commons Zero v1.0 Universal
23 stars 4 forks source link

Replace naive implementation of Promise.is #6

Closed Validark closed 6 years ago

Validark commented 6 years ago
LPGhatguy commented 6 years ago

Using a weak hash table is really unnecessary for checking the type of a promise. The improvement to be made there would be to use a userdata as a key!

I like the last change of changing the promise constructor variable to self a lot. I've been doing that in newer code.

LPGhatguy commented 6 years ago

I'm going to go ahead and close this for the same reasons that I talked about over on your other PR.

I'll also switch over the type marker to be a userdata, which I haven't done quite yet. That should help resolve the problem you identified here!