Skip to content
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

InvocationMirror.memberName adds an '=' at the end if the invocation is a setter. #8086

Closed
DartBot opened this issue Jan 24, 2013 · 1 comment
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

Comments

@DartBot
Copy link

DartBot commented Jan 24, 2013

This issue was originally filed by Seth.Ill...@gmail.com


What steps will reproduce the problem?

  1. Implement noSuchMethod() on any class.
  2. Call a non-existing setter on an instance of that class.
  3. Observe that mirror.memberName has an extra '=' at the end.

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];
    }
  }

@lrhn
Copy link
Member

lrhn commented Jan 24, 2013

From the specification's perspective, the name of the member does contain the equals sign, and "foo=" is a different member than "foo".
However, that doesn't mean that it's actually user friendly.


Removed Type-Defect label.
Added Type-Enhancement, Area-Library, Triaged labels.

@DartBot DartBot added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Jan 24, 2013
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@a-siva a-siva added the closed-not-planned Closed as we don't intend to take action on the reported issue label Aug 5, 2022
@a-siva a-siva closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

4 participants