PolymerLabs / polydev

Automatic web components profiling in chrome devtools
123 stars 10 forks source link

Polymer.dart Support #7

Closed felixc closed 7 years ago

felixc commented 9 years ago

It would be wonderful if the developer tools supported Polymer.dart as well as Polymer.js; either natively in Dartium, or, more likely, though dart2js compiled code in Chrome.

Currently when attempting to use the extension on a Polymer.dart (transpiled to JS) site, I get a stack trace in the Console, and the page fails to load at all:

Uncaught TypeError: Cannot assign to read only property 'createdCallback' of #<HTMLElement>
    document.registerElement @ VM793:2128
    registerElement @ interop_support.js:64
    dart._registerCustomElement @ html_dart2js.dart:40049
    dart.PolymerDeclaration.registerType$1 @ html_dart2js.dart:18101
    dart._hookJsPolymer_registerDart_closure.call$0 @ declaration.dart:128
    dart._RootZone.run$1 @ zone.dart:1161
    dart._hookJsPolymer_registerDart.call$3 @ loader.dart:86
    dart.Primitives_applyFunctionWithPositionalArguments @ js_helper.dart:1386
    dart._callDartFunction @ js_helper.dart:1347
    (anonymous function) @ js_dart2js.dart:103
    d._register @ polymer.min.js:14
    f.flush @ polymer.min.js:14
    f.ready @ polymer.min.js:14
    f.check @ polymer.min.js:14
    (anonymous function) @ polymer.min.js:14
    n @ webcomponents.min.js:14
    i @ webcomponents.min.js:14
    (anonymous function) @ webcomponents.min.js:14
    r @ webcomponents.min.js:14
    t @ webcomponents.min.js:14
    (anonymous function) @ polymer.min.js:14
    c @ polymer.min.js:13
    run @ VM793:118
    zoneBoundFn @ VM793:91
justinfagnani commented 9 years ago

I think this can be fixed by using Object.defineProperty to rewrite callbacks rather than property assignment.

rictic commented 7 years ago

As of v0.0.7 we support all web components code, not just Polymer (js). Please file a bug if this is still an issue.