| 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 | 5 |
| 6 interface CallingContext { | 6 interface CallingContext { |
| 7 MemberSet findMembers(String name); | 7 MemberSet findMembers(String name); |
| 8 CounterLog get counters(); | 8 CounterLog get counters(); |
| 9 Library get library(); | 9 Library get library(); |
| 10 bool get isStatic(); | 10 bool get isStatic(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // TODO(jimhug): Can we remove span? | 37 // TODO(jimhug): Can we remove span? |
| 38 PureStaticValue(Type type, SourceSpan span, | 38 PureStaticValue(Type type, SourceSpan span, |
| 39 [this.isConst = false, this.isType = false]): | 39 [this.isConst = false, this.isType = false]): |
| 40 super(type, null, span); | 40 super(type, null, span); |
| 41 | 41 |
| 42 Member getMem(CallingContext context, String name, Node node) { | 42 Member getMem(CallingContext context, String name, Node node) { |
| 43 var member = type.getMember(name); | 43 var member = type.getMember(name); |
| 44 | 44 |
| 45 if (member == null) { | 45 if (member == null) { |
| 46 world.warning('can not find "$name" on "${type.name}"', node.span); | 46 world.warning('can not find "$name" on "${type.name}"', node.span); |
| 47 return null; |
| 47 } | 48 } |
| 48 | 49 |
| 49 if (isType && !member.isStatic) { | 50 if (isType && !member.isStatic) { |
| 50 world.error('can not refer to instance member as static', node.span); | 51 world.error('can not refer to instance member as static', node.span); |
| 51 } | 52 } |
| 52 | 53 |
| 53 return member; | 54 return member; |
| 54 } | 55 } |
| 55 | 56 |
| 56 Value get_(CallingContext context, String name, Node node) { | 57 Value get_(CallingContext context, String name, Node node) { |
| (...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1611 } | 1612 } |
| 1612 return super.unop(kind, context, node); | 1613 return super.unop(kind, context, node); |
| 1613 } | 1614 } |
| 1614 Value binop(int kind, var other, CallingContext context, var node) { | 1615 Value binop(int kind, var other, CallingContext context, var node) { |
| 1615 if (value != null) { | 1616 if (value != null) { |
| 1616 return replaceValue(value.binop(kind, _unwrap(other), context, node)); | 1617 return replaceValue(value.binop(kind, _unwrap(other), context, node)); |
| 1617 } | 1618 } |
| 1618 return super.binop(kind, other, context, node); | 1619 return super.binop(kind, other, context, node); |
| 1619 } | 1620 } |
| 1620 } | 1621 } |
| OLD | NEW |