dart-archive / polymer-dart

Polymer support for Dart
https://pub.dartlang.org/packages/polymer
BSD 3-Clause "New" or "Revised" License
180 stars 33 forks source link

Short property name clobbered #668

Closed rbishop-bah closed 8 years ago

rbishop-bah commented 8 years ago

I ran into a difficult to debug situation where everything worked fine in Dart/Dartium but I was getting errors running the compiled JavaScript version. The problem turned out to be that the JS transpiler had used the variable w for some bool variable in a custom element but I had declared the property w. I worked around the problem by lengthening the property name to avoid any collision. But as far as I'm aware there's no restriction on property name length so this seems like a serious bug.

I'm not going to be able to provide any more than the image. That a.w=!1 causes everything to blow up because I have a property w declared as an int.

image

jakemac53 commented 8 years ago

This seems like a dart2js bug, @sigmundch is this a known issue?

rbishop-bah commented 8 years ago

Here is how the property is currently declared (after being changed from w to wide.

image

sigmundch commented 8 years ago

Indeed it sounds like a possible dart2js bug - we'd need to narrow this down and see if we can reproduce it with plain custom elements and no use of polymer.

jakemac53 commented 8 years ago

@rbishop-bah is this still an issue? I tried recreating with a simple app and wasn't able to. If it is still an issue can you get a small repro and re-open this issue?

rbishop-bah commented 8 years ago

Well, like I said I worked around it by using longer property names. I haven't seen it pop up anywhere else, but then again I wouldn't have because I'm staying away from one and two letter property names now.

jakemac53 commented 8 years ago

Ok, given that we can't really take any action I am going to leave this closed for now then. If you are able to get something reproducible please let us know though.