On Mar 7, 2009, at 11:22 PM, ben turner wrote:

Just to clarify, if two scripts fail to load or compile then Mozilla
always throws the error encountered by the first of the failed
scripts. So, if I have a worker that does this:

 importScripts("1.js", "2.js", "3.js");

and "1.js" fails to load and "3.js" fails to compile then we report
the failed load of "1.js". There is no race here.

-Ben


The issue is not race conditions, the issue is that the behaviour is insufficiently defined, take these cases

1. importScripts("iExist.js", "iDontExist.js")
2. importScripts("iDontExist.js", "iExist.js")
3. importScripts("iExist.js", "iHaveASyntaxError.js")
4. importScripts("iExist.js", "iHaveASyntaxError.js", "iDontExist.js")
5. importScripts("iHaveASyntaxError.js", "iExist.js")
6. importScripts("iDontExist.js", "iHaveASyntaxError.js")
7. importScripts("iHaveASyntaxError.js", "iDontExist.js")

Under the (current) spec model
1. Will execute content of iExist.js, then throw a NETWORK_ERR for iDontExist.js
2. Will throw NETWORK_ERR for iDontExist.js
3. Will execute iExist.js then throw SYNTAX_ERR
4. Will execute iExist.js then throw SYNTAX_ERR
5. Will throw SYNTAX_ERR
6. Will throw NETWORK_ERR
7. Will throw SYNTAX_ERR

Under the firefox model
1. Will throw NETWORK_ERR
2. Will throw NETWORK_ERR
3. Will throw SYNTAX_ERR
4. Will throw SYNTAX_ERR
5. Will throw SYNTAX_ERR
6. Will throw NETWORK_ERR
7. Will throw SYNTAX_ERR

Now the if the spec doesn't specify when syntax checking occurs (eg. compilation, or whatever) you can also have the additional interpretation that all network loads happen before parsing (eg. what i initially thought firefox was doing), in which case cases 4 and 7 may produce a NETWORK_ERR instead of a SYNTAX_ERR

--Oliver

Reply via email to