-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement user-defined nSM, Object members on functions
fix #591 and fix #59 R=vsm@google.com Review URL: https://codereview.chromium.org/2061373003 .
- Loading branch information
John Messerly
committed
Jun 23, 2016
1 parent
e8e19b4
commit d27eda4
Showing
10 changed files
with
1,070 additions
and
966 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
pkg/dev_compiler/test/codegen/language/no_such_method_native_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
// Dart test program testing that NoSuchMethod is properly called. | ||
|
||
import "package:expect/expect.dart"; | ||
|
||
Invocation invocation; | ||
|
||
class C { | ||
noSuchMethod(Invocation i) { | ||
invocation = i; | ||
return 42; | ||
} | ||
} | ||
|
||
expectNSME(Object d) { | ||
try { | ||
d.noSuchMethod(invocation); | ||
} on NoSuchMethodError catch (e) { | ||
Expect.isTrue(e.toString().contains('foobar')); | ||
} | ||
} | ||
|
||
main() { | ||
dynamic c = new C(); | ||
Expect.equals(42, c.foobar(123)); | ||
Expect.equals(invocation.memberName, #foobar); | ||
Expect.listEquals(invocation.positionalArguments, [123]); | ||
expectNSME(null); | ||
expectNSME(777); | ||
expectNSME('hello'); | ||
// These fail because of https://github.com/dart-lang/dev_compiler/issues/592. | ||
// expectNSME([]); | ||
// expectNSME(['a', 'b', 'c']); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.