зеркало из https://github.com/mozilla/gecko-dev.git
Bug 920840 - Crash when JS-implemented WebIDL's init method returns a value other than undefined. r=bz
This commit is contained in:
Родитель
b425dec2f5
Коммит
e50d55ac19
|
@ -2040,8 +2040,13 @@ ConstructJSImplementation(JSContext* aCx, const char* aContractId,
|
|||
aRv.Throw(rv);
|
||||
return nullptr;
|
||||
}
|
||||
MOZ_ASSERT(initReturn.isUndefined(),
|
||||
"nsIDOMGlobalPropertyInitializer should return undefined");
|
||||
// With JS-implemented WebIDL, the return value of init() is not used to determine
|
||||
// if init() failed, so init() should only return undefined. Any kind of permission
|
||||
// or pref checking must happen by adding an attribute to the WebIDL interface.
|
||||
if (!initReturn.isUndefined()) {
|
||||
MOZ_ASSERT(false, "The init() method for JS-implemented WebIDL should not return anything");
|
||||
MOZ_CRASH();
|
||||
}
|
||||
}
|
||||
// Extract the JS implementation from the XPCOM object.
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> implWrapped =
|
||||
|
|
Загрузка…
Ссылка в новой задаче