window.postMessage throws exception with -2147467260 (E_ABORT) in some circumstances

Confirmed Issue #14719328 • Assigned to Steve B.

Details

Author
Dominik H.
Created
Nov 17, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
16.16299
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

When the following code is executed twice or more times in the console of the F12 developer tools in Edge, an exception is thrown by window.postMessage:

var listener = function(msg){
  console.log(msg.data);
  window.removeEventListener("message", listener);
}
listener = listener.bind(listener);
window.addEventListener("message", listener);
new Promise(function (resolve, reject) {
  try {
    window.postMessage("testmessage", "*");
  } catch(e) {
    console.log("EXCEPTION");
    console.log(e);
  }
});

The expected output in console is "testmessage".

Steps to reproduce:

  • Open Edge, navigate to an arbitrary web page, e.g. https://www.microsoft.com
  • Open F12 developer tools, switch to console
  • Execute the code above at least two times

The problem does not occur in Google Chrome or Mozilla Firefox.
The problem is distinctly reproducible. In some cases, the exception already occurs in the first execution.
The problem does not occur, when window.postMessage is executed outside the function of the Promise constructor.
So far I could not reproduce the problem when executed within a web page.

Failure output (Edge with German locale):

EXCEPTION
eval code (1) (11,5)
[object Error]: {description: "Vorgang abgebrochen ", message: "Vorgang abgebrochen ", number: -2147467260, stack: "Error: Vorgang abgebrochen at Anonymous function (eval code:9:5) at Promise (native code) at eval code (eval code:7:1)"}

UPDATED REPRO STEPS by MS Edge Team
This is the corrected code to execute in Console:

var listener = function(msg){ console.log(msg.data); window.removeEventListener("message", listener); }; listener = listener.bind(listener); window.addEventListener("message", listener); new Promise(function (resolve, reject) { try { window.postMessage("testmessage", “*”); } catch(e) { console.log(“EXCEPTION”); console.log(e); } });

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Steps to Reproduce

      Changed Assigned To to “edgedevtoolstri@microsoft.com”

      Changed Assigned To to “Venkat K.”

      Changed Assigned To from “Venkat K.” to “Steve B.”

      Changed Status to “Confirmed”

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

    Sign in