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

Side by Side Diff: test/browser/runtime_tests.js

Issue 1293293002: Attach type info to extension method and object method tear-offs (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 5 years, 4 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
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/js_test.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 var assert = chai.assert; 5 var assert = chai.assert;
6 var core = dart_library.import('dart/core'); 6 var core = dart_library.import('dart/core');
7 var collection = dart_library.import('dart/collection'); 7 var collection = dart_library.import('dart/collection');
8 var dart = dart_library.import('dart_runtime/dart'); 8 var dart = dart_library.import('dart_runtime/dart');
9 var dartx = dart.dartx; 9 var dartx = dart.dartx;
10 10
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 dart.functionType(dart.void, [core.int])); 668 dart.functionType(dart.void, [core.int]));
669 checkType(dart.bind(listB, dartx.add), 669 checkType(dart.bind(listB, dartx.add),
670 dart.functionType(dart.void, [core.String]), false, true); 670 dart.functionType(dart.void, [core.String]), false, true);
671 671
672 // Tear off of a static method 672 // Tear off of a static method
673 checkType(c.ListBase.listToString, 673 checkType(c.ListBase.listToString,
674 dart.functionType(core.String, [core.List])); 674 dart.functionType(core.String, [core.List]));
675 checkType(c.ListBase.listToString, 675 checkType(c.ListBase.listToString,
676 dart.functionType(core.String, [core.String]), false, true); 676 dart.functionType(core.String, [core.String]), false, true);
677 677
678 // Tear-off of extension methods on primitives
679 checkType(dart.bind(3.0, dartx.floor),
680 dart.functionType(core.int, []));
681 checkType(dart.bind(3.0, dartx.floor),
682 dart.functionType(core.String, []), false, true);
683 checkType(dart.bind("", dartx.endsWith),
684 dart.functionType(core.bool, [core.String]));
685 checkType(dart.bind("", dartx.endsWith),
686 dart.functionType(core.bool, [core.int]), false, true);
687
678 // Tear off a mixin method 688 // Tear off a mixin method
679 class Base { 689 class Base {
680 m(x) {return x;} 690 m(x) {return x;}
681 }; 691 };
682 dart.setSignature(Base, { 692 dart.setSignature(Base, {
683 methods: () => ({ 693 methods: () => ({
684 m: [core.int, [core.int]], 694 m: [core.int, [core.int]],
685 }) 695 })
686 }); 696 });
687 697
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 776
767 suite('primitives', function() { 777 suite('primitives', function() {
768 'use strict'; 778 'use strict';
769 779
770 test('fixed length list', () => { 780 test('fixed length list', () => {
771 let list = new core.List(10); 781 let list = new core.List(10);
772 list[0] = 42; 782 list[0] = 42;
773 assert.throws(() => list.add(42)); 783 assert.throws(() => list.add(42));
774 }); 784 });
775 }); 785 });
OLDNEW
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/js_test.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698