| 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 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Core implementation of resolution. | 8 * Core implementation of resolution. |
| 9 * | 9 * |
| 10 * Do not subclass or instantiate this class outside this library | 10 * Do not subclass or instantiate this class outside this library |
| (...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 } | 1463 } |
| 1464 if (checkSuperAccess(node)) { | 1464 if (checkSuperAccess(node)) { |
| 1465 AccessSemantics semantics = computeSuperAccessSemanticsForSelector( | 1465 AccessSemantics semantics = computeSuperAccessSemanticsForSelector( |
| 1466 node, selector, alternateName: name.setter); | 1466 node, selector, alternateName: name.setter); |
| 1467 if (node.isCall) { | 1467 if (node.isCall) { |
| 1468 bool isIncompatibleInvoke = false; | 1468 bool isIncompatibleInvoke = false; |
| 1469 switch (semantics.kind) { | 1469 switch (semantics.kind) { |
| 1470 case AccessKind.SUPER_METHOD: | 1470 case AccessKind.SUPER_METHOD: |
| 1471 MethodElementX superMethod = semantics.element; | 1471 MethodElementX superMethod = semantics.element; |
| 1472 superMethod.computeSignature(compiler); | 1472 superMethod.computeSignature(compiler); |
| 1473 if (!callStructure.signatureApplies(superMethod)) { | 1473 if (!callStructure.signatureApplies( |
| 1474 superMethod.functionSignature)) { |
| 1474 registry.registerThrowNoSuchMethod(); | 1475 registry.registerThrowNoSuchMethod(); |
| 1475 registry.registerDynamicInvocation( | 1476 registry.registerDynamicInvocation( |
| 1476 new UniverseSelector(selector, null)); | 1477 new UniverseSelector(selector, null)); |
| 1477 registry.registerSuperNoSuchMethod(); | 1478 registry.registerSuperNoSuchMethod(); |
| 1478 isIncompatibleInvoke = true; | 1479 isIncompatibleInvoke = true; |
| 1479 } else { | 1480 } else { |
| 1480 registry.registerStaticInvocation(semantics.element); | 1481 registry.registerStaticInvocation(semantics.element); |
| 1481 } | 1482 } |
| 1482 break; | 1483 break; |
| 1483 case AccessKind.SUPER_FIELD: | 1484 case AccessKind.SUPER_FIELD: |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 selector = new Selector(SelectorKind.CALL, name, callStructure); | 1872 selector = new Selector(SelectorKind.CALL, name, callStructure); |
| 1872 } else { | 1873 } else { |
| 1873 selector = new Selector(SelectorKind.GETTER, name, callStructure); | 1874 selector = new Selector(SelectorKind.GETTER, name, callStructure); |
| 1874 } | 1875 } |
| 1875 if (node.isCall) { | 1876 if (node.isCall) { |
| 1876 bool isIncompatibleInvoke = false; | 1877 bool isIncompatibleInvoke = false; |
| 1877 switch (semantics.kind) { | 1878 switch (semantics.kind) { |
| 1878 case AccessKind.LOCAL_FUNCTION: | 1879 case AccessKind.LOCAL_FUNCTION: |
| 1879 LocalFunctionElementX function = semantics.element; | 1880 LocalFunctionElementX function = semantics.element; |
| 1880 function.computeSignature(compiler); | 1881 function.computeSignature(compiler); |
| 1881 if (!callStructure.signatureApplies(function)) { | 1882 if (!callStructure.signatureApplies(function.functionSignature)) { |
| 1882 registry.registerThrowNoSuchMethod(); | 1883 registry.registerThrowNoSuchMethod(); |
| 1883 registry.registerDynamicInvocation( | 1884 registry.registerDynamicInvocation( |
| 1884 new UniverseSelector(selector, null)); | 1885 new UniverseSelector(selector, null)); |
| 1885 isIncompatibleInvoke = true; | 1886 isIncompatibleInvoke = true; |
| 1886 } | 1887 } |
| 1887 break; | 1888 break; |
| 1888 case AccessKind.PARAMETER: | 1889 case AccessKind.PARAMETER: |
| 1889 case AccessKind.FINAL_PARAMETER: | 1890 case AccessKind.FINAL_PARAMETER: |
| 1890 case AccessKind.LOCAL_VARIABLE: | 1891 case AccessKind.LOCAL_VARIABLE: |
| 1891 case AccessKind.FINAL_LOCAL_VARIABLE: | 1892 case AccessKind.FINAL_LOCAL_VARIABLE: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1947 } | 1948 } |
| 1948 AccessSemantics semantics = | 1949 AccessSemantics semantics = |
| 1949 computeStaticOrTopLevelAccessSemantics(node, member); | 1950 computeStaticOrTopLevelAccessSemantics(node, member); |
| 1950 if (node.isCall) { | 1951 if (node.isCall) { |
| 1951 bool isIncompatibleInvoke = false; | 1952 bool isIncompatibleInvoke = false; |
| 1952 switch (semantics.kind) { | 1953 switch (semantics.kind) { |
| 1953 case AccessKind.STATIC_METHOD: | 1954 case AccessKind.STATIC_METHOD: |
| 1954 case AccessKind.TOPLEVEL_METHOD: | 1955 case AccessKind.TOPLEVEL_METHOD: |
| 1955 MethodElementX method = semantics.element; | 1956 MethodElementX method = semantics.element; |
| 1956 method.computeSignature(compiler); | 1957 method.computeSignature(compiler); |
| 1957 if (!callStructure.signatureApplies(method)) { | 1958 if (!callStructure.signatureApplies(method.functionSignature)) { |
| 1958 registry.registerThrowNoSuchMethod(); | 1959 registry.registerThrowNoSuchMethod(); |
| 1959 registry.registerDynamicInvocation( | 1960 registry.registerDynamicInvocation( |
| 1960 new UniverseSelector(selector, null)); | 1961 new UniverseSelector(selector, null)); |
| 1961 isIncompatibleInvoke = true; | 1962 isIncompatibleInvoke = true; |
| 1962 } else { | 1963 } else { |
| 1963 registry.registerStaticUse(semantics.element); | 1964 registry.registerStaticUse(semantics.element); |
| 1964 handleForeignCall(node, semantics.element, selector); | 1965 handleForeignCall(node, semantics.element, selector); |
| 1965 } | 1966 } |
| 1966 break; | 1967 break; |
| 1967 case AccessKind.STATIC_FIELD: | 1968 case AccessKind.STATIC_FIELD: |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3483 } | 3484 } |
| 3484 return const NoneResult(); | 3485 return const NoneResult(); |
| 3485 } | 3486 } |
| 3486 } | 3487 } |
| 3487 | 3488 |
| 3488 /// Looks up [name] in [scope] and unwraps the result. | 3489 /// Looks up [name] in [scope] and unwraps the result. |
| 3489 Element lookupInScope(Compiler compiler, Node node, | 3490 Element lookupInScope(Compiler compiler, Node node, |
| 3490 Scope scope, String name) { | 3491 Scope scope, String name) { |
| 3491 return Elements.unwrap(scope.lookup(name), compiler, node); | 3492 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 3492 } | 3493 } |
| OLD | NEW |