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

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

Issue 392983006: Specifiy MethodMirror.isStatic is terms of whether 'this' is permitted. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | « tests/lib/lib.status ('k') | tests/lib/mirrors/method_mirror_properties_test.dart » ('j') | 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) 2014, 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 library test.local_function_is_static;
6
7 import 'dart:mirrors';
8 import 'package:expect/expect.dart';
9
10 topLevel() => 1;
11 topLevelLocal() => () => 2;
12 class C {
13 static klass() => 3;
14 static klassLocal() => () => 4;
15 instance() => 5;
16 instanceLocal() => () => 6;
17 }
18
19 main() {
20 var f = topLevel;
21 Expect.equals(1, f());
22 Expect.isTrue((reflect(f) as ClosureMirror).function.isStatic);
23
24 f = topLevelLocal();
25 Expect.equals(2, f());
26 Expect.isTrue((reflect(f) as ClosureMirror).function.isStatic);
27
28 f = C.klass;
29 Expect.equals(3, f());
30 Expect.isTrue((reflect(f) as ClosureMirror).function.isStatic);
31
32 f = C.klassLocal();
33 Expect.equals(4, f());
34 Expect.isTrue((reflect(f) as ClosureMirror).function.isStatic);
35
36 f = new C().instance;
37 Expect.equals(5, f());
38 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic);
39
40 f = new C().instanceLocal();
41 Expect.equals(6, f());
42 Expect.isFalse((reflect(f) as ClosureMirror).function.isStatic);
43 }
OLDNEW
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/mirrors/method_mirror_properties_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698