Closed Validark closed 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.
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!
Promise.is{_type = "Promise"}
would previously return true, now it returns falseobject
passed intoPromise.is
is an actual Promise.Promise.new
variablepromise
toself
, as that is what is used to refer to thepromise
elsewhere