Bug 1559275 - Use JS::CompileOptions in AsyncScriptCompiler. r=kmag
authorTed Campbell <tcampbell@mozilla.com>
Wed, 19 Jun 2019 00:27:41 +0000
changeset 479166 3c83d9936c2c2b2ecaf2944db29f2ecb56950cf3
parent 479165 a87fb6dc17bfb0046fa6a4fb572f81c3369b8d9b
child 479167 cd6b4126a1b63d23ebd7a42ff69434cfef655314
push id36172
push userrgurzau@mozilla.com
push dateWed, 19 Jun 2019 09:55:37 +0000
treeherdermozilla-central@8bce401b8833 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1559275
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
js/xpconnect/loader/ChromeScriptLoader.cpp
--- a/js/xpconnect/loader/ChromeScriptLoader.cpp
+++ b/js/xpconnect/loader/ChromeScriptLoader.cpp
@@ -86,20 +86,22 @@ NS_IMPL_QUERY_INTERFACE_INHERITED(AsyncS
 NS_IMPL_ADDREF_INHERITED(AsyncScriptCompiler, Runnable)
 NS_IMPL_RELEASE_INHERITED(AsyncScriptCompiler, Runnable)
 
 nsresult AsyncScriptCompiler::Start(
     JSContext* aCx, const CompileScriptOptionsDictionary& aOptions,
     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;
   }
 
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), mURL);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIChannel> channel;