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

Side by Side Diff: pkg/compiler/lib/src/js_model/elements.dart

Issue 2991903002: Add Closure call method to created closure class (Closed)
Patch Set: . Created 3 years, 4 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 library dart2js.js_model.elements; 5 library dart2js.js_model.elements;
6 6
7 import '../common/names.dart' show Identifiers;
7 import '../elements/entities.dart'; 8 import '../elements/entities.dart';
8 import '../elements/names.dart'; 9 import '../elements/names.dart';
9 import '../elements/types.dart'; 10 import '../elements/types.dart';
10 import '../kernel/elements.dart'; 11 import '../kernel/elements.dart';
11 import '../kernel/element_map_impl.dart'; 12 import '../kernel/element_map_impl.dart';
13 import 'closure.dart' show KernelClosureClass;
12 14
13 /// Map from 'frontend' to 'backend' elements. 15 /// Map from 'frontend' to 'backend' elements.
14 /// 16 ///
15 /// Frontend elements are what we read in, these typically represents concepts 17 /// Frontend elements are what we read in, these typically represents concepts
16 /// in Dart. Backend elements are what we generate, these may include elements 18 /// in Dart. Backend elements are what we generate, these may include elements
17 /// that do not correspond to a Dart concept, such as closure classes. 19 /// that do not correspond to a Dart concept, such as closure classes.
18 /// 20 ///
19 /// Querying for the frontend element for a backend-only element throws an 21 /// Querying for the frontend element for a backend-only element throws an
20 /// exception. 22 /// exception.
21 class JsToFrontendMap { 23 class JsToFrontendMap {
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 JField(int memberIndex, JLibrary library, JClass enclosingClass, Name name, 513 JField(int memberIndex, JLibrary library, JClass enclosingClass, Name name,
512 {bool isStatic, this.isAssignable, this.isConst}) 514 {bool isStatic, this.isAssignable, this.isConst})
513 : super(memberIndex, library, enclosingClass, name, isStatic: isStatic); 515 : super(memberIndex, library, enclosingClass, name, isStatic: isStatic);
514 516
515 @override 517 @override
516 bool get isField => true; 518 bool get isField => true;
517 519
518 String get _kind => 'field'; 520 String get _kind => 'field';
519 } 521 }
520 522
523 class ClosureCall extends JFunction {
sra1 2017/07/28 22:09:40 I think 'JClosureCallMethod' or 'JClosureFunction'
Emily Fortuna 2017/07/28 23:17:08 fixed.
524 ClosureCall(int memberIndex, KernelClosureClass containingClass,
525 JFunction origClosureCall)
526 : super(
527 memberIndex,
528 containingClass.library,
529 containingClass,
530 new Name(Identifiers.call, containingClass.library),
531 origClosureCall.parameterStructure,
532 origClosureCall.asyncMarker);
533
534 String get _kind => 'closure_call';
535 }
536
521 class JTypeVariable implements TypeVariableEntity, IndexedTypeVariable { 537 class JTypeVariable implements TypeVariableEntity, IndexedTypeVariable {
522 final int typeVariableIndex; 538 final int typeVariableIndex;
523 final Entity typeDeclaration; 539 final Entity typeDeclaration;
524 final String name; 540 final String name;
525 final int index; 541 final int index;
526 542
527 JTypeVariable( 543 JTypeVariable(
528 this.typeVariableIndex, this.typeDeclaration, this.name, this.index); 544 this.typeVariableIndex, this.typeDeclaration, this.name, this.index);
529 545
530 String toString() => 546 String toString() =>
531 '${jsElementPrefix}type_variable(${typeDeclaration.name}.$name)'; 547 '${jsElementPrefix}type_variable(${typeDeclaration.name}.$name)';
532 } 548 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698