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

Side by Side Diff: pkg/compiler/lib/src/serialization/modelz.dart

Issue 2124773002: Support enclosingClass on deserialized local elements (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Check local functions from implementation. Created 4 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/model_test_helper.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 /// Implementation of the element model used for deserialiation. 5 /// Implementation of the element model used for deserialiation.
6 /// 6 ///
7 /// These classes are created by [ElementDeserializer] triggered by the 7 /// These classes are created by [ElementDeserializer] triggered by the
8 /// [Deserializer]. 8 /// [Deserializer].
9 9
10 library dart2js.serialization.modelz; 10 library dart2js.serialization.modelz;
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 // variables correctly. 1493 // variables correctly.
1494 return definingConstructor.type; 1494 return definingConstructor.type;
1495 } 1495 }
1496 1496
1497 @override 1497 @override
1498 List<DartType> get typeVariables => _unsupported("typeVariables"); 1498 List<DartType> get typeVariables => _unsupported("typeVariables");
1499 } 1499 }
1500 1500
1501 abstract class MemberElementMixin 1501 abstract class MemberElementMixin
1502 implements DeserializedElementZ, MemberElement { 1502 implements DeserializedElementZ, MemberElement {
1503 final List<FunctionElement> nestedClosures = <FunctionElement>[];
1504
1503 @override 1505 @override
1504 MemberElement get memberContext => this; 1506 MemberElement get memberContext => this;
1505 1507
1506 @override 1508 @override
1507 Name get memberName => new Name(name, library); 1509 Name get memberName => new Name(name, library);
1508 1510
1509 @override 1511 @override
1510 List<FunctionElement> get nestedClosures => <FunctionElement>[]; 1512 bool get isInjected => _decoder.getBool(Key.IS_INJECTED);
1511 1513
1512 @override 1514 @override
1513 bool get isInjected => _decoder.getBool(Key.IS_INJECTED); 1515 void forgetElement() {
1516 nestedClosures.clear();
1517 }
1514 } 1518 }
1515 1519
1516 abstract class FieldElementZ extends DeserializedElementZ 1520 abstract class FieldElementZ extends DeserializedElementZ
1517 with 1521 with
1518 AnalyzableElementMixin, 1522 AnalyzableElementMixin,
1519 AstElementMixinZ, 1523 AstElementMixinZ,
1520 TypedElementMixin, 1524 TypedElementMixin,
1521 MemberElementMixin 1525 MemberElementMixin
1522 implements FieldElement { 1526 implements FieldElement {
1523 bool _isConst; 1527 bool _isConst;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 } 1634 }
1631 1635
1632 abstract class LocalExecutableMixin 1636 abstract class LocalExecutableMixin
1633 implements DeserializedElementZ, ExecutableElement, LocalElement { 1637 implements DeserializedElementZ, ExecutableElement, LocalElement {
1634 ExecutableElement _executableContext; 1638 ExecutableElement _executableContext;
1635 1639
1636 @override 1640 @override
1637 Element get enclosingElement => executableContext; 1641 Element get enclosingElement => executableContext;
1638 1642
1639 @override 1643 @override
1644 Element get enclosingClass => memberContext.enclosingClass;
1645
1646 @override
1640 ExecutableElement get executableContext { 1647 ExecutableElement get executableContext {
1641 if (_executableContext == null) { 1648 if (_executableContext == null) {
1642 _executableContext = _decoder.getElement(Key.EXECUTABLE_CONTEXT); 1649 _executableContext = _decoder.getElement(Key.EXECUTABLE_CONTEXT);
1643 } 1650 }
1644 return _executableContext; 1651 return _executableContext;
1645 } 1652 }
1646 1653
1647 @override 1654 @override
1648 MemberElement get memberContext => executableContext.memberContext; 1655 MemberElement get memberContext => executableContext.memberContext;
1649 1656
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
2320 } 2327 }
2321 2328
2322 @override 2329 @override
2323 Node get node => throw new UnsupportedError('${this}.node'); 2330 Node get node => throw new UnsupportedError('${this}.node');
2324 2331
2325 @override 2332 @override
2326 bool get hasNode => false; 2333 bool get hasNode => false;
2327 2334
2328 String toString() => 'MetadataAnnotationZ(${constant.toDartText()})'; 2335 String toString() => 'MetadataAnnotationZ(${constant.toDartText()})';
2329 } 2336 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/model_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698