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

Side by Side Diff: dart/tests/lib/mirrors/get_symbol_name_no_such_method_test.dart

Issue 16851002: Implement minified MirrorSystem.getName. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test Created 7 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 | Annotate | Revision Log
« no previous file with comments | « dart/sdk/lib/_internal/libraries.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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
5 /// Test that MirrorSystem.getName works correctly on symbols returned from
6 /// Invocation.memberName. This is especially relevant when minifying.
7
8 import 'dart:mirrors' show MirrorSystem;
9
10 class Foo {
11 String noSuchMethod(Invocation invocation) {
12 return MirrorSystem.getName(invocation.memberName);
13 }
14 }
15
16 expect(expected, actual) {
17 if (expected != actual) {
18 throw 'Expected: "$expected", but got "$actual"';
19 }
20 }
21
22 main() {
23 var foo = new Foo();
24 expect('foo', foo.foo);
25 expect('foo', foo.foo());
26 expect('foo', foo.foo(null));
27 // TODO(ahe): Why does the following not work in dart2js/minified.
28 // expect('foo', foo.foo(null, null));
29 expect('foo', foo.foo(a: null, b: null));
30
31 expect('baz', foo.baz);
32 expect('baz', foo.baz());
33 expect('baz', foo.baz(null));
34 // TODO(ahe): Why does the following not work in dart2js/minified.
35 // expect('baz', foo.baz(null, null));
36 expect('baz', foo.baz(a: null, b: null));
37 }
OLDNEW
« no previous file with comments | « dart/sdk/lib/_internal/libraries.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698