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

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

Issue 1355893003: Rewire DDC to use the analyzer task model (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Fix for identifiers Created 5 years, 3 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
OLDNEW
1 dart_library.library('methods', null, /* Imports */[ 1 dart_library.library('methods', null, /* Imports */[
2 "dart_runtime/dart", 2 "dart_runtime/dart",
3 'dart/core' 3 'dart/core'
4 ], /* Lazy imports */[ 4 ], /* Lazy imports */[
5 ], function(exports, dart, core) { 5 ], function(exports, dart, core) {
6 'use strict'; 6 'use strict';
7 let dartx = dart.dartx; 7 let dartx = dart.dartx;
8 let _c = Symbol('_c'); 8 let _c = Symbol('_c');
9 class A extends core.Object { 9 class A extends core.Object {
10 A() { 10 A() {
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 w(a, opts) { 29 w(a, opts) {
30 let b = opts && 'b' in opts ? opts.b : null; 30 let b = opts && 'b' in opts ? opts.b : null;
31 return dart.notNull(a) + dart.notNull(b); 31 return dart.notNull(a) + dart.notNull(b);
32 } 32 }
33 ww(a, opts) { 33 ww(a, opts) {
34 let b = opts && 'b' in opts ? opts.b : 0; 34 let b = opts && 'b' in opts ? opts.b : 0;
35 return dart.notNull(a) + dart.notNull(b); 35 return dart.notNull(a) + dart.notNull(b);
36 } 36 }
37 get a() { 37 get a() {
38 return this.x(); 38 return dart.dcall(this.x);
39 } 39 }
40 set b(b) {} 40 set b(b) {}
41 get c() { 41 get c() {
42 return this[_c]; 42 return this[_c];
43 } 43 }
44 set c(c) { 44 set c(c) {
45 this[_c] = c; 45 this[_c] = c;
46 } 46 }
47 } 47 }
48 dart.setSignature(A, { 48 dart.setSignature(A, {
49 methods: () => ({ 49 methods: () => ({
50 x: [core.int, []], 50 x: [core.int, []],
51 y: [core.int, [core.int]], 51 y: [core.int, [core.int]],
52 z: [core.int, [], [core.num]], 52 z: [core.int, [], [core.num]],
53 zz: [core.int, [], [core.int]], 53 zz: [core.int, [], [core.int]],
54 w: [core.int, [core.int], {b: core.num}], 54 w: [core.int, [core.int], {b: core.num}],
55 ww: [core.int, [core.int], {b: core.int}] 55 ww: [core.int, [core.int], {b: core.int}]
56 }) 56 })
57 }); 57 });
58 class Bar extends core.Object { 58 class Bar extends core.Object {
59 call(x) { 59 call(x) {
60 return core.print(`hello from ${x}`); 60 return dart.dcall(core.print, `hello from ${x}`);
61 } 61 }
62 } 62 }
63 dart.setSignature(Bar, { 63 dart.setSignature(Bar, {
64 methods: () => ({call: [dart.dynamic, [dart.dynamic]]}) 64 methods: () => ({call: [dart.dynamic, [dart.dynamic]]})
65 }); 65 });
66 class Foo extends core.Object { 66 class Foo extends core.Object {
67 Foo() { 67 Foo() {
68 this.bar = new Bar(); 68 this.bar = new Bar();
69 } 69 }
70 } 70 }
71 function test() { 71 function test() {
72 let f = new Foo(); 72 let f = new Foo();
73 dart.dcall(f.bar, "Bar's call method!"); 73 dart.dcall(f.bar, "Bar's call method!");
74 let a = new A(); 74 let a = new A();
75 let g = dart.bind(a, 'x'); 75 let g = dart.bind(a, 'x');
76 let aa = new A(); 76 let aa = new A();
77 let h = dart.dload(aa, 'x'); 77 let h = dart.dload(aa, 'x');
78 let ts = dart.fn(dart.toString.bind(a), core.String, []); 78 let ts = dart.fn(dart.toString.bind(a), core.String, []);
79 let nsm = dart.fn(dart.noSuchMethod.bind(a), dart.dynamic, [core.Invocation] ); 79 let nsm = dart.fn(dart.noSuchMethod.bind(a), dart.dynamic, [core.Invocation] );
80 let c = dart.bind("", dartx.padLeft); 80 let c = dart.bind("", dartx.padLeft);
81 let r = dart.bind(3.0, dartx.floor); 81 let r = dart.bind(3.0, dartx.floor);
82 } 82 }
83 dart.fn(test); 83 dart.fn(test);
84 // Exports: 84 // Exports:
85 exports.A = A; 85 exports.A = A;
86 exports.Bar = Bar; 86 exports.Bar = Bar;
87 exports.Foo = Foo; 87 exports.Foo = Foo;
88 exports.test = test; 88 exports.test = test;
89 }); 89 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698