diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart index 8196d085728..2896c7aab31 100644 --- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart +++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart @@ -1530,7 +1530,7 @@ class CodeGenerator extends Object var fnBody = js.call('this.noSuchMethod(new #.InvocationImpl.new(#, #, #))', [ _runtimeModule, - _declareMemberName(method, useDisplayName: true), + _declareMemberName(method, useDisplayName: false), positionalArgs, new JS.ObjectInitializer(invocationProps) ]); diff --git a/tests/lib_strong/html/html_mock_test.dart b/tests/lib_strong/html/html_mock_test.dart index b470495181c..1d4aeb9e5e1 100644 --- a/tests/lib_strong/html/html_mock_test.dart +++ b/tests/lib_strong/html/html_mock_test.dart @@ -8,7 +8,11 @@ import 'dart:html'; import 'package:expect/minitest.dart'; class Mock { - noSuchMethod(Invocation i) => document; + noSuchMethod(Invocation i) { + if (this is Window) return document; + if (this is FileList) return new MockFile(); + return null; + } } @proxy @@ -39,6 +43,12 @@ class MockLocation extends Mock implements Location { String href = "MOCK_HREF"; } +@proxy +class MockFileList extends Mock implements FileList {} + +@proxy +class MockFile extends Mock implements File {} + main() { test('is', () { var win = new MockWindow(); @@ -78,4 +88,9 @@ main() { HtmlDocument doc = new MockHtmlDocument(); expect(doc.onBlur is Stream, isTrue, reason: 'onBlur should be a stream'); }); + + test('operator', () { + var fileList = new MockFileList(); + expect(fileList[1] is File, isTrue); + }); }