mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 729584 - mozJSComponentLoader::ImportInto needs to wrap exceptions (r=bholley)
--HG-- extra : rebase_source : c5c575a789647348fcca5bf9ef5368873f0016f4
This commit is contained in:
parent
bca7462e8a
commit
e360e8fdf0
@ -1164,19 +1164,21 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation,
|
||||
if (!newEntry || !mInProgressImports.Put(key, newEntry))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
jsval exception = JSVAL_VOID;
|
||||
JS::Anchor<jsval> exception(JSVAL_VOID);
|
||||
rv = GlobalForLocation(sourceLocalFile, resURI, &newEntry->global,
|
||||
&newEntry->location, &exception);
|
||||
&newEntry->location, &exception.get());
|
||||
|
||||
mInProgressImports.Remove(key);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
*_retval = nsnull;
|
||||
|
||||
if (!JSVAL_IS_VOID(exception)) {
|
||||
if (!JSVAL_IS_VOID(exception.get())) {
|
||||
// An exception was thrown during compilation. Propagate it
|
||||
// out to our caller so they can report it.
|
||||
JS_SetPendingException(callercx, exception);
|
||||
if (!JS_WrapValue(callercx, &exception.get()))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
JS_SetPendingException(callercx, exception.get());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user