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

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

Issue 2981673002: Register created closure class with the world. (Closed)
Patch Set: . Created 3 years, 5 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 '../elements/entities.dart'; 7 import '../elements/entities.dart';
8 import '../elements/names.dart'; 8 import '../elements/names.dart';
9 import '../elements/types.dart'; 9 import '../elements/types.dart';
10 import '../kernel/elements.dart'; 10 import '../kernel/elements.dart';
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 JClass(this.library, this.classIndex, this.name, {this.isAbstract}); 316 JClass(this.library, this.classIndex, this.name, {this.isAbstract});
317 317
318 @override 318 @override
319 bool get isClosure => false; 319 bool get isClosure => false;
320 320
321 String toString() => '${jsElementPrefix}class($name)'; 321 String toString() => '${jsElementPrefix}class($name)';
322 } 322 }
323 323
324 abstract class JMember implements MemberEntity, IndexedMember { 324 abstract class JMember implements MemberEntity, IndexedMember {
325 /// Member index used for fast lookup in [JsToFrontendMapImpl]. 325 /// Member index used for fast lookup in [JsToFrontendMapImpl].
326 final int memberIndex; 326 int _memberIndex;
327 final JLibrary library; 327 final JLibrary library;
328 final JClass enclosingClass; 328 final JClass enclosingClass;
329 final Name _name; 329 final Name _name;
330 final bool _isStatic; 330 final bool _isStatic;
331 331
332 JMember(this.memberIndex, this.library, this.enclosingClass, this._name, 332 JMember(this._memberIndex, this.library, this.enclosingClass, this._name,
333 {bool isStatic: false}) 333 {bool isStatic: false})
334 : _isStatic = isStatic; 334 : _isStatic = isStatic;
335 335
336 int get memberIndex => _memberIndex;
337
338 /// Should only be called by closure methods. All others should set
339 /// memberIndex at initialization time.
340 void set setClosureMemberIndex(int newIndex) {
341 _memberIndex = newIndex;
342 }
343
336 String get name => _name.text; 344 String get name => _name.text;
337 345
338 Name get memberName => _name; 346 Name get memberName => _name;
339 347
340 @override 348 @override
341 bool get isAssignable => false; 349 bool get isAssignable => false;
342 350
343 @override 351 @override
344 bool get isConst => false; 352 bool get isConst => false;
345 353
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 final MemberEntity memberContext; 553 final MemberEntity memberContext;
546 final Entity executableContext; 554 final Entity executableContext;
547 final FunctionType functionType; 555 final FunctionType functionType;
548 556
549 JLocalFunction( 557 JLocalFunction(
550 this.name, this.memberContext, this.executableContext, this.functionType); 558 this.name, this.memberContext, this.executableContext, this.functionType);
551 559
552 String toString() => '${jsElementPrefix}local_function' 560 String toString() => '${jsElementPrefix}local_function'
553 '(${memberContext.name}.${name ?? '<anonymous>'})'; 561 '(${memberContext.name}.${name ?? '<anonymous>'})';
554 } 562 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure_visitors.dart ('k') | pkg/compiler/lib/src/js_model/js_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698