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

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

Issue 891673003: dart2js: Refactoring, documentation, and a few bugfixes in Namer class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Bugfixes and test case repair Created 5 years, 10 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 | Annotate | Revision Log
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 '../../js/js.dart' as js; 10 import '../../js/js.dart' as js;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 List<js.Expression> arguments = visitArguments(node.arguments); 263 List<js.Expression> arguments = visitArguments(node.arguments);
264 return buildStaticInvoke(selector, target, arguments); 264 return buildStaticInvoke(selector, target, arguments);
265 } 265 }
266 266
267 @override 267 @override
268 js.Expression visitInvokeMethodDirectly(tree_ir.InvokeMethodDirectly node) { 268 js.Expression visitInvokeMethodDirectly(tree_ir.InvokeMethodDirectly node) {
269 registry.registerDirectInvocation(node.target.declaration); 269 registry.registerDirectInvocation(node.target.declaration);
270 if (node.target is ConstructorBodyElement) { 270 if (node.target is ConstructorBodyElement) {
271 // A constructor body cannot be overriden or intercepted, so we can 271 // A constructor body cannot be overriden or intercepted, so we can
272 // use the short form for this invocation. 272 // use the short form for this invocation.
273 // TODO(asgerf): prevent name clash between constructor bodies.
274 return js.js('#.#(#)', 273 return js.js('#.#(#)',
275 [visitExpression(node.receiver), 274 [visitExpression(node.receiver),
276 glue.instanceMethodName(node.target), 275 glue.instanceMethodName(node.target),
277 visitArguments(node.arguments)]); 276 visitArguments(node.arguments)]);
278 } 277 }
279 return js.js('#.#.call(#, #)', 278 return js.js('#.#.call(#, #)',
280 [glue.prototypeAccess(node.target.enclosingClass), 279 [glue.prototypeAccess(node.target.enclosingClass),
281 glue.invocationName(node.selector), 280 glue.invocationName(node.selector),
282 visitExpression(node.receiver), 281 visitExpression(node.receiver),
283 visitArguments(node.arguments)]); 282 visitArguments(node.arguments)]);
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 522
524 @override 523 @override
525 visitSuperInitializer(tree_ir.SuperInitializer node) { 524 visitSuperInitializer(tree_ir.SuperInitializer node) {
526 return errorUnsupportedNode(node); 525 return errorUnsupportedNode(node);
527 } 526 }
528 527
529 dynamic errorUnsupportedNode(tree_ir.DartSpecificNode node) { 528 dynamic errorUnsupportedNode(tree_ir.DartSpecificNode node) {
530 throw "Unsupported node in JS backend: $node"; 529 throw "Unsupported node in JS backend: $node";
531 } 530 }
532 } 531 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698