InvocationMirror.memberName adds an '=' at the end if the invocation is a setter. #8086
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-not-planned
Closed as we don't intend to take action on the reported issue
library-mirrors
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by Seth.Ill...@gmail.com
What steps will reproduce the problem?
What is the expected output? What do you see instead?
mirror.memberName should be the member name only. We have mirror.isSetter to check if its a setter or not.
What version of the product are you using? On what operating system?
Dart Editor version 0.3.1_r17463
Dart SDK version 0.3.1.2_r17463
Example code:
noSuchMethod(InvocationMirror mirror) {
if (mirror.isGetter) {
var property = mirror.memberName;
if (this.containsKey(property)) {
return this[property];
}
} else if (mirror.isSetter) {
// Remove a nasty '=' that is always added at the end for some reason.
var property = mirror.memberName.slice(0, -1);
this[property] = mirror.positionalArguments[0];
return this[property];
}
}
The text was updated successfully, but these errors were encountered: