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

qunit throws syntax error on Safari 2.0.4 #5

Closed
micmath opened this issue Nov 13, 2009 · 6 comments
Closed

qunit throws syntax error on Safari 2.0.4 #5

micmath opened this issue Nov 13, 2009 · 6 comments

Comments

@micmath
Copy link

micmath commented Nov 13, 2009

It is not possible to use qunit to run tests in the Safari 2.0.4 browser, which is still a Level 2 browser here at the BBC. This is because qunit uses a function declaration pattern that Safari 2.0.4 considers to be a "syntax error."

// snip
test: function test (testName, callback) { // throws error
}

Rewriting those function declarations to be like the following example will allow qunit to run in Safari 2.0.4.

//snip
test: function (testName, callback) { // runs
}
@DBJDBJ
Copy link

DBJDBJ commented Nov 14, 2009

I do not know why are "named function expressions" used here,but if they are needed, one can do this :

var temp;
...
var Qunit = {
test: (temp = function test(){ ... }) ;
...
}
...
temp = null;

This is actually quite good for avoiding lekas too ...
--DBJ

@DBJDBJ
Copy link

DBJDBJ commented Nov 14, 2009

lekas --> leaks

@jeresig
Copy link
Contributor

jeresig commented Nov 15, 2009

Remove the named function expressions, to stop Safari 2 from freaking out. Closed by f55bf2d.

@DBJDBJ
Copy link

DBJDBJ commented Nov 15, 2009

Good. The only reason I can remember, to use named F expressions, is to be able to "see" named (vs anonymous) functions in (visual studio) debugger ...
--DBJ

@micmath
Copy link
Author

micmath commented Nov 15, 2009

This issue, and a possible solution for Safari 2, is discussed further here, in case anyone is interested: http://yura.thinkweb2.com/named-function-expressions/#named-expr

@DBJDBJ
Copy link

DBJDBJ commented Nov 17, 2009

I do not think jQuery or (BBC) Glow will ever have "named function expressions" inside ... Sorry for the noise ;o)

mgol pushed a commit to mgol/qunit that referenced this issue Mar 24, 2021
mgol pushed a commit to mgol/qunit that referenced this issue Mar 24, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants