Chromium Code Reviews| Index: lib/compiler/implementation/resolver.dart |
| diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart |
| index 3de67b305322f456a1d5ef3c13fef8c238b0f5ca..7b25c847eebadad0a4e6185b45499a8c073c916c 100644 |
| --- a/lib/compiler/implementation/resolver.dart |
| +++ b/lib/compiler/implementation/resolver.dart |
| @@ -1549,13 +1549,16 @@ class ResolverVisitor extends CommonResolverVisitor<Element> { |
| } |
| // Make sure we include the + and - operators if we are using |
| - // the ++ and -- ones. |
| + // the ++ and -- ones. Also, if op= form is used, include op itself. |
| void registerBinaryOperator(SourceString name) { |
| Selector binop = new Selector.binaryOperator(name); |
| world.registerDynamicInvocation(binop.name, binop); |
| } |
| if (source === '++') registerBinaryOperator(const SourceString('+')); |
| if (source === '--') registerBinaryOperator(const SourceString('-')); |
| + if (source.endsWith('=')) { |
| + registerBinaryOperator(new SourceString(source)); |
|
ahe
2012/09/24 09:19:31
This will register '+=' as a binary operator. But
Anton Muhin
2012/09/24 09:22:30
That's somewhat surprising, but it actually works
ahe
2012/09/24 11:14:55
I agree this is surprising, and I don't think this
Anton Muhin
2012/09/24 13:13:07
Peter, you should know this stuff better.
Anyway,
ahe
2012/09/24 13:22:24
dart2dart is not a short-term priority, so we can
Anton Muhin
2012/09/24 13:23:31
What would be your advice then
On 2012/09/24 13:2
ahe
2012/09/24 13:50:30
Create a method that maps a compound operator to i
ahe
2012/09/24 16:07:55
Or even better: take Elements.mapToUserOperator fr
Anton Muhin
2012/09/24 16:09:18
Thanks a lot, Peter, let me give it a try.
On 201
Anton Muhin
2012/09/25 10:05:51
Done, ptal
On 2012/09/24 16:09:18, Anton Muhin wr
|
| + } |
| } |
| registerSend(selector, setter); |