| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'dart:mirrors'; | 6 import 'dart:mirrors'; |
| 7 | 7 |
| 8 // Test that noSuchMethod calls behave as expected for dynamic object invocation
s. | 8 // Test that noSuchMethod calls behave as expected for dynamic object invocation
s. |
| 9 class BaseClass { | 9 class BaseClass { |
| 10 final dynamic finalField = "final!"; | 10 final dynamic finalField = "final!"; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 Expect.throws(() => f.constructor(), (e) => e is NoSuchMethodError); | 68 Expect.throws(() => f.constructor(), (e) => e is NoSuchMethodError); |
| 69 Expect.throws(() => f.constructor = 42, (e) => e is NoSuchMethodError); | 69 Expect.throws(() => f.constructor = 42, (e) => e is NoSuchMethodError); |
| 70 | 70 |
| 71 Expect.throws(() => f.__proto__, (e) => e is NoSuchMethodError); | 71 Expect.throws(() => f.__proto__, (e) => e is NoSuchMethodError); |
| 72 | 72 |
| 73 // These are valid JS properties but not Dart methods. | 73 // These are valid JS properties but not Dart methods. |
| 74 Expect.throws(() => f.toLocaleString, (e) => e is NoSuchMethodError); | 74 Expect.throws(() => f.toLocaleString, (e) => e is NoSuchMethodError); |
| 75 | 75 |
| 76 Expect.throws(() => f.hasOwnProperty, (e) => e is NoSuchMethodError); | 76 Expect.throws(() => f.hasOwnProperty, (e) => e is NoSuchMethodError); |
| 77 } | 77 } |
| OLD | NEW |