mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-08 05:52:32 +00:00
Bug 1274915. Switch JS::DescribeScriptedCaller to walk through saved frames when walking the JS stack. r=bzbarsky
This commit is contained in:
parent
cfd9ee05d2
commit
d6e128e540
@ -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;
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user