| 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; | 5 library code_generator; |
| 6 | 6 |
| 7 import 'glue.dart'; | 7 import 'glue.dart'; |
| 8 | 8 |
| 9 import '../../closure.dart' show ClosureClassElement; | 9 import '../../closure.dart' show ClosureClassElement; |
| 10 import '../../common/codegen.dart' show CodegenRegistry; | 10 import '../../common/codegen.dart' show CodegenRegistry; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 .withSourceInformation(sourceInformation); | 219 .withSourceInformation(sourceInformation); |
| 220 } | 220 } |
| 221 | 221 |
| 222 @override | 222 @override |
| 223 js.Expression visitConstant(tree_ir.Constant node) { | 223 js.Expression visitConstant(tree_ir.Constant node) { |
| 224 return buildConstant( | 224 return buildConstant( |
| 225 node.value, | 225 node.value, |
| 226 sourceInformation: node.sourceInformation); | 226 sourceInformation: node.sourceInformation); |
| 227 } | 227 } |
| 228 | 228 |
| 229 js.Expression compileConstant(ParameterElement parameter) { | |
| 230 return buildConstant(glue.getConstantValueForVariable(parameter)); | |
| 231 } | |
| 232 | |
| 233 js.Expression buildStaticInvoke(Element target, | 229 js.Expression buildStaticInvoke(Element target, |
| 234 List<js.Expression> arguments, | 230 List<js.Expression> arguments, |
| 235 {SourceInformation sourceInformation}) { | 231 {SourceInformation sourceInformation}) { |
| 236 registry.registerStaticInvocation(target.declaration); | 232 registry.registerStaticInvocation(target.declaration); |
| 237 js.Expression elementAccess = glue.staticFunctionAccess(target); | 233 js.Expression elementAccess = glue.staticFunctionAccess(target); |
| 238 return new js.Call(elementAccess, arguments, | 234 return new js.Call(elementAccess, arguments, |
| 239 sourceInformation: sourceInformation); | 235 sourceInformation: sourceInformation); |
| 240 } | 236 } |
| 241 | 237 |
| 242 @override | 238 @override |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 js.Expression visitAwait(tree_ir.Await node) { | 892 js.Expression visitAwait(tree_ir.Await node) { |
| 897 return new js.Await(visitExpression(node.input)); | 893 return new js.Await(visitExpression(node.input)); |
| 898 } | 894 } |
| 899 | 895 |
| 900 visitFunctionExpression(tree_ir.FunctionExpression node) { | 896 visitFunctionExpression(tree_ir.FunctionExpression node) { |
| 901 // FunctionExpressions are currently unused. | 897 // FunctionExpressions are currently unused. |
| 902 // We might need them if we want to emit raw JS nested functions. | 898 // We might need them if we want to emit raw JS nested functions. |
| 903 throw 'FunctionExpressions should not be used'; | 899 throw 'FunctionExpressions should not be used'; |
| 904 } | 900 } |
| 905 } | 901 } |
| OLD | NEW |