You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The meanings of Symbol.result in obj[Symbol.result] and func[Symbol.result] are very different. obj[Symbol.result]() is a result corresponding to obj itself, while func[Symbol.result]() is a result corresponding to the return value offunc.
Using the same symbol for both of these meanings, along with recursive unwrapping (#6), completely breaks functions that return other functions.
This evaluates as outer[Symbol.result]() → inner[Symbol.result]() → [null, console.log("inner called")].
Even if you think recursive unwrapping is a good idea, it should only recurse through obj[Symbol.result], not func[Symbol.result]. So we need to use two different symbols for these different meanings.
The text was updated successfully, but these errors were encountered:
Oh I see the polyfill checks typeof result === "object" before recursing. That’s not clear from the description but this hasn’t reached the stage where specification wordsmithing is helpful, so closing for now.
The meanings of
Symbol.result
inobj[Symbol.result]
andfunc[Symbol.result]
are very different.obj[Symbol.result]()
is a result corresponding toobj
itself, whilefunc[Symbol.result]()
is a result corresponding to the return value offunc
.Using the same symbol for both of these meanings, along with recursive unwrapping (#6), completely breaks functions that return other functions.
This evaluates as
outer[Symbol.result]()
→inner[Symbol.result]()
→[null, console.log("inner called")]
.Even if you think recursive unwrapping is a good idea, it should only recurse through
obj[Symbol.result]
, notfunc[Symbol.result]
. So we need to use two different symbols for these different meanings.The text was updated successfully, but these errors were encountered: