fix: 'Promise.isPromise' checks metatable over reading ClassName#324
fix: 'Promise.isPromise' checks metatable over reading ClassName#324OttoHatt wants to merge 1 commit intoQuenty:mainfrom
Conversation
|
I'm good for this. I think we should generalize the isA() calls to be duck typing instead of this classname checks. |
|
Oh wait, this can technically break stuff because of the way Rx works with multiple copies of promises. I'm still ok with this change, but duck typing would be better. Probably need a |
|
Switching to |
|
I think so! We're probably going to need to dummy-type the Promise for compatibility with Eryn's promise soon anyway. |
|
Looks like 14874e8 added ducktyping. Worth looking at again? Not sure of the performance implications over just checking the metatable. |
I've been wanting to return
Table.readOnlytables from inside promises. However I've run into an issue: every value returned from a Promise is checked againstPromise.isPromisefor chaining, which readsClassNamedirectly and causes thereadonlymetatable to throw. My solution is to usegetmetatableinstead, like newer Nevermore classes.