Bug 1559275 - Use JS::CompileOptions in AsyncScriptCompiler. r=kmag

Initializing OwningCompileOptions directly will soon be deprecated in
order to have consistent defaults. This results in more consistent
behavior of experimental features that are enabled based on realm flags.

Differential Revision: https://phabricator.services.mozilla.com/D35071

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ted Campbell 2019-06-19 00:27:41 +00:00
parent 89a3e34186
commit 243dd6a969

View File

@ -91,10 +91,12 @@ nsresult AsyncScriptCompiler::Start(
nsIPrincipal* aPrincipal) {
mCharset = aOptions.mCharset;
mOptions.setNoScriptRval(!aOptions.mHasReturnValue)
CompileOptions options(aCx);
options.setFile(mURL.get())
.setNoScriptRval(!aOptions.mHasReturnValue)
.setCanLazilyParse(aOptions.mLazilyParse);
if (NS_WARN_IF(!mOptions.setFile(aCx, mURL.get()))) {
if (NS_WARN_IF(!mOptions.copy(aCx, options))) {
return NS_ERROR_OUT_OF_MEMORY;
}