Bug 1274915. Switch JS::DescribeScriptedCaller to walk through saved frames when walking the JS stack. r=bzbarsky

This commit is contained in:
Jan de Mooij 2016-05-26 20:36:09 -04:00
parent cfd9ee05d2
commit d6e128e540
2 changed files with 6 additions and 3 deletions

View File

@ -6422,7 +6422,10 @@ DescribeScriptedCaller(JSContext* cx, AutoFilename* filename, unsigned* lineno,
if (column)
*column = 0;
NonBuiltinFrameIter i(cx, FrameIter::STOP_AT_SAVED);
if (!cx->compartment())
return false;
NonBuiltinFrameIter i(cx, cx->compartment()->principals());
if (i.done())
return false;

View File

@ -591,8 +591,6 @@ mozJSSubScriptLoader::DoLoadSubScriptWithOptions(const nsAString& url,
if (targetObj != result_obj)
principal = GetObjectPrincipal(targetObj);
JSAutoCompartment ac(cx, targetObj);
/* load up the url. From here on, failures are reflected as ``custom''
* js exceptions */
nsCOMPtr<nsIURI> uri;
@ -606,6 +604,8 @@ mozJSSubScriptLoader::DoLoadSubScriptWithOptions(const nsAString& url,
return NS_ERROR_FAILURE;
}
JSAutoCompartment ac(cx, targetObj);
// Suppress caching if we're compiling as content.
StartupCache* cache = (principal == mSystemPrincipal)
? StartupCache::GetSingleton()