Skip to content
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

No Globals not working in Opera #212

Closed
paul999 opened this issue Mar 7, 2012 · 5 comments
Closed

No Globals not working in Opera #212

paul999 opened this issue Mar 7, 2012 · 5 comments
Labels
Type: Bug Something isn't working right.

Comments

@paul999
Copy link

paul999 commented Mar 7, 2012

When using qunit with opera the noglobals option is generating failures:

Introduced global variable(s): test-output6, test-output7, test-output8, test-output9Source: ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );

Opera version 11.61
Build 1250
Linux x64

@nimbupani
Copy link

Could you clarify exactly what is expected, and what is not working? Perhaps a pastie with the code you are working on would be useful. cc @miketaylr

@paul999
Copy link
Author

paul999 commented Mar 8, 2012

Hi,

Expected is that there is no warning displayed about new global vars, in firefox and chrome this happens, in Opera it displays the error that there are new global vars.

You can see it happen here: http://js-linux.nl/Javascript-Linux/test.html?noglobals=true In some cases it happens in the first test, in some cases in the second test (It changes on a refresh), the mentioned globals are not from my code at all.
The code in that specif test is here: https://github.com/paul999/Javascript-Linux/blob/master/tests/general.js

@jzaefferer
Copy link
Member

@nimbupani those globals are element IDs are generated by QUnit: https://github.com/jquery/qunit/blob/854308117e9e7dab00b67965ff37437739082b13/qunit/qunit.js#L45

The noglobals feature iterates over all window properties before and after running a test, marking any change as an error. It looks like in Opera, under some conditions, those DOM ids are exposed as window properties.

@miketaylr
Copy link

All browsers expose ids and name properties as globals, with the exception of Firefox which only does this in Quirks Mode. This is actually specced by HTML5, as terrible as it is. :/ (see https://www.w3.org/Bugs/Public/show_bug.cgi?id=11960)

Given that this warning doesn't happen in Chrome, could it be possible that it's something else?

@jzaefferer
Copy link
Member

Gave up and implemented a workaround to ignore those keys when checking for pollution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working right.
Development

No branches or pull requests

4 participants