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

Side by Side Diff: test/codegen/expect/methods.js

Issue 1965213003: simplify constructors, fixes #564 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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 | « test/codegen/expect/js/js.js ('k') | test/codegen/expect/misc.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 dart_library.library('methods', null, /* Imports */[ 1 dart_library.library('methods', null, /* Imports */[
2 'dart_sdk' 2 'dart_sdk'
3 ], function(exports, dart_sdk) { 3 ], function(exports, dart_sdk) {
4 'use strict'; 4 'use strict';
5 const core = dart_sdk.core; 5 const core = dart_sdk.core;
6 const dart = dart_sdk.dart; 6 const dart = dart_sdk.dart;
7 const dartx = dart_sdk.dartx; 7 const dartx = dart_sdk.dartx;
8 const methods = Object.create(null); 8 const methods = Object.create(null);
9 const _c = Symbol('_c'); 9 const _c = Symbol('_c');
10 methods.A = class A extends core.Object { 10 methods.A = class A extends core.Object {
11 A() { 11 new() {
12 this[_c] = 3; 12 this[_c] = 3;
13 } 13 }
14 x() { 14 x() {
15 return 42; 15 return 42;
16 } 16 }
17 y(a) { 17 y(a) {
18 return a; 18 return a;
19 } 19 }
20 z(b) { 20 z(b) {
21 if (b === void 0) b = null; 21 if (b === void 0) b = null;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 }); 66 });
67 methods.Bar = class Bar extends core.Object { 67 methods.Bar = class Bar extends core.Object {
68 call(x) { 68 call(x) {
69 return core.print(`hello from ${x}`); 69 return core.print(`hello from ${x}`);
70 } 70 }
71 }; 71 };
72 dart.setSignature(methods.Bar, { 72 dart.setSignature(methods.Bar, {
73 methods: () => ({call: [dart.dynamic, [dart.dynamic]]}) 73 methods: () => ({call: [dart.dynamic, [dart.dynamic]]})
74 }); 74 });
75 methods.Foo = class Foo extends core.Object { 75 methods.Foo = class Foo extends core.Object {
76 Foo() { 76 new() {
77 this.bar = new methods.Bar(); 77 this.bar = new methods.Bar();
78 } 78 }
79 }; 79 };
80 methods.test = function() { 80 methods.test = function() {
81 let f = new methods.Foo(); 81 let f = new methods.Foo();
82 dart.dsend(f, 'bar', "Bar's call method!"); 82 dart.dsend(f, 'bar', "Bar's call method!");
83 let a = new methods.A(); 83 let a = new methods.A();
84 let g = dart.bind(a, 'x'); 84 let g = dart.bind(a, 'x');
85 let aa = new methods.A(); 85 let aa = new methods.A();
86 let h = dart.dload(aa, 'x'); 86 let h = dart.dload(aa, 'x');
87 let ts = dart.bind(a, 'toString'); 87 let ts = dart.bind(a, 'toString');
88 let nsm = dart.bind(a, 'noSuchMethod'); 88 let nsm = dart.bind(a, 'noSuchMethod');
89 let c = dart.bind("", dartx.padLeft); 89 let c = dart.bind("", dartx.padLeft);
90 let r = dart.bind(3.0, dartx.floor); 90 let r = dart.bind(3.0, dartx.floor);
91 }; 91 };
92 dart.fn(methods.test); 92 dart.fn(methods.test);
93 // Exports: 93 // Exports:
94 exports.methods = methods; 94 exports.methods = methods;
95 }); 95 });
OLDNEW
« no previous file with comments | « test/codegen/expect/js/js.js ('k') | test/codegen/expect/misc.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698