-
Notifications
You must be signed in to change notification settings - Fork 1.7k
InvocationMirror.invokeOn does not work for getters and setters on dart2js. #6907
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
Comments
Added Triaged label. |
Hi Johnni, could you investigate this? Set owner to @johnniwinther. |
This comment was originally written by @aam Quick observation: invokeOn() in js_helper.dart:404 uses internalName to find methods. For regular methods internalName(second argument to createInvocationMirror below) matches function name "test$0": For getter/setters it doesn't: This mismatch leads to the following error as object[this._internalName] returns undefined: |
https://chromiumcodereview.appspot.com/11447008/ Added Started label. |
Fixed by https://codereview.chromium.org/11447008/ Added Fixed label. |
It works fine with normal methods but not with getters and setters:
class A {
set x(val) {
print("A.x <- $val");
}
get x {
print("<- A.x");
}
}
class B {
final a = new A();
noSuchMethod(mirror) => mirror.invokeOn(a);
}
main () {
var b = new B();
print('before set x');
b.x = 10;
print('before get x');
b.x;
}
explodes.
The text was updated successfully, but these errors were encountered: