Closed Bug 1793652 Opened 2 years ago Closed 2 years ago

Convert docshell JSMs to ESMs

Categories

(Core :: DOM: Navigation, task)

task

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox107 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 1 open bug)

Details

(Whiteboard: [esmification-timeline])

Attachments

(1 file)

The JSMs in question are:

  • docshell/test/unit/AllowJavascriptParent.jsm
  • docshell/test/unit/AllowJavascriptChild.jsm
  • docshell/test/browser/Bug422543Child.jsm
  • docshell/test/browser/Bug1622420Child.jsm
  • docshell/test/chrome/DocShellHelpers.jsm
  • docshell/base/URIFixup.jsm

I attempted to update the reference to DocShellHelpers.jsm to DocShellHelpers.sys.mjs
using ChromeUtils.importESModule in docshell_helpers.js, but this resulted in this error
when running any tests that use docshell_helpers.js:

JavaScript error: chrome://mochitests/content/chrome/docshell/test/chrome/DocShellHelpers.sys.mjs, line 4: SyntaxError: export declarations may only appear at top level of a module

So I've left it to use the DocShellHelpers.jsm fallback for now, but I'll happily change
it if there's any guidance to work around the above error.

Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/000c36afa74e Convert docshell/ JSMs to ESMs. r=nika,arai
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: