| 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 js_backend.backend; | 5 library js_backend.backend; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/backend_api.dart' | 8 import '../common/backend_api.dart' |
| 9 show ForeignResolver, NativeRegistry, ImpactTransformer; | 9 show ForeignResolver, NativeRegistry, ImpactTransformer; |
| 10 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem; | 10 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem; |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 /// supported by the backend. | 1278 /// supported by the backend. |
| 1279 bool enableCodegenWithErrorsIfSupported(Spannable node) => true; | 1279 bool enableCodegenWithErrorsIfSupported(Spannable node) => true; |
| 1280 | 1280 |
| 1281 jsAst.Expression rewriteAsync( | 1281 jsAst.Expression rewriteAsync( |
| 1282 FunctionElement element, jsAst.Expression code) { | 1282 FunctionElement element, jsAst.Expression code) { |
| 1283 AsyncRewriterBase rewriter = null; | 1283 AsyncRewriterBase rewriter = null; |
| 1284 jsAst.Name name = namer.methodPropertyName(element); | 1284 jsAst.Name name = namer.methodPropertyName(element); |
| 1285 switch (element.asyncMarker) { | 1285 switch (element.asyncMarker) { |
| 1286 case AsyncMarker.ASYNC: | 1286 case AsyncMarker.ASYNC: |
| 1287 rewriter = new AsyncRewriter(reporter, element, | 1287 rewriter = new AsyncRewriter(reporter, element, |
| 1288 asyncHelper: | 1288 asyncStart: |
| 1289 emitter.staticFunctionAccess(commonElements.asyncHelper), | 1289 emitter.staticFunctionAccess(commonElements.asyncHelperStart), |
| 1290 asyncAwait: |
| 1291 emitter.staticFunctionAccess(commonElements.asyncHelperAwait), |
| 1292 asyncReturn: |
| 1293 emitter.staticFunctionAccess(commonElements.asyncHelperReturn), |
| 1294 asyncRethrow: |
| 1295 emitter.staticFunctionAccess(commonElements.asyncHelperRethrow), |
| 1290 wrapBody: emitter.staticFunctionAccess(commonElements.wrapBody), | 1296 wrapBody: emitter.staticFunctionAccess(commonElements.wrapBody), |
| 1291 completerFactory: emitter | 1297 completerFactory: emitter |
| 1292 .staticFunctionAccess(commonElements.syncCompleterConstructor), | 1298 .staticFunctionAccess(commonElements.syncCompleterConstructor), |
| 1293 safeVariableName: namer.safeVariablePrefixForAsyncRewrite, | 1299 safeVariableName: namer.safeVariablePrefixForAsyncRewrite, |
| 1294 bodyName: namer.deriveAsyncBodyName(name)); | 1300 bodyName: namer.deriveAsyncBodyName(name)); |
| 1295 break; | 1301 break; |
| 1296 case AsyncMarker.SYNC_STAR: | 1302 case AsyncMarker.SYNC_STAR: |
| 1297 rewriter = new SyncStarRewriter(reporter, element, | 1303 rewriter = new SyncStarRewriter(reporter, element, |
| 1298 endOfIteration: | 1304 endOfIteration: |
| 1299 emitter.staticFunctionAccess(commonElements.endOfIteration), | 1305 emitter.staticFunctionAccess(commonElements.endOfIteration), |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 | 1456 |
| 1451 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { | 1457 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { |
| 1452 return !selector.isGetter; | 1458 return !selector.isGetter; |
| 1453 } | 1459 } |
| 1454 | 1460 |
| 1455 /// Returns `true` if [member] is called from a subclass via `super`. | 1461 /// Returns `true` if [member] is called from a subclass via `super`. |
| 1456 bool isAliasedSuperMember(MemberEntity member) { | 1462 bool isAliasedSuperMember(MemberEntity member) { |
| 1457 return _aliasedSuperMembers.contains(member); | 1463 return _aliasedSuperMembers.contains(member); |
| 1458 } | 1464 } |
| 1459 } | 1465 } |
| OLD | NEW |