-
Notifications
You must be signed in to change notification settings - Fork 788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError due to isObject unable to recognize Objects (node 6) #281
Comments
hagemt
pushed a commit
to hagemt/co
that referenced
this issue
Jul 18, 2016
fixed `'object' == typeof null`; caught by tests
Tested node versions:
Looks like a node regression sometime between 6.2.2 and 6.3.0. |
Works fine for me, node 6.7.0 |
FWIW, looks like this was fixed by 6.4.0:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction:
nvm install 6 && npm install co && node
Readme.md
:Expected:
{ '1': 1, '2': 2 }
However, on the Console, I see:
TypeError: You may only yield a function, promise, generator, array, or object, but the following object was passed: "[object Object]"
Analysis
From my own investigation, it appears that in the context of
isObject
:val.constructor == Object
=>false
(consistently)Testing the following expression in a REPL is fruitless. Both node v{4,6} produce:
({ '1': Promise { 1 }, '2': Promise { 2 } }).constructor == Object
=>true
(consistently)As such, I have made a PR that implements
isObject
usingtypeof
, for the time being.Please advise? Thanks.
The text was updated successfully, but these errors were encountered: