Skip to content

private event handlers, change watchers, databinding doesn't work #13881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kevmoo opened this issue Oct 7, 2013 · 18 comments
Closed

private event handlers, change watchers, databinding doesn't work #13881

kevmoo opened this issue Oct 7, 2013 · 18 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-duplicate Closed in favor of an existing report
Milestone

Comments

@kevmoo
Copy link
Member

kevmoo commented Oct 7, 2013

Uncaught Illegal argument(s): "_something" is a private identifier

It seems like a name is inferred from private members ending with 'Changed'

This is a regression since 0.7.6

@kevmoo
Copy link
Member Author

kevmoo commented Oct 7, 2013

Here's a commit demonstrating my work-around.

googlearchive/notational_velocity.dart@8312bdc

Renaming the private methods to end in 'Mutated' instead of 'Changed' eliminates the runtime error

@jmesserly
Copy link

Right, "Changed" is a Polymer feature for setting up an observer.
http://www.polymer-project.org/polymer.html#change-watchers

... we can't do the right thing here until Dart2js supports private symbols :(. Observable has same issue.


Added Library-Polymer, Triaged labels.
Marked this as being blocked by #13355.

@sigmundch
Copy link
Member

Added this to the M8 milestone.

@kevmoo
Copy link
Member Author

kevmoo commented Oct 8, 2013

It feels very weird that the names of private methods in my classes would cause runtime errors.

Is there a check somewhere looking for methods that end in 'Changed'? Could this check add the condition that the method not start with "_" -- and is therefor private?

@sigmundch
Copy link
Member

Removed this from the M8 milestone.
Added this to the Later milestone.
Removed Priority-Unassigned label.
Added Priority-Medium label.

@jmesserly
Copy link

Issue #14191 has been merged into this issue.

@jmesserly
Copy link

Issue #13559 has been merged into this issue.

@jmesserly
Copy link

would be nice to fix in M8 but blocked on dart2js not-implemented-feature.


Marked this as being blocked by #14231.
Changed the title to: "private event handlers, change watchers, databinding don't work".

@ussuri
Copy link

ussuri commented Oct 18, 2013

Re merging Issue #14191 into this.

14191 indeed seems to have the same root cause (lack of support for private members), but the practical consequences are different: this one at least produces a runtime error, allowing the user to track it down, while with 14191 the unsupported usage is silently ignored. So while this can wait for the root cause to be fixed, it would be very desirable to at least add some diagnostic to the 14191 use case in the meantime.

Also, 14191 is not about dart2js at all: it doesn't work in Dartium either.

@ussuri
Copy link

ussuri commented Oct 18, 2013

Ok, with the changed title this looks better :)

@jmesserly
Copy link

Also, 14191 is not about dart2js at all: it doesn't work in Dartium either.

Right, it doesn't work on either impl because we're waiting on a new API MirrorSystem.getSymbol. They just implemented it in Dart VM but not in dart2js yet. I can't use the new API until it works in both places. Hope that clarifies.

@kevmoo
Copy link
Member Author

kevmoo commented Oct 18, 2013

Changed the title to: "private event handlers, change watchers, databinding doesn't work".

@sigmundch
Copy link
Member

Removed this from the Later milestone.
Added this to the M9 milestone.

@clayberg
Copy link

Removed this from the M9 milestone.
Added this to the 1.1 milestone.

@sigmundch
Copy link
Member

Removed this from the 1.1 milestone.
Added this to the 1.2 milestone.

@jmesserly
Copy link

Siggi, I wonder if we could fix this in Smoke? (or it's already fixed?)


Removed Area-Polymer, Library-Polymer labels.
Added Area-Pkg, Pkg-Smoke labels.

@sigmundch
Copy link
Member

it's possible, but not trivial because it requires changing how we generate code into the original source files (the way we generate getters today assumes that everything is visible from outside the library).

I happen to have a bug tracking this enhancement though. Marking as duplicate.


Added Duplicate label.
Marked as being merged into #18490.

@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/smoke#11.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

6 participants