| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.resolution.members; | 5 library dart2js.resolution.members; |
| 6 | 6 |
| 7 import '../common/names.dart' show | 7 import '../common/names.dart' show |
| 8 Selectors; | 8 Selectors; |
| 9 import '../compiler.dart' show | 9 import '../compiler.dart' show |
| 10 Compiler; | 10 Compiler; |
| (...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 /// Handle qualified access of an inaccessible private static class member, | 1841 /// Handle qualified access of an inaccessible private static class member, |
| 1842 /// like `a._b` or `a._b()` where `a` is class, `_b` is static member of `a` | 1842 /// like `a._b` or `a._b()` where `a` is class, `_b` is static member of `a` |
| 1843 /// but `a` is not defined in the current library. | 1843 /// but `a` is not defined in the current library. |
| 1844 ResolutionResult handlePrivateStaticMemberAccess( | 1844 ResolutionResult handlePrivateStaticMemberAccess( |
| 1845 Send node, Name name, ClassElement receiverClass, Element member) { | 1845 Send node, Name name, ClassElement receiverClass, Element member) { |
| 1846 registry.registerThrowNoSuchMethod(); | 1846 registry.registerThrowNoSuchMethod(); |
| 1847 ErroneousElement error = reportAndCreateErroneousElement( | 1847 ErroneousElement error = reportAndCreateErroneousElement( |
| 1848 node, name.text, MessageKind.PRIVATE_ACCESS, | 1848 node, name.text, MessageKind.PRIVATE_ACCESS, |
| 1849 {'libraryName': member.library.getLibraryOrScriptName(), | 1849 {'libraryName': member.library.libraryOrScriptName, |
| 1850 'name': name}); | 1850 'name': name}); |
| 1851 // TODO(johnniwinther): Add an [AccessSemantics] for unresolved static | 1851 // TODO(johnniwinther): Add an [AccessSemantics] for unresolved static |
| 1852 // member access. | 1852 // member access. |
| 1853 return handleErroneousAccess( | 1853 return handleErroneousAccess( |
| 1854 node, name, new StaticAccess.unresolved(error)); | 1854 node, name, new StaticAccess.unresolved(error)); |
| 1855 } | 1855 } |
| 1856 | 1856 |
| 1857 /// Handle qualified update of an inaccessible private static class member, | 1857 /// Handle qualified update of an inaccessible private static class member, |
| 1858 /// like `a._b = c` or `a._b++` where `a` is class, `_b` is static member of | 1858 /// like `a._b = c` or `a._b++` where `a` is class, `_b` is static member of |
| 1859 /// `a` but `a` is not defined in the current library. | 1859 /// `a` but `a` is not defined in the current library. |
| 1860 ResolutionResult handlePrivateStaticMemberUpdate( | 1860 ResolutionResult handlePrivateStaticMemberUpdate( |
| 1861 SendSet node, Name name, ClassElement receiverClass, Element member) { | 1861 SendSet node, Name name, ClassElement receiverClass, Element member) { |
| 1862 registry.registerThrowNoSuchMethod(); | 1862 registry.registerThrowNoSuchMethod(); |
| 1863 ErroneousElement error = reportAndCreateErroneousElement( | 1863 ErroneousElement error = reportAndCreateErroneousElement( |
| 1864 node, name.text, MessageKind.PRIVATE_ACCESS, | 1864 node, name.text, MessageKind.PRIVATE_ACCESS, |
| 1865 {'libraryName': member.library.getLibraryOrScriptName(), | 1865 {'libraryName': member.library.libraryOrScriptName, |
| 1866 'name': name}); | 1866 'name': name}); |
| 1867 // TODO(johnniwinther): Add an [AccessSemantics] for unresolved static | 1867 // TODO(johnniwinther): Add an [AccessSemantics] for unresolved static |
| 1868 // member access. | 1868 // member access. |
| 1869 return handleUpdate(node, name, new StaticAccess.unresolved(error)); | 1869 return handleUpdate(node, name, new StaticAccess.unresolved(error)); |
| 1870 } | 1870 } |
| 1871 | 1871 |
| 1872 /// Handle qualified access to a static member, like `a.b` or `a.b()` where | 1872 /// Handle qualified access to a static member, like `a.b` or `a.b()` where |
| 1873 /// `a` is a class and `b` is a static member of `a`. | 1873 /// `a` is a class and `b` is a static member of `a`. |
| 1874 ResolutionResult handleStaticMemberAccess( | 1874 ResolutionResult handleStaticMemberAccess( |
| 1875 Send node, Name memberName, ClassElement receiverClass) { | 1875 Send node, Name memberName, ClassElement receiverClass) { |
| (...skipping 2773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4649 } | 4649 } |
| 4650 return const NoneResult(); | 4650 return const NoneResult(); |
| 4651 } | 4651 } |
| 4652 } | 4652 } |
| 4653 | 4653 |
| 4654 /// Looks up [name] in [scope] and unwraps the result. | 4654 /// Looks up [name] in [scope] and unwraps the result. |
| 4655 Element lookupInScope(Compiler compiler, Node node, | 4655 Element lookupInScope(Compiler compiler, Node node, |
| 4656 Scope scope, String name) { | 4656 Scope scope, String name) { |
| 4657 return Elements.unwrap(scope.lookup(name), compiler, node); | 4657 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4658 } | 4658 } |
| OLD | NEW |