Chromium Code Reviews| 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 library code_generator_dependencies; | 5 library code_generator_dependencies; |
| 6 | 6 |
| 7 import '../js_backend.dart'; | 7 import '../js_backend.dart'; |
| 8 import '../../dart2jslib.dart'; | 8 import '../../dart2jslib.dart'; |
| 9 import '../../js_emitter/js_emitter.dart'; | 9 import '../../js_emitter/js_emitter.dart'; |
| 10 import '../../js/js.dart' as js; | 10 import '../../js/js.dart' as js; |
| 11 import '../../constants/values.dart'; | 11 import '../../constants/values.dart'; |
| 12 import '../../elements/elements.dart'; | |
| 12 | 13 |
| 13 /// Encapsulates the dependencies of the function-compiler to the compiler, | 14 /// Encapsulates the dependencies of the function-compiler to the compiler, |
| 14 /// backend and emitter. | 15 /// backend and emitter. |
| 15 /// TODO(sigurdm): Should be refactored when we have a better feeling for the | 16 /// TODO(sigurdm): Should be refactored when we have a better feeling for the |
| 16 /// interface. | 17 /// interface. |
| 17 class Glue { | 18 class Glue { |
| 18 final Compiler compiler; | 19 final Compiler compiler; |
| 19 | 20 |
| 20 JavaScriptBackend get backend => compiler.backend; | 21 JavaScriptBackend get backend => compiler.backend; |
| 21 | 22 |
| 23 Namer get namer => backend.namer; | |
|
floitsch
2014/11/13 14:41:57
make private.
| |
| 24 | |
| 22 CodeEmitterTask get emitter => backend.emitter; | 25 CodeEmitterTask get emitter => backend.emitter; |
| 23 | 26 |
| 24 Glue(this.compiler); | 27 Glue(this.compiler); |
| 25 | 28 |
| 26 js.Expression constantReference(ConstantValue value) { | 29 js.Expression constantReference(ConstantValue value) { |
| 27 return emitter.constantReference(value); | 30 return emitter.constantReference(value); |
| 28 } | 31 } |
| 29 | 32 |
| 33 js.Expression elementAccess(Element element) { | |
| 34 return namer.elementAccess(element); | |
| 35 } | |
| 36 | |
| 30 } | 37 } |
| OLD | NEW |