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

Side by Side Diff: tool/input_sdk/private/ddc_runtime/utils.dart

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 part of dart._runtime; 4 part of dart._runtime;
5 5
6 /// This library defines a set of general javascript utilities for us 6 /// This library defines a set of general javascript utilities for us
7 /// by the Dart runtime. 7 /// by the Dart runtime.
8 // TODO(ochafik): Rewrite some of these in Dart when possible. 8 // TODO(ochafik): Rewrite some of these in Dart when possible.
9 9
10 final defineProperty = JS('', 'Object.defineProperty'); 10 final defineProperty = JS('', 'Object.defineProperty');
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 } 94 }
95 return $to; 95 return $to;
96 })()'''); 96 })()''');
97 97
98 /// Copy properties from source to destination object. 98 /// Copy properties from source to destination object.
99 /// This operation is commonly called `mixin` in JS. 99 /// This operation is commonly called `mixin` in JS.
100 copyProperties(to, from) => JS('', '''(() => { 100 copyProperties(to, from) => JS('', '''(() => {
101 return $copyTheseProperties($to, $from, $getOwnNamesAndSymbols($from)); 101 return $copyTheseProperties($to, $from, $getOwnNamesAndSymbols($from));
102 })()'''); 102 })()''');
103
104 /// Exports from one Dart module to another.
105 @JSExportName('export')
106 export_(to, from, show, hide) => JS('', '''(() => {
107 if ($show == void 0 || $show.length == 0) {
108 $show = $getOwnNamesAndSymbols($from);
109 }
110 if ($hide != void 0) {
111 var hideMap = new Set($hide);
112 $show = $show.filter((k) => !hideMap.has(k));
113 }
114 return $copyTheseProperties($to, $from, $show);
115 })()''');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698