| 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 '../../tree_ir/tree_ir_nodes.dart' as tree_ir; | 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; |
| 10 import '../../tree_ir/tree_ir_nodes.dart' show BuiltinOperator; | 10 import '../../tree_ir/tree_ir_nodes.dart' show BuiltinOperator; |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 return js.js("typeof # === 'number'", args); | 820 return js.js("typeof # === 'number'", args); |
| 821 case BuiltinOperator.IsNotNumber: | 821 case BuiltinOperator.IsNotNumber: |
| 822 return js.js("typeof # !== 'number'", args); | 822 return js.js("typeof # !== 'number'", args); |
| 823 case BuiltinOperator.IsFloor: | 823 case BuiltinOperator.IsFloor: |
| 824 return js.js("Math.floor(#) === #", args); | 824 return js.js("Math.floor(#) === #", args); |
| 825 case BuiltinOperator.IsNumberAndFloor: | 825 case BuiltinOperator.IsNumberAndFloor: |
| 826 return js.js("typeof # === 'number' && Math.floor(#) === #", args); | 826 return js.js("typeof # === 'number' && Math.floor(#) === #", args); |
| 827 } | 827 } |
| 828 } | 828 } |
| 829 | 829 |
| 830 @override |
| 831 js.Expression visitAwait(tree_ir.Await node) { |
| 832 return new js.Await(visitExpression(node.input)); |
| 833 } |
| 834 |
| 830 visitFunctionExpression(tree_ir.FunctionExpression node) { | 835 visitFunctionExpression(tree_ir.FunctionExpression node) { |
| 831 // FunctionExpressions are currently unused. | 836 // FunctionExpressions are currently unused. |
| 832 // We might need them if we want to emit raw JS nested functions. | 837 // We might need them if we want to emit raw JS nested functions. |
| 833 throw 'FunctionExpressions should not be used'; | 838 throw 'FunctionExpressions should not be used'; |
| 834 } | 839 } |
| 835 } | 840 } |
| OLD | NEW |