blob: f03726c5968f9547b6c1627567f67e584f6931be [file] [log] [blame]
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Testing InvocationMirror.invokeOn method; test of issue 7227.
var reachedSetX = 0;
var reachedGetX = 0;
var reachedM = 0;
class A {
set x(val) {
reachedSetX = val;
}
get x {
reachedGetX = 1;
}
m() { reachedM = 1; }
}
class B {
final a = new A();
noSuchMethod(mirror) => mirror.invokeOn(a);
}
main () {
var b = new B();
b.x = 10;
Expect.equals(10, reachedSetX);
b.x;
Expect.equals(1, reachedGetX);
b.m();
Expect.equals(1, reachedM);
}