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

Side by Side Diff: tests/corelib_2/dynamic_nosuchmethod_test.dart

Issue 2987793002: Migrate test block 7 to Dart 2.0. (Closed)
Patch Set: Test modifications Created 3 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
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698