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 import '../common.dart'; | 5 import '../common.dart'; |
6 import '../common_elements.dart'; | 6 import '../common_elements.dart'; |
7 import '../constants/values.dart'; | 7 import '../constants/values.dart'; |
8 import '../elements/resolution_types.dart'; | 8 import '../elements/resolution_types.dart'; |
9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
10 import '../io/code_output.dart'; | 10 import '../io/code_output.dart'; |
11 import '../js/js.dart' as jsAst; | 11 import '../js/js.dart' as jsAst; |
12 import '../js/js.dart' show js; | 12 import '../js/js.dart' show js; |
13 import '../js_emitter/code_emitter_task.dart'; | 13 import '../js_emitter/code_emitter_task.dart'; |
14 import '../options.dart'; | 14 import '../options.dart'; |
| 15 import 'constant_system_javascript.dart'; |
15 import 'js_backend.dart'; | 16 import 'js_backend.dart'; |
16 import 'constant_system_javascript.dart'; | |
17 import 'namer.dart'; | 17 import 'namer.dart'; |
| 18 import 'runtime_types.dart'; |
18 | 19 |
19 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); | 20 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); |
20 | 21 |
21 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); | 22 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); |
22 | 23 |
23 /** | 24 /** |
24 * Generates the JavaScript expressions for constants. | 25 * Generates the JavaScript expressions for constants. |
25 * | 26 * |
26 * It uses a given [constantReferenceGenerator] to reference nested constants | 27 * It uses a given [constantReferenceGenerator] to reference nested constants |
27 * (if there are some). It is hence up to that function to decide which | 28 * (if there are some). It is hence up to that function to decide which |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 _rtiEncoder.getTypeRepresentation(_emitter, argument, unexpected)); | 353 _rtiEncoder.getTypeRepresentation(_emitter, argument, unexpected)); |
353 } | 354 } |
354 return new jsAst.ArrayInitializer(arguments); | 355 return new jsAst.ArrayInitializer(arguments); |
355 } | 356 } |
356 | 357 |
357 @override | 358 @override |
358 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { | 359 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { |
359 return constantReferenceGenerator(constant.referenced); | 360 return constantReferenceGenerator(constant.referenced); |
360 } | 361 } |
361 } | 362 } |
OLD | NEW |