Skip to content

postMessage and other cross-frame operations are broken in dart2js #3175

@vsmenon

Description

@vsmenon

Posting a message to another frame breaks today in dart2js. The problem is here in the generated code:

Isolate.$defineClass("_DOMWindowCrossFrameImpl", "Object", ["dartObjectLocalStorage", "_lib_window?"], {
 postMessage$3: function(message, targetOrigin, messagePorts) {
  if ($.eqNullB(messagePorts)) {
    this._lib_window.postMessage$2(message, targetOrigin);
  } else {
    this._lib_window.postMessage$3(message, targetOrigin, messagePorts);
  }
 },

The object "this._lib_window" is a Window object in a different frame - which means it is not affected by any patching we need. In particularly, it has no "postMessage$2" object.

This happens to work in Frog since the frog optimizer replaces postMessage$2 with postMessage at compile time.

Marking high as this is coming up in Dromaeo benchmarks.

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresclosed-duplicateClosed in favor of an existing report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions