script type="module" evaluation sets document.currentScript

Fixed Issue #9697735


Dominic C.
Nov 7, 2016
This issue is public.
Found in
  • Microsoft Edge
Found in build #
Fixed in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Turn on Experimental JavaScript features to enable ECMAScript modules and load the following HTML:

<!DOCTYPE html>
<script type="module">
export default 42;

Expected result: logs null.
Actual result: logs the script element.


This script is handled as a module–it does not produce a syntax error (compare with the result if type="module" is omitted.)

See the algorithm to “execute a script block” step 5."module" case.1:

“Set the script element’s node document’s currentScript attribute to null.”

document.currentScript should be null, not the script block.


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Jeff W.”

      Changed Status to “Confirmed”

      Changed Status from “Confirmed” to “In progress”

      Changed Status from “In progress” to “In code review”

      Changed Status from “In code review” to “In progress”

      Changed Status from “In progress” to “Fixed”

    • Hello,

      Thank you for providing this information about the issue. We are pleased to report this feature is fixed in Edge 15063 and is available in our latest Insider Preview build.

      Best Wishes,
      The MS Edge Team

    You need to sign in to your Microsoft account to add a comment.

    Sign in