-
Notifications
You must be signed in to change notification settings - Fork 61
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
IE8 has console error #161
Comments
Yes, I will check. |
@sdaikichi from where have you installed @jzaefferer if he got it from npm, then it is definitely not from #159, because they didn't make a new release after merging. |
@flore77 I installed from npm. |
The console error is from browserstack-util.js and is present in the already released version. Issue is with IE 8 and lower. |
@tr4n2uil could you look into that? Seems like a recent regression |
@sdaikichi Can you please confirm the test framework that you are using? If you are using |
@vedharish Im using mocha. |
Its not documented anywhere and accordingly hard to tell, but I think Mocha supports IE8: https://github.com/mochajs/mocha/blob/master/karma.conf.js#L91 |
@sdaikichi Are you still facing this issue ? |
@tr4n2uil yes. |
The issue seems to be that Webpack injects an empty exports = {} as a "root" object into JSON3, but JSON3 sort-of requires the global window object as a root on IE <= 8. |
As mentioned by @oliverfriedmann, JSON3 requires the global window object as a root, but here issue is not with webpack, but with following condition in json3
apart from IE8, other browsers evaluates |
I‘m running out of ideas.. is there any way to workaround this? We aimed to but can‘t run automated tests in IE 6-8 due to this. The question whether we should still be testing in these browsers is another one :) |
Follows-up 826d2c7. Before that commit, the reason global "console" was globbered is that the `var console` part of the inner `var console = {}` assignment was hosted by the JavaScript engine. Thus the variable always existed in the local scope as type "undefined", and so the conditional check never saw the real console, and always created a custom one. Thus it always deleted the original console reference, as well as any other it contained. In commit 826d2c7, this was incorrectly fixed by assigning the unchecked expression referring to `console`, thus no longer having a fallback to `{}` in older browsers, because an unchecked reference like that throws an Uncaught ReferenceError. As a result, browserstack-runner was unable to run in IE 9 or older. Fixes browserstack#161. Fixes browserstack#164. Fixes browserstack#212.
Follows-up 826d2c7. Before that commit, the reason global "console" was globbered is that the `var console` part of the inner `var console = {}` assignment was hosted by the JavaScript engine. Thus the variable always existed in the local scope as type "undefined", and so the conditional check never saw the real console, and always created a custom one. Thus it always deleted the original console reference, as well as any other it contained. In commit 826d2c7, this was incorrectly fixed by assigning the unchecked expression referring to `console`, thus no longer having a fallback to `{}` in older browsers, because an unchecked reference like that throws an Uncaught ReferenceError. As a result, browserstack-runner was unable to run in IE 9 or older. Fixes browserstack#161. Fixes browserstack#164. Fixes browserstack#212. Ref browserstack#241.
Follows-up 826d2c7. Before that commit, the reason global "console" was globbered is that the `var console` part of the inner `var console = {}` assignment was hosted by the JavaScript engine. Thus the variable always existed in the local scope as type "undefined", and so the conditional check never saw the real console, and always created a custom one. Thus it always deleted the original console reference, as well as any other it contained. In commit 826d2c7, this was incorrectly fixed by assigning the unchecked expression referring to `console`, thus no longer having a fallback to `{}` in older browsers, because an unchecked reference like that throws an Uncaught ReferenceError. As a result, browserstack-runner was unable to run in IE 9 or older. Fixes #161. Fixes #164. Fixes #212.
I running multi-browser Javascript tests which catch console messages.
Only IE 8(and older) has Console Error:"'prototype' is null or not an object"
(Screenshots with BrowserStack Live)
Probably it comes from JSON3
bestiejs/json3#86
The text was updated successfully, but these errors were encountered: