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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 1437373002: dart2js cps: Add CharCodeAt builtin. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: rebase Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_backend/codegen/codegen.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index bcf09683b88188eb9cd796c250bc132d3264e51d..26800caccde428964cf9c8249069cc8b46a6846b 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -949,6 +949,8 @@ class CodeGenerator extends tree_ir.StatementVisitor
case BuiltinOperator.StringConcatenate:
if (args.isEmpty) return js.string('');
return args.reduce((e1,e2) => new js.Binary('+', e1, e2));
+ case BuiltinOperator.CharCodeAt:
+ return js.js('#.charCodeAt(#)', args);
case BuiltinOperator.Identical:
registry.registerStaticUse(new StaticUse.staticInvoke(
glue.identicalFunction, new CallStructure.unnamed(args.length)));

Powered by Google App Engine
This is Rietveld 408576698