| 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 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 "@NoSideEffects() should always be combined with @NoInline."); | 1279 "@NoSideEffects() should always be combined with @NoInline."); |
| 1280 } | 1280 } |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 MethodElement helperForBadMain() => commonElements.badMain; | 1283 MethodElement helperForBadMain() => commonElements.badMain; |
| 1284 | 1284 |
| 1285 MethodElement helperForMissingMain() => commonElements.missingMain; | 1285 MethodElement helperForMissingMain() => commonElements.missingMain; |
| 1286 | 1286 |
| 1287 MethodElement helperForMainArity() => commonElements.mainHasTooManyParameters; | 1287 MethodElement helperForMainArity() => commonElements.mainHasTooManyParameters; |
| 1288 | 1288 |
| 1289 /// Returns the filename for the output-unit named [name]. | |
| 1290 /// | |
| 1291 /// The filename is of the form "<main output file>_<name>.part.js". | |
| 1292 /// If [addExtension] is false, the ".part.js" suffix is left out. | |
| 1293 String deferredPartFileName(String name, {bool addExtension: true}) { | |
| 1294 assert(name != ""); | |
| 1295 String outPath = compiler.options.outputUri != null | |
| 1296 ? compiler.options.outputUri.path | |
| 1297 : "out"; | |
| 1298 String outName = outPath.substring(outPath.lastIndexOf('/') + 1); | |
| 1299 String extension = addExtension ? ".part.js" : ""; | |
| 1300 return "${outName}_$name$extension"; | |
| 1301 } | |
| 1302 | |
| 1303 /// Enable deferred loading. Returns `true` if the backend supports deferred | 1289 /// Enable deferred loading. Returns `true` if the backend supports deferred |
| 1304 /// loading. | 1290 /// loading. |
| 1305 bool enableDeferredLoadingIfSupported(Spannable node) => true; | 1291 bool enableDeferredLoadingIfSupported(Spannable node) => true; |
| 1306 | 1292 |
| 1307 /// Enable compilation of code with compile time errors. Returns `true` if | 1293 /// Enable compilation of code with compile time errors. Returns `true` if |
| 1308 /// supported by the backend. | 1294 /// supported by the backend. |
| 1309 bool enableCodegenWithErrorsIfSupported(Spannable node) => true; | 1295 bool enableCodegenWithErrorsIfSupported(Spannable node) => true; |
| 1310 | 1296 |
| 1311 jsAst.Expression rewriteAsync( | 1297 jsAst.Expression rewriteAsync( |
| 1312 FunctionElement element, jsAst.Expression code) { | 1298 FunctionElement element, jsAst.Expression code) { |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 | 1479 |
| 1494 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { | 1480 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { |
| 1495 return !selector.isGetter; | 1481 return !selector.isGetter; |
| 1496 } | 1482 } |
| 1497 | 1483 |
| 1498 /// Returns `true` if [member] is called from a subclass via `super`. | 1484 /// Returns `true` if [member] is called from a subclass via `super`. |
| 1499 bool isAliasedSuperMember(MemberEntity member) { | 1485 bool isAliasedSuperMember(MemberEntity member) { |
| 1500 return _aliasedSuperMembers.contains(member); | 1486 return _aliasedSuperMembers.contains(member); |
| 1501 } | 1487 } |
| 1502 } | 1488 } |
| OLD | NEW |