Polymer template attribute definition with no corresponding class attributes causes confusing exception #20544
Labels
area-pkg
Used for miscellaneous pkg/ packages not associated with specific area- teams.
This issue was originally filed by @terrasea
What steps will reproduce the problem?
<polymer-element name="failing-element" attributes="nonexistent">
...
</polymer-element>
@CustomTag('failing-element')
class FailingElement extends PolymerElement {
//don't create a definition for nonexistent
...
}
2. Try and run this in Dart Editor
What is the expected output? What do you see instead?
I expect a warning that I have not created a field in the backing class for this element. What I get instead is
Breaking on exception: Unhandled exception:
Exception: Unhandled exception:
Illegal argument(s): List must contain only ints, Strings, and Symbols
0 PropertyPath.PropertyPath (package:observe/src/path_observer.dart:128:11)
1 PolymerDeclaration.publishAttributes (package:polymer/src/declaration.dart:222:24)
2 PolymerDeclaration.desugar (package:polymer/src/declaration.dart:107:22)
3 PolymerDeclaration.register (package:polymer/src/declaration.dart:89:12)
4 _hookJsPolymer.registerDart.<anonymous closure> (package:polymer/src/loader.dart:132:75)
5 _RootZone.run (dart:async/zone.dart:1077)
6 _hookJsPolymer.registerDart (package:polymer/src/loader.dart:131:22) (package:polymer/src/instance.dart:1
What version of the product are you using?
Dart Editor version 1.6.0.dev_08_00 (DEV)
Dart SDK version 1.6.0-dev.8.0
On what operating system?
Gentoo Linux
What browser (if applicable)?
Dartium
Please provide any additional information below.
I did a bit of tracking using, (horror), print statements. I found that it was going to packages/observe/src/path_observer.dart, which has been given a list of attributes, and on the failing list, the symbol checked was a null pointer. I guess it's something to do with the <polymer-element ...> attributes attribute. As when I removed that nonexistent attribute from the attributes attribute, my app started working again.
The text was updated successfully, but these errors were encountered: