Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Polymer template attribute definition with no corresponding class attributes causes confusing exception #270

Closed
DartBot opened this issue Jun 5, 2015 · 4 comments
Labels

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/343148?v=3" align="left" width="96" height="96"hspace="10"> Issue by terrasea
Originally opened as dart-lang/sdk#20544


What steps will reproduce the problem?

  1. Create a Polymer template definition with an attribute then create the backing class without a field to match the attribute.
    <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.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/8631949?v=3" align="left" width="48" height="48"hspace="10"> Comment by floitschG


Added Area-Pkg, Pkg-Polymer, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/984921?v=3" align="left" width="48" height="48"hspace="10"> Comment by jakemac53


Set owner to @jakemac53.
Added Started label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/984921?v=3" align="left" width="48" height="48"hspace="10"> Comment by jakemac53


Fixed in dart-lang/sdk@8d04c19

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/984921?v=3" align="left" width="48" height="48"hspace="10"> Comment by jakemac53


Added Fixed label.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants