| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 native; | 5 part of native; |
| 6 | 6 |
| 7 class SideEffectsVisitor extends js.BaseVisitor { | 7 class SideEffectsVisitor extends js.BaseVisitor { |
| 8 final SideEffects sideEffects; | 8 final SideEffects sideEffects; |
| 9 SideEffectsVisitor(this.sideEffects); | 9 SideEffectsVisitor(this.sideEffects); |
| 10 | 10 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 NativeThrowBehavior visitThrow(js.Throw node) { | 217 NativeThrowBehavior visitThrow(js.Throw node) { |
| 218 return NativeThrowBehavior.MUST; | 218 return NativeThrowBehavior.MUST; |
| 219 } | 219 } |
| 220 | 220 |
| 221 NativeThrowBehavior visitPrefix(js.Prefix node) { | 221 NativeThrowBehavior visitPrefix(js.Prefix node) { |
| 222 if (node.op == 'typeof' && node.argument is js.VariableUse) | 222 if (node.op == 'typeof' && node.argument is js.VariableUse) |
| 223 return NativeThrowBehavior.NEVER; | 223 return NativeThrowBehavior.NEVER; |
| 224 NativeThrowBehavior result = visit(node.argument); | 224 NativeThrowBehavior result = visit(node.argument); |
| 225 switch (node.op) { | 225 switch (node.op) { |
| 226 case '+': |
| 227 case '-': |
| 226 case '!': | 228 case '!': |
| 227 case '~': | 229 case '~': |
| 228 case 'void': | 230 case 'void': |
| 229 case 'typeof': | 231 case 'typeof': |
| 230 return result; | 232 return result; |
| 231 default: | 233 default: |
| 232 return NativeThrowBehavior.MAY; | 234 return NativeThrowBehavior.MAY; |
| 233 } | 235 } |
| 234 } | 236 } |
| 235 | 237 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 258 receiver.isPositional && | 260 receiver.isPositional && |
| 259 receiver.nameOrPosition == 0) { | 261 receiver.nameOrPosition == 0) { |
| 260 first = NativeThrowBehavior.MAY_THROW_ONLY_ON_FIRST_ARGUMENT_ACCESS; | 262 first = NativeThrowBehavior.MAY_THROW_ONLY_ON_FIRST_ARGUMENT_ACCESS; |
| 261 } else { | 263 } else { |
| 262 first = NativeThrowBehavior.MAY; | 264 first = NativeThrowBehavior.MAY; |
| 263 } | 265 } |
| 264 | 266 |
| 265 return sequence(first, second); | 267 return sequence(first, second); |
| 266 } | 268 } |
| 267 } | 269 } |
| OLD | NEW |