Skip to content

Cannot capture UpdateExpression like ++foo #32

Closed
@falsandtru

Description

@falsandtru
class C {
  count_ = {};
  count() {
    return this.count_;
  }
}
var counter = new C();
assert(++counter.count_ === counter.count());

expected:

          assert(++counter.count_ === counter.count())
                 | |       |      |   |       |
                 | |       |      |   |       Object{}
                 | |       |      |   C{count_:#Object#}
                 | |       |      false
                 | |       Object{}
                 | C{count_:#Object#}
                 NaN

actual:

          assert(++counter.count_ === counter.count())
                 |                |   |       |
                 |                |   |       NaN
                 |                |   C{count_:NaN}
                 NaN              false

other:

          assert(+counter.count_ === counter.count())
                 ||       |      |   |       |
                 ||       |      |   |       Object{}
                 ||       |      |   C{count_:#Object#}
                 ||       |      false
                 ||       Object{}
                 |C{count_:#Object#}
                 NaN

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions