mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
fix error message for dcalls on null
Change-Id: I0f3ab303ce8844c9b147a21f3233ef04ec0acb66 Reviewed-on: https://dart-review.googlesource.com/45920 Commit-Queue: Jenny Messerly <jmesserly@google.com> Reviewed-by: Vijay Menon <vsm@google.com>
This commit is contained in:
parent
af22f6a591
commit
d46dd1bd68
|
@ -323,10 +323,10 @@ _checkAndCall(f, ftype, obj, typeArgs, args, name) => JS('', '''(() => {
|
|||
})()''');
|
||||
|
||||
dcall(f, @rest args) =>
|
||||
_checkAndCall(f, _getRuntimeType(f), JS('', 'void 0'), null, args, 'call');
|
||||
_checkAndCall(f, null, JS('', 'void 0'), null, args, 'call');
|
||||
|
||||
dgcall(f, typeArgs, @rest args) => _checkAndCall(
|
||||
f, _getRuntimeType(f), JS('', 'void 0'), typeArgs, args, 'call');
|
||||
dgcall(f, typeArgs, @rest args) =>
|
||||
_checkAndCall(f, null, JS('', 'void 0'), typeArgs, args, 'call');
|
||||
|
||||
/// Helper for REPL dynamic invocation variants that make a best effort to
|
||||
/// enable accessing private members across library boundaries.
|
||||
|
|
|
@ -40,4 +40,10 @@ void main() {
|
|||
Expect.equals('Foo42', baz(42));
|
||||
Expect.equals('Foo42', foo(42));
|
||||
Expect.equals('Foo42', dyn(42));
|
||||
|
||||
var s = (FooType).toString();
|
||||
var minified = s != 'FooType'; // dart2js --minify has minified names.
|
||||
dynamic d = null;
|
||||
Expect.throws(() => d(),
|
||||
(e) => e is NoSuchMethodError && (minified || '$e'.contains('call')));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue