Bug 1342012 - Support dynamic import from classic scripts by creating ClassicScript objects and associating them with the compiled JSScriptsr r=smaug
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 06 Dec 2018 16:52:17 -0500
changeset 509504 7b1979745763b8c70b35431349892807c6a408f7
parent 509503 92863bfc60c0a9592580b4166aeaf9c013a8b8d5
child 509505 0833244e1e018c2daf196eda87cf4ff97db148fc
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1342012
milestone66.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 1342012 - Support dynamic import from classic scripts by creating ClassicScript objects and associating them with the compiled JSScriptsr r=smaug
dom/script/LoadedScript.cpp
dom/script/LoadedScript.h
dom/script/ModuleLoadRequest.cpp
dom/script/ModuleLoadRequest.h
dom/script/ScriptLoadRequest.cpp
dom/script/ScriptLoadRequest.h
dom/script/ScriptLoader.cpp
testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-classic.html.ini
testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-classic.html.ini
testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-classic.html.ini
testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-classic.html.ini
testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-classic.html.ini
testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-classic.html.ini
--- a/dom/script/LoadedScript.cpp
+++ b/dom/script/LoadedScript.cpp
@@ -48,16 +48,43 @@ LoadedScript::LoadedScript(ScriptKind aK
       mBaseURL(aBaseURL) {
   MOZ_ASSERT(mLoader);
   MOZ_ASSERT(mFetchOptions);
   MOZ_ASSERT(mBaseURL);
 }
 
 LoadedScript::~LoadedScript() { DropJSObjects(this); }
 
+void LoadedScript::AssociateWithScript(JSScript* aScript) {
+  // Set a JSScript's private value to point to this object and
+  // increment our reference count. This is decremented by
+  // HostFinalizeTopLevelScript() below when the JSScript dies.
+
+  MOZ_ASSERT(JS::GetScriptPrivate(aScript).isUndefined());
+  JS::SetScriptPrivate(aScript, JS::PrivateValue(this));
+  AddRef();
+}
+
+void HostFinalizeTopLevelScript(JSFreeOp* aFop, const JS::Value& aPrivate) {
+  // Decrement the reference count of a LoadedScript object that is
+  // pointed to by a dying JSScript. The reference count was
+  // originally incremented by AssociateWithScript() above.
+
+  auto script = static_cast<LoadedScript*>(aPrivate.toPrivate());
+
+#ifdef DEBUG
+  if (script->IsModuleScript()) {
+    JSObject* module = script->AsModuleScript()->mModuleRecord.unbarrieredGet();
+    MOZ_ASSERT(JS::GetModulePrivate(module) == aPrivate);
+  }
+#endif
+
+  script->Release();
+}
+
 //////////////////////////////////////////////////////////////
 // ClassicScript
 //////////////////////////////////////////////////////////////
 
 ClassicScript::ClassicScript(ScriptLoader* aLoader,
                              ScriptFetchOptions* aFetchOptions,
                              nsIURI* aBaseURL)
     : LoadedScript(ScriptKind::eClassic, aLoader, aFetchOptions, aBaseURL) {}
@@ -127,25 +154,16 @@ void ModuleScript::SetModuleRecord(JS::H
   // UnlinkModuleRecord() above.
   MOZ_ASSERT(JS::GetModulePrivate(mModuleRecord).isUndefined());
   JS::SetModulePrivate(mModuleRecord, JS::PrivateValue(this));
 
   HoldJSObjects(this);
   AddRef();
 }
 
-void HostFinalizeTopLevelScript(JSFreeOp* aFop, const JS::Value& aPrivate) {
-  auto script = static_cast<ModuleScript*>(aPrivate.toPrivate());
-  if (script) {
-    MOZ_ASSERT(JS::GetModulePrivate(script->mModuleRecord.unbarrieredGet()) ==
-               aPrivate);
-    script->UnlinkModuleRecord();
-  }
-}
-
 void ModuleScript::SetParseError(const JS::Value& aError) {
   MOZ_ASSERT(!aError.isUndefined());
   MOZ_ASSERT(!HasParseError());
   MOZ_ASSERT(!HasErrorToRethrow());
 
   UnlinkModuleRecord();
   mParseError = aError;
   HoldJSObjects(this);
--- a/dom/script/LoadedScript.h
+++ b/dom/script/LoadedScript.h
@@ -43,16 +43,18 @@ class LoadedScript : public nsISupports 
   bool IsModuleScript() const { return mKind == ScriptKind::eModule; }
 
   inline ClassicScript* AsClassicScript();
   inline ModuleScript* AsModuleScript();
 
   ScriptLoader* Loader() const { return mLoader; }
   ScriptFetchOptions* FetchOptions() const { return mFetchOptions; }
   nsIURI* BaseURL() const { return mBaseURL; }
+
+  void AssociateWithScript(JSScript* aScript);
 };
 
 class ClassicScript final : public LoadedScript {
   ~ClassicScript() = default;
 
  public:
   ClassicScript(ScriptLoader* aLoader, ScriptFetchOptions* aFetchOptions,
                 nsIURI* aBaseURL);
--- a/dom/script/ModuleLoadRequest.cpp
+++ b/dom/script/ModuleLoadRequest.cpp
@@ -20,23 +20,23 @@ namespace dom {
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ModuleLoadRequest)
 NS_INTERFACE_MAP_END_INHERITING(ScriptLoadRequest)
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(ModuleLoadRequest)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(ModuleLoadRequest,
                                                 ScriptLoadRequest)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mBaseURL, mLoader, mModuleScript, mImports)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mLoader, mModuleScript, mImports)
   tmp->ClearDynamicImport();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(ModuleLoadRequest,
                                                   ScriptLoadRequest)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBaseURL, mLoader, mModuleScript, mImports)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLoader, mModuleScript, mImports)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(ModuleLoadRequest,
                                                ScriptLoadRequest)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mDynamicReferencingPrivate)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mDynamicSpecifier)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mDynamicPromise)
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
@@ -69,17 +69,17 @@ static VisitedURLSet* NewVisitedSetForTo
 
   request->mIsInline = false;
   request->mScriptMode = aParent->mScriptMode;
 
   return request;
 }
 
 /* static */ ModuleLoadRequest* ModuleLoadRequest::CreateDynamicImport(
-    nsIURI* aURI, ModuleScript* aScript,
+    nsIURI* aURI, LoadedScript* aScript,
     JS::Handle<JS::Value> aReferencingPrivate, JS::Handle<JSString*> aSpecifier,
     JS::Handle<JSObject*> aPromise) {
   MOZ_ASSERT(aSpecifier);
   MOZ_ASSERT(aPromise);
 
   auto request = new ModuleLoadRequest(
       aURI, aScript->FetchOptions(), SRIMetadata(), aScript->BaseURL(),
       true, /* is top level */
--- a/dom/script/ModuleLoadRequest.h
+++ b/dom/script/ModuleLoadRequest.h
@@ -54,17 +54,17 @@ class ModuleLoadRequest final : public S
                                            ScriptLoader* aLoader);
 
   // Create a module load request for a static module import.
   static ModuleLoadRequest* CreateStaticImport(nsIURI* aURI,
                                                ModuleLoadRequest* aParent);
 
   // Create a module load request for dynamic module import.
   static ModuleLoadRequest* CreateDynamicImport(
-      nsIURI* aURI, ModuleScript* aScript,
+      nsIURI* aURI, LoadedScript* aScript,
       JS::Handle<JS::Value> aReferencingPrivate,
       JS::Handle<JSString*> aSpecifier, JS::Handle<JSObject*> aPromise);
 
   bool IsTopLevel() const override { return mIsTopLevel; }
 
   bool IsDynamicImport() const { return mIsDynamicImport; }
 
   void SetReady() override;
@@ -82,19 +82,16 @@ class ModuleLoadRequest final : public S
 
  public:
   // Is this a request for a top level module script or an import?
   const bool mIsTopLevel;
 
   // Is this the top level request for a dynamic module import?
   const bool mIsDynamicImport;
 
-  // The base URL used for resolving relative module imports.
-  nsCOMPtr<nsIURI> mBaseURL;
-
   // Pointer to the script loader, used to trigger actions when the module load
   // finishes.
   RefPtr<ScriptLoader> mLoader;
 
   // Set to a module script object after a successful load or nullptr on
   // failure.
   RefPtr<ModuleScript> mModuleScript;
 
--- a/dom/script/ScriptLoadRequest.cpp
+++ b/dom/script/ScriptLoadRequest.cpp
@@ -45,25 +45,23 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(ScriptLoadRequest)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(ScriptLoadRequest)
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(ScriptLoadRequest)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ScriptLoadRequest)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mFetchOptions)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mCacheInfo)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mFetchOptions, mCacheInfo)
   tmp->mScript = nullptr;
   tmp->DropBytecodeCacheReferences();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ScriptLoadRequest)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFetchOptions)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCacheInfo)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFetchOptions, mCacheInfo)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(ScriptLoadRequest)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mScript)
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 ScriptLoadRequest::ScriptLoadRequest(ScriptKind aKind, nsIURI* aURI,
                                      ScriptFetchOptions* aFetchOptions,
--- a/dom/script/ScriptLoadRequest.h
+++ b/dom/script/ScriptLoadRequest.h
@@ -268,16 +268,19 @@ class ScriptLoadRequest
       mURL;  // Keep the URI's filename alive during off thread parsing.
   int32_t mLineNo;
   const SRIMetadata mIntegrity;
   const nsCOMPtr<nsIURI> mReferrer;
 
   // Holds the Cache information, which is used to register the bytecode
   // on the cache entry, such that we can load it the next time.
   nsCOMPtr<nsICacheInfoChannel> mCacheInfo;
+
+  // The base URL used for resolving relative module imports.
+  nsCOMPtr<nsIURI> mBaseURL;
 };
 
 class ScriptLoadRequestList : private mozilla::LinkedList<ScriptLoadRequest> {
   typedef mozilla::LinkedList<ScriptLoadRequest> super;
 
  public:
   ~ScriptLoadRequestList();
 
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -542,17 +542,17 @@ static nsresult HandleResolveFailure(JSC
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   aScript->SetParseError(error);
   return NS_OK;
 }
 
 static already_AddRefed<nsIURI> ResolveModuleSpecifier(
-    ModuleScript* aScript, const nsAString& aSpecifier) {
+    LoadedScript* aScript, const nsAString& aSpecifier) {
   // The following module specifiers are allowed by the spec:
   //  - a valid absolute URL
   //  - a valid relative URL that starts with "/", "./" or "../"
   //
   // Bareword module specifiers are currently disallowed as these may be given
   // special meanings in the future.
 
   nsCOMPtr<nsIURI> uri;
@@ -733,19 +733,22 @@ JSObject* HostResolveImportedModule(JSCo
                                     JS::Handle<JSString*> aSpecifier) {
   // Let referencing module script be referencingModule.[[HostDefined]].
   if (aReferencingPrivate.isUndefined()) {
     JS_ReportErrorNumberUC(aCx, js::GetErrorMessage, nullptr,
                            JSMSG_IMPORT_SCRIPT_NOT_FOUND);
     return nullptr;
   }
 
-  auto script = static_cast<ModuleScript*>(aReferencingPrivate.toPrivate());
-  MOZ_ASSERT(JS::GetModulePrivate(script->ModuleRecord()) ==
-             aReferencingPrivate);
+  RefPtr<LoadedScript> script =
+      static_cast<LoadedScript*>(aReferencingPrivate.toPrivate());
+  MOZ_ASSERT_IF(
+      script->IsModuleScript(),
+      JS::GetModulePrivate(script->AsModuleScript()->ModuleRecord()) ==
+          aReferencingPrivate);
 
   // Let url be the result of resolving a module specifier given referencing
   // module script and specifier.
   nsAutoJSString string;
   if (!string.init(aCx, aSpecifier)) {
     return nullptr;
   }
 
@@ -764,17 +767,19 @@ JSObject* HostResolveImportedModule(JSCo
   MOZ_ASSERT(ms->ModuleRecord());
 
   return ms->ModuleRecord();
 }
 
 bool HostPopulateImportMeta(JSContext* aCx,
                             JS::Handle<JS::Value> aReferencingPrivate,
                             JS::Handle<JSObject*> aMetaObject) {
-  auto script = static_cast<ModuleScript*>(aReferencingPrivate.toPrivate());
+  RefPtr<ModuleScript> script =
+      static_cast<ModuleScript*>(aReferencingPrivate.toPrivate());
+  MOZ_ASSERT(script->IsModuleScript());
   MOZ_ASSERT(JS::GetModulePrivate(script->ModuleRecord()) ==
              aReferencingPrivate);
 
   nsAutoCString url;
   MOZ_DIAGNOSTIC_ASSERT(script->BaseURL());
   MOZ_ALWAYS_SUCCEEDS(script->BaseURL()->GetAsciiSpec(url));
 
   JS::Rooted<JSString*> urlString(aCx, JS_NewStringCopyZ(aCx, url.get()));
@@ -792,19 +797,21 @@ bool HostImportModuleDynamically(JSConte
                                  JS::Handle<JSString*> aSpecifier,
                                  JS::Handle<JSObject*> aPromise) {
   if (aReferencingPrivate.isUndefined()) {
     JS_ReportErrorNumberUC(aCx, js::GetErrorMessage, nullptr,
                            JSMSG_IMPORT_SCRIPT_NOT_FOUND);
     return false;
   }
 
-  auto script = static_cast<ModuleScript*>(aReferencingPrivate.toPrivate());
-  MOZ_ASSERT(JS::GetModulePrivate(script->ModuleRecord()) ==
-             aReferencingPrivate);
+  auto script = static_cast<LoadedScript*>(aReferencingPrivate.toPrivate());
+  MOZ_ASSERT_IF(
+      script->IsModuleScript(),
+      JS::GetModulePrivate(script->AsModuleScript()->ModuleRecord()) ==
+          aReferencingPrivate);
 
   // Attempt to resolve the module specifier.
   nsAutoJSString string;
   if (!string.init(aCx, aSpecifier)) {
     return false;
   }
 
   nsCOMPtr<nsIURI> uri = ResolveModuleSpecifier(script, string);
@@ -1628,20 +1635,20 @@ bool ScriptLoader::ProcessInlineScript(n
   // inline classic scripts ignore both these attributes.
   MOZ_ASSERT(!aElement->GetScriptDeferred());
   MOZ_ASSERT_IF(!request->IsModuleRequest(), !aElement->GetScriptAsync());
   request->SetScriptMode(false, aElement->GetScriptAsync());
 
   LOG(("ScriptLoadRequest (%p): Created request for inline script",
        request.get()));
 
+  request->mBaseURL = mDocument->GetDocBaseURI();
+
   if (request->IsModuleRequest()) {
     ModuleLoadRequest* modReq = request->AsModuleRequest();
-    modReq->mBaseURL = mDocument->GetDocBaseURI();
-
     if (aElement->GetParserCreated() != NOT_FROM_PARSER) {
       if (aElement->GetScriptAsync()) {
         AddAsyncRequest(modReq);
       } else {
         AddDeferRequest(modReq);
       }
     }
 
@@ -2518,16 +2525,23 @@ nsresult ScriptLoader::EvaluateScript(Sc
                 } else {
                   rv = NS_ERROR_OUT_OF_MEMORY;
                 }
               }
             }
 
             if (rv == NS_OK) {
               script = exec.GetScript();
+
+              // Create a ClassicScript object and associate it with the
+              // JSScript.
+              RefPtr<ClassicScript> classicScript = new ClassicScript(
+                  this, aRequest->mFetchOptions, aRequest->mBaseURL);
+              classicScript->AssociateWithScript(script);
+
               rv = exec.ExecScript();
             }
           }
 
           // Queue the current script load request to later save the bytecode.
           if (script && encodeBytecode) {
             aRequest->SetScript(script);
             TRACE_FOR_TEST(aRequest->Element(), "scriptloader_encode");
@@ -3296,41 +3310,41 @@ nsresult ScriptLoader::PrepareLoadedRequ
                    mDynamicImportRequests.Contains(aRequest) ||
                    (aRequest->IsModuleRequest() &&
                     !aRequest->AsModuleRequest()->IsTopLevel() &&
                     !aRequest->isInList()) ||
                    mPreloads.Contains(aRequest, PreloadRequestComparator()) ||
                    mParserBlockingRequest == aRequest,
                "aRequest should be pending!");
 
+  nsCOMPtr<nsIURI> uri;
+  rv = channel->GetOriginalURI(getter_AddRefs(uri));
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  // Fixup moz-extension: and resource: URIs, because the channel URI will
+  // point to file:, which won't be allowed to load.
+  if (uri && IsInternalURIScheme(uri)) {
+    aRequest->mBaseURL = uri;
+  } else {
+    channel->GetURI(getter_AddRefs(aRequest->mBaseURL));
+  }
+
   if (aRequest->IsModuleRequest()) {
     MOZ_ASSERT(aRequest->IsSource());
     ModuleLoadRequest* request = aRequest->AsModuleRequest();
 
     // When loading a module, only responses with a JavaScript MIME type are
     // acceptable.
     nsAutoCString mimeType;
     channel->GetContentType(mimeType);
     NS_ConvertUTF8toUTF16 typeString(mimeType);
     if (!nsContentUtils::IsJavascriptMIMEType(typeString)) {
       return NS_ERROR_FAILURE;
     }
 
-    nsCOMPtr<nsIURI> uri;
-    rv = channel->GetOriginalURI(getter_AddRefs(uri));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    // Fixup moz-extension: and resource: URIs, because the channel URI will
-    // point to file:, which won't be allowed to load.
-    if (uri && IsInternalURIScheme(uri)) {
-      request->mBaseURL = uri;
-    } else {
-      channel->GetURI(getter_AddRefs(request->mBaseURL));
-    }
-
     // Attempt to compile off main thread.
     bool couldCompile = false;
     rv = AttemptAsyncScriptCompile(request, &couldCompile);
     NS_ENSURE_SUCCESS(rv, rv);
     if (couldCompile) {
       return NS_OK;
     }
 
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-classic.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-classic.html.ini
@@ -1,10 +1,7 @@
 [propagate-nonce-external-classic.html]
   [Untitled]
     expected: FAIL
 
   [propagate-nonce-external-classic]
     expected: FAIL
 
-  [Dynamically imported module should eval when imported from script w/ a valid nonce.]
-    expected: FAIL
-
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-classic.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-classic.html.ini
@@ -1,10 +1,7 @@
 [propagate-nonce-inline-classic.html]
   [Untitled]
     expected: FAIL
 
   [propagate-nonce-inline-classic]
     expected: FAIL
 
-  [Dynamically imported module should eval when imported from script w/ a valid nonce.]
-    expected: FAIL
-
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-classic.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-classic.html.ini
@@ -1,16 +1,10 @@
 [string-compilation-base-url-external-classic.html]
   [setTimeout should successfully import]
     expected: FAIL
 
-  [eval should successfully import]
-    expected: FAIL
-
-  [Function should successfully import]
-    expected: FAIL
-
   [reflected-inline-event-handlers should successfully import]
     expected: FAIL
 
   [inline-event-handlers-UA-code should successfully import]
     expected: FAIL
 
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-classic.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-classic.html.ini
@@ -1,16 +1,10 @@
 [string-compilation-base-url-inline-classic.html]
   [setTimeout should successfully import]
     expected: FAIL
 
-  [eval should successfully import]
-    expected: FAIL
-
-  [the Function constructor should successfully import]
-    expected: FAIL
-
   [reflected inline event handlers should successfully import]
     expected: FAIL
 
   [inline event handlers triggered via UA code should successfully import]
     expected: FAIL
 
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-classic.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-classic.html.ini
@@ -1,16 +1,10 @@
 [string-compilation-classic.html]
-  [eval should successfully import]
-    expected: FAIL
-
   [setTimeout should successfully import]
     expected: FAIL
 
-  [the Function constructor should successfully import]
-    expected: FAIL
-
   [reflected inline event handlers should successfully import]
     expected: FAIL
 
   [inline event handlers triggered via UA code should successfully import]
     expected: FAIL
 
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-classic.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-classic.html.ini
@@ -1,19 +1,10 @@
 [string-compilation-nonce-classic.html]
   [setTimeout must inherit the nonce from the triggering script, thus execute]
     expected: FAIL
 
-  [direct eval must inherit the nonce from the triggering script, thus execute]
-    expected: FAIL
-
-  [indirect eval must inherit the nonce from the triggering script, thus execute]
-    expected: FAIL
-
-  [the Function constructor must inherit the nonce from the triggering script, thus execute]
-    expected: FAIL
-
   [reflected inline event handlers must inherit the nonce from the triggering script, thus execute]
     expected: FAIL
 
   [inline event handlers triggered via UA code must inherit the nonce from the triggering script, thus execute]
     expected: FAIL