-
Notifications
You must be signed in to change notification settings - Fork 408
Zone.js replaces MutationObserver with an unnamed constructor #197
Comments
Sorry, maybe I'm missing something. Why run zone.js inside Dartium? |
The context where this arose is having the Polymer DevTools extension running. That replaces MutationObserver with an anonymous constructor, so when Dartium sees a JS MutationObserver it no longer knows what to do with it. |
This behavior also breaks tinymce. MutationObserver.takeRecords() function calls will always throw, since the wrapper does not expose that function. |
I added this on mutation-observer.ts and the errors went away: global[className].prototype.takeRecords = function () {
if (!this[isActiveKey]) {
this[creationZoneKey].enqueueTask();
this[isActiveKey] = true;
}
return this[originalInstanceKey].takeRecords.apply(this[originalInstanceKey], arguments);
}; |
@ThiagoT1 I have faced the same problem with tinymce recently, but I was unable to test your solution and I had to fix it in a dirtier way (inside tinymce). If your solution did good, may I ask you to pass it as pull-request, so it could present in next releases? |
@TheDVolk007 It seems the major recent refactor on zone.js took care of that, as seen here: https://github.com/angular/zone.js/blob/master/lib/browser/utils.ts#L218 I couldn't test it, though. My project is based on angular and it seems angular still depends on the "old" 0.5.15 API. |
Close for now. |
This is a problem with Dart 1.13 Dartium, which is relying on the constructor name to find the corresponding Dart class. This shows up if you try to run Dartium with the Polymer DevTools extension.
@justinfagnani
The text was updated successfully, but these errors were encountered: