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

Side by Side Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart

Issue 2832913003: fix #27971, implement generic function RTTI (Closed)
Patch Set: fix Created 3 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 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 $tag($f, sig); 284 $tag($f, sig);
285 return $f; 285 return $f;
286 })()'''); 286 })()''');
287 287
288 /// Instantiate a generic method. 288 /// Instantiate a generic method.
289 /// 289 ///
290 /// We need to apply the type arguments both to the function, as well as its 290 /// We need to apply the type arguments both to the function, as well as its
291 /// associated function type. 291 /// associated function type.
292 gbind(f, @rest typeArgs) { 292 gbind(f, @rest typeArgs) {
293 var result = JS('', '#.apply(null, #)', f, typeArgs); 293 var result = JS('', '#.apply(null, #)', f, typeArgs);
294 var sig = JS('', '#.apply(null, #)', _getRuntimeType(f), typeArgs); 294 var sig = JS('', '#.instantiate(#)', _getRuntimeType(f), typeArgs);
295 tag(result, sig); 295 tag(result, sig);
296 return result; 296 return result;
297 } 297 }
298 298
299 // Set up the method signature field on the constructor 299 // Set up the method signature field on the constructor
300 _setInstanceSignature(f, sigF, kind) => JS( 300 _setInstanceSignature(f, sigF, kind) => JS(
301 '', 301 '',
302 '''(() => { 302 '''(() => {
303 $defineMemoizedGetter($f, $kind, () => { 303 $defineMemoizedGetter($f, $kind, () => {
304 let sigObj = $sigF(); 304 let sigObj = $sigF();
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 '''(() => { 643 '''(() => {
644 let values = []; 644 let values = [];
645 for (var i = 0; i < $names.length; i++) { 645 for (var i = 0; i < $names.length; i++) {
646 let value = $const_(new $enumClass(i)); 646 let value = $const_(new $enumClass(i));
647 values.push(value); 647 values.push(value);
648 Object.defineProperty($enumClass, $names[i], 648 Object.defineProperty($enumClass, $names[i],
649 { value: value, configurable: true }); 649 { value: value, configurable: true });
650 } 650 }
651 $enumClass.values = $constList(values, $enumClass); 651 $enumClass.values = $constList(values, $enumClass);
652 })()'''); 652 })()''');
OLDNEW
« no previous file with comments | « pkg/dev_compiler/test/codegen_test.dart ('k') | pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698