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

Side by Side Diff: test/codegen/expect/collection/src/canonicalized_map.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('collection/src/canonicalized_map', null, /* Imports */[ 1 dart_library.library('collection/src/canonicalized_map', null, /* Imports */[
2 "dart/_runtime", 2 "dart/_runtime",
3 'dart/core', 3 'dart/core',
4 'collection/src/utils', 4 'collection/src/utils',
5 'dart/collection' 5 'dart/collection'
6 ], /* Lazy imports */[ 6 ], /* Lazy imports */[
7 ], function(exports, dart, core, utils, collection) { 7 ], function(exports, dart, core, utils, collection) {
8 'use strict'; 8 'use strict';
9 let dartx = dart.dartx; 9 let dartx = dart.dartx;
10 let _base = Symbol('_base'); 10 let _base = Symbol('_base');
11 let _canonicalize = Symbol('_canonicalize'); 11 let _canonicalize = Symbol('_canonicalize');
12 let _isValidKeyFn = Symbol('_isValidKeyFn'); 12 let _isValidKeyFn = Symbol('_isValidKeyFn');
13 let _isValidKey = Symbol('_isValidKey'); 13 let _isValidKey = Symbol('_isValidKey');
14 let CanonicalizedMap$ = dart.generic(function(C, K, V) { 14 let CanonicalizedMap$ = dart.generic(function(C, K, V) {
15 class CanonicalizedMap extends core.Object { 15 class CanonicalizedMap extends core.Object {
16 CanonicalizedMap(canonicalize, opts) { 16 CanonicalizedMap(canonicalize, {isValidKey = null} = {}) {
17 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
18 this[_base] = core.Map$(C, utils.Pair$(K, V)).new(); 17 this[_base] = core.Map$(C, utils.Pair$(K, V)).new();
19 this[_canonicalize] = canonicalize; 18 this[_canonicalize] = canonicalize;
20 this[_isValidKeyFn] = isValidKey; 19 this[_isValidKeyFn] = isValidKey;
21 } 20 }
22 from(other, canonicalize, opts) { 21 from(other, canonicalize, {isValidKey = null} = {}) {
23 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
24 this[_base] = core.Map$(C, utils.Pair$(K, V)).new(); 22 this[_base] = core.Map$(C, utils.Pair$(K, V)).new();
25 this[_canonicalize] = canonicalize; 23 this[_canonicalize] = canonicalize;
26 this[_isValidKeyFn] = isValidKey; 24 this[_isValidKeyFn] = isValidKey;
27 this.addAll(other); 25 this.addAll(other);
28 } 26 }
29 get(key) { 27 get(key) {
30 if (!dart.notNull(this[_isValidKey](key))) 28 if (!dart.notNull(this[_isValidKey](key)))
31 return null; 29 return null;
32 let pair = this[_base].get(dart.dcall(this[_canonicalize], key)); 30 let pair = this[_base].get(dart.dcall(this[_canonicalize], key));
33 return pair == null ? null : pair.last; 31 return pair == null ? null : pair.last;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 [_isValidKey]: [core.bool, [core.Object]] 108 [_isValidKey]: [core.bool, [core.Object]]
111 }) 109 })
112 }); 110 });
113 return CanonicalizedMap; 111 return CanonicalizedMap;
114 }); 112 });
115 let CanonicalizedMap = CanonicalizedMap$(); 113 let CanonicalizedMap = CanonicalizedMap$();
116 // Exports: 114 // Exports:
117 exports.CanonicalizedMap$ = CanonicalizedMap$; 115 exports.CanonicalizedMap$ = CanonicalizedMap$;
118 exports.CanonicalizedMap = CanonicalizedMap; 116 exports.CanonicalizedMap = CanonicalizedMap;
119 }); 117 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698