Bug 472585 - 'Workers: 'importScripts()' with no args throws an exception against spec'. r+sr+a=sicking.

This commit is contained in:
Ben Turner 2009-01-13 10:43:23 -08:00
parent ebb42f9d99
commit 9e4c216172
3 changed files with 7 additions and 4 deletions

View File

@ -211,8 +211,8 @@ nsDOMWorkerFunctions::LoadScripts(JSContext* aCx,
}
if (!aArgc) {
JS_ReportError(aCx, "Function must have at least one argument!");
return JS_FALSE;
// No argument is ok according to spec.
return JS_TRUE;
}
nsAutoTArray<nsString, 10> urls;

View File

@ -1,3 +1,6 @@
// Try no args. This shouldn't do anything.
importScripts();
onmessage = function(event) {
switch (event.data) {
case 'start':

View File

@ -29,13 +29,13 @@ Tests of DOM Worker Threads (Bug 437152)
SimpleTest.finish();
break;
default:
ok(false, "Unexpected message:" + message);
ok(false, "Unexpected message:" + event.data);
SimpleTest.finish();
}
};
worker.onerror = function(event) {
ok(false, "Worker had an error:" + event.data);
ok(false, "Worker had an error:" + event.message);
SimpleTest.finish();
}