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

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

Issue 1484263002: Use destructuring assignments for named parameters (#180) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Destructure function params directly (no more opts in most cases) Created 5 years 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", 2 "dart/_runtime",
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() {
11 this[_c] = 3; 11 this[_c] = 3;
12 } 12 }
13 x() { 13 x() {
14 return 42; 14 return 42;
15 } 15 }
16 y(a) { 16 y(a) {
17 return a; 17 return a;
18 } 18 }
19 z(b) { 19 z(b) {
20 if (b === void 0) 20 if (b === void 0)
21 b = null; 21 b = null;
22 return dart.asInt(b); 22 return dart.asInt(b);
23 } 23 }
24 zz(b) { 24 zz(b) {
25 if (b === void 0) 25 if (b === void 0)
26 b = 0; 26 b = 0;
27 return b; 27 return b;
28 } 28 }
29 w(a, opts) { 29 w(a, {b = null} = {}) {
30 let b = opts && 'b' in opts ? opts.b : null;
31 return dart.asInt(dart.notNull(a) + dart.notNull(b)); 30 return dart.asInt(dart.notNull(a) + dart.notNull(b));
32 } 31 }
33 ww(a, opts) { 32 ww(a, {b = 0} = {}) {
34 let b = opts && 'b' in opts ? opts.b : 0;
35 return dart.notNull(a) + dart.notNull(b); 33 return dart.notNull(a) + dart.notNull(b);
36 } 34 }
37 get a() { 35 get a() {
38 return this.x(); 36 return this.x();
39 } 37 }
40 set b(b) {} 38 set b(b) {}
41 get c() { 39 get c() {
42 return this[_c]; 40 return this[_c];
43 } 41 }
44 set c(c) { 42 set c(c) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 let c = dart.bind("", dartx.padLeft); 78 let c = dart.bind("", dartx.padLeft);
81 let r = dart.bind(3.0, dartx.floor); 79 let r = dart.bind(3.0, dartx.floor);
82 } 80 }
83 dart.fn(test); 81 dart.fn(test);
84 // Exports: 82 // Exports:
85 exports.A = A; 83 exports.A = A;
86 exports.Bar = Bar; 84 exports.Bar = Bar;
87 exports.Foo = Foo; 85 exports.Foo = Foo;
88 exports.test = test; 86 exports.test = test;
89 }); 87 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698