Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 1253333002: dart2js cps: Support async/await by rewriting the JavaScript AST. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add issue number to status file. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698