-
Notifications
You must be signed in to change notification settings - Fork 373
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
Fix for complex applications. Uncaught TypeError: Cannot convert object to primitive value. #69
Conversation
Fixes ``Uncaught TypeError: Cannot convert object to primitive value`` found when executed on linkedIn.com/pulse/ Just let chrome handle return, it will result in the same outcome. Expected Outcome (after fix): ![image](https://cloud.githubusercontent.com/assets/404081/12068042/1967600a-afd3-11e5-8ead-8b9858b77fed.png) Error encountered: ![image](https://cloud.githubusercontent.com/assets/404081/12068054/48c2f1ca-afd3-11e5-9635-986ca733d115.png)
@bgrins, 👍 ? Simple fix really, allows working with more complex JavaScript frameworks. |
I don't see the error when running the snippet on http://www.linkedIn.com/pulse/. I'm surprised that calling console.log was throwing an exception.. was this on canary? |
This seems like a bug in chrome - I don't think console.log should ever throw. Do you have any extensions installed / do you see it on a clean profile? I'm just hesitant to land it because we have lots of other snippets that do console.log and if it's failing in certain cases this might bite all of them. |
I'll have to check but considering the call stack it looks like it may just On Mon, Mar 21, 2016, 1:29 PM Brian Grinstead [email protected]
|
Could be. Indeed, console is replaceable as per the spec: whatwg/console#1 (at least for now) so a page could do |
Going to close this out since it sounds like that page is doing something weird, but thanks for filing and talking it out |
I would still merge the modification, it works even if people tamper with console. So it is a better implementation. No? |
It is obviously being overwritten by the error call stack, my point still stands, removing console.log improves the success rate of using the script, with the exact same outcome. |
Fixes
Uncaught TypeError: Cannot convert object to primitive value
found when executed on http://www.linkedIn.com/pulse/Just let chrome handle return, it will result in the same outcome.
Expected Outcome (after fix):
Error encountered: