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

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

Issue 1484263002: Use destructuring assignments for named parameters (#180) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: 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
« no previous file with comments | « test/codegen/expect/methods.js ('k') | test/codegen/expect/unittest.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('temps', null, /* Imports */[ 1 dart_library.library('temps', 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 const _x = Symbol('_x'); 8 const _x = Symbol('_x');
9 const __x = Symbol('__x'); 9 const __x = Symbol('__x');
10 const _function = Symbol('_function'); 10 const _function = Symbol('_function');
11 class FormalCollision extends core.Object { 11 class FormalCollision extends core.Object {
12 FormalCollision(x, _x$, func) { 12 FormalCollision(x, _x$, func) {
13 this[_x] = x; 13 this[_x] = x;
14 this[__x] = _x$; 14 this[__x] = _x$;
15 this[_function] = func; 15 this[_function] = func;
16 } 16 }
17 } 17 }
18 dart.setSignature(FormalCollision, { 18 dart.setSignature(FormalCollision, {
19 constructors: () => ({FormalCollision: [FormalCollision, [core.int, core.int , core.Function]]}) 19 constructors: () => ({FormalCollision: [FormalCollision, [core.int, core.int , core.Function]]})
20 }); 20 });
21 const _opt = Symbol('_opt'); 21 const _opt = Symbol('_opt');
22 class OptionalArg extends core.Object { 22 class OptionalArg extends core.Object {
23 OptionalArg(opt) { 23 OptionalArg(opt) {
24 if (opt === void 0) 24 if (opt === void 0)
25 opt = 123; 25 opt = 123;
26 this[_opt] = opt; 26 this[_opt] = opt;
27 this.opt = null; 27 this.opt = null;
28 } 28 }
29 named(opts) { 29 named({opt = 456} = {}) {
30 let opt = opts && 'opt' in opts ? opts.opt : 456;
31 this.opt = opt; 30 this.opt = opt;
32 this[_opt] = null; 31 this[_opt] = null;
33 } 32 }
34 } 33 }
35 dart.defineNamedConstructor(OptionalArg, 'named'); 34 dart.defineNamedConstructor(OptionalArg, 'named');
36 dart.setSignature(OptionalArg, { 35 dart.setSignature(OptionalArg, {
37 constructors: () => ({ 36 constructors: () => ({
38 OptionalArg: [OptionalArg, [], [core.int]], 37 OptionalArg: [OptionalArg, [], [core.int]],
39 named: [OptionalArg, [], {opt: core.int}] 38 named: [OptionalArg, [], {opt: core.int}]
40 }) 39 })
41 }); 40 });
42 function main() { 41 function main() {
43 core.print(new FormalCollision(1, 2, dart.fn(x => x))); 42 core.print(new FormalCollision(1, 2, dart.fn(x => x)));
44 core.print(new OptionalArg()[_opt]); 43 core.print(new OptionalArg()[_opt]);
45 core.print(new OptionalArg.named()[_opt]); 44 core.print(new OptionalArg.named()[_opt]);
46 } 45 }
47 dart.fn(main); 46 dart.fn(main);
48 // Exports: 47 // Exports:
49 exports.FormalCollision = FormalCollision; 48 exports.FormalCollision = FormalCollision;
50 exports.OptionalArg = OptionalArg; 49 exports.OptionalArg = OptionalArg;
51 exports.main = main; 50 exports.main = main;
52 }); 51 });
OLDNEW
« no previous file with comments | « test/codegen/expect/methods.js ('k') | test/codegen/expect/unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698