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

Side by Side Diff: tool/input_sdk/private/ddc_runtime/classes.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
« no previous file with comments | « tool/format.sh ('k') | tool/input_sdk/private/ddc_runtime/operations.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4
5 /// This library defines the operations that define and manipulate Dart 5 /// This library defines the operations that define and manipulate Dart
6 /// classes. Included in this are: 6 /// classes. Included in this are:
7 /// - Generics 7 /// - Generics
8 /// - Class metadata 8 /// - Class metadata
9 /// - Extension methods 9 /// - Extension methods
10 /// 10 ///
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 ctor.prototype = proto; 261 ctor.prototype = proto;
262 // Use defineProperty so we don't hit a property defined on Function, 262 // Use defineProperty so we don't hit a property defined on Function,
263 // like `caller` and `arguments`. 263 // like `caller` and `arguments`.
264 $defineProperty($clazz, $name, { value: ctor, configurable: true }); 264 $defineProperty($clazz, $name, { value: ctor, configurable: true });
265 })()'''); 265 })()''');
266 266
267 final _extensionType = JS('', 'Symbol("extensionType")'); 267 final _extensionType = JS('', 'Symbol("extensionType")');
268 268
269 getExtensionType(obj) => JS('', '$obj[$_extensionType]'); 269 getExtensionType(obj) => JS('', '$obj[$_extensionType]');
270 270
271 final dartx = JS('', '{}'); 271 final dartx = JS('', 'dartx');
272 272
273 getExtensionSymbol(name) => JS('', '''(() => { 273 getExtensionSymbol(name) => JS('', '''(() => {
274 let sym = $dartx[$name]; 274 let sym = $dartx[$name];
275 if (!sym) $dartx[$name] = sym = Symbol('dartx.' + $name.toString()); 275 if (!sym) $dartx[$name] = sym = Symbol('dartx.' + $name.toString());
276 return sym; 276 return sym;
277 })()'''); 277 })()''');
278 278
279 defineExtensionNames(names) => JS('', '$names.forEach($getExtensionSymbol)'); 279 defineExtensionNames(names) => JS('', '$names.forEach($getExtensionSymbol)');
280 280
281 // Install properties in prototype order. Properties / descriptors from 281 // Install properties in prototype order. Properties / descriptors from
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 })()'''); 372 })()''');
373 373
374 /// Sets the element type of a list literal. 374 /// Sets the element type of a list literal.
375 list(obj, elementType) => 375 list(obj, elementType) =>
376 JS('', '$setType($obj, ${getGenericClass(JSArray)}($elementType))'); 376 JS('', '$setType($obj, ${getGenericClass(JSArray)}($elementType))');
377 377
378 setBaseClass(derived, base) => JS('', '''(() => { 378 setBaseClass(derived, base) => JS('', '''(() => {
379 // Link the extension to the type it's extending as a base class. 379 // Link the extension to the type it's extending as a base class.
380 $derived.prototype.__proto__ = $base.prototype; 380 $derived.prototype.__proto__ = $base.prototype;
381 })()'''); 381 })()''');
OLDNEW
« no previous file with comments | « tool/format.sh ('k') | tool/input_sdk/private/ddc_runtime/operations.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698