Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Side by Side Diff: test/codegen/language/no_such_method_native_test.dart

Issue 2061373003: implement user-defined nSM, Object members on functions (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fix Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4 // Dart test program testing that NoSuchMethod is properly called.
5
6 import "package:expect/expect.dart";
7
8 Invocation invocation;
9
10 class C {
11 noSuchMethod(Invocation i) {
12 invocation = i;
13 return 42;
14 }
15 }
16
17 expectNSME(Object d) {
18 try {
19 d.noSuchMethod(invocation);
20 } on NoSuchMethodError catch (e) {
21 Expect.isTrue(e.toString().contains('foobar'));
22 }
23 }
24
25 main() {
26 dynamic c = new C();
27 Expect.equals(42, c.foobar(123));
28 Expect.equals(invocation.memberName, #foobar);
29 Expect.listEquals(invocation.positionalArguments, [123]);
30 expectNSME(null);
31 expectNSME(777);
32 expectNSME('hello');
33 // These fail because of https://github.com/dart-lang/dev_compiler/issues/592.
34 // expectNSME([]);
35 // expectNSME(['a', 'b', 'c']);
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698