Bug 465006 - 'Workers: Passing no arguments to the worker constructor throws an NS_ERROR_NOT_INITIALIZED error, incorrectly.' r+sr=jst, a=sicking.

This commit is contained in:
Ben Turner 2008-11-27 01:16:41 -05:00
parent d1e776def5
commit b59d1762af
2 changed files with 3 additions and 4 deletions

View File

@ -5041,7 +5041,7 @@ BaseStubConstructor(nsIWeakReference* aWeakOwner,
rv = initializer->Initialize(currentInner, cx, obj, argc, argv);
if (NS_FAILED(rv)) {
return NS_ERROR_NOT_INITIALIZED;
return rv;
}
}

View File

@ -924,12 +924,11 @@ nsDOMWorker::InitializeInternal(nsIScriptGlobalObject* aOwner,
PRUint32 aArgc,
jsval* aArgv)
{
NS_ENSURE_TRUE(aArgc, NS_ERROR_INVALID_ARG);
NS_ENSURE_TRUE(aArgc, NS_ERROR_XPC_NOT_ENOUGH_ARGS);
NS_ENSURE_ARG_POINTER(aArgv);
NS_ENSURE_TRUE(JSVAL_IS_STRING(aArgv[0]), NS_ERROR_INVALID_ARG);
JSString* str = JS_ValueToString(aCx, aArgv[0]);
NS_ENSURE_STATE(str);
NS_ENSURE_TRUE(str, NS_ERROR_XPC_BAD_CONVERT_JS);
mScriptURL.Assign(nsDependentJSString(str));
NS_ENSURE_FALSE(mScriptURL.IsEmpty(), NS_ERROR_INVALID_ARG);