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

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

Issue 1144303003: Use signature inheritance when method types are unchanged (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Remove empty signatures Created 5 years, 7 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/DeltaBlue.js » ('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 6
7 suite('generic', () => { 7 suite('generic', () => {
8 "use strict"; 8 "use strict";
9 9
10 let generic = dart.generic; 10 let generic = dart.generic;
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 }); 612 });
613 613
614 class O extends dart.mixin(Base, M1, M2) { 614 class O extends dart.mixin(Base, M1, M2) {
615 O() {}; 615 O() {};
616 }; 616 };
617 dart.setSignature(O, {}); 617 dart.setSignature(O, {});
618 var obj = new O(); 618 var obj = new O();
619 var m = dart.bind(obj, 'm'); 619 var m = dart.bind(obj, 'm');
620 checkType(m, dart.functionType(core.Object, [core.int])); 620 checkType(m, dart.functionType(core.Object, [core.int]));
621 checkType(m, dart.functionType(core.int, [core.int]), false); 621 checkType(m, dart.functionType(core.int, [core.int]), false);
622
623 // Test inherited signatures
624 class P extends O {
625 P() {};
626 m(x) {return x;};
627 };
628 dart.setSignature(P, {});
629 var obj = new P();
630 var m = dart.bind(obj, 'm');
631 checkType(m, dart.functionType(core.Object, [core.int]));
632 checkType(m, dart.functionType(core.int, [core.int]), false);
622 }); 633 });
623 634
624 test('Object members', () => { 635 test('Object members', () => {
625 let nullHash = dart.hashCode(null); 636 let nullHash = dart.hashCode(null);
626 assert.equal(nullHash, 0); 637 assert.equal(nullHash, 0);
627 let nullString = dart.toString(null); 638 let nullString = dart.toString(null);
628 assert.equal(nullString, 'null'); 639 assert.equal(nullString, 'null');
629 let nullType = dart.runtimeType(null); 640 let nullType = dart.runtimeType(null);
630 assert.equal(nullType, core.Null); 641 assert.equal(nullType, core.Null);
631 642
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 674
664 suite('primitives', function() { 675 suite('primitives', function() {
665 'use strict'; 676 'use strict';
666 677
667 test('fixed length list', () => { 678 test('fixed length list', () => {
668 let list = new core.List(10); 679 let list = new core.List(10);
669 list[0] = 42; 680 list[0] = 42;
670 assert.throws(() => list.add(42)); 681 assert.throws(() => list.add(42));
671 }); 682 });
672 }); 683 });
OLDNEW
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/DeltaBlue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698