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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.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: Rebase Created 5 years, 9 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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class InterceptorStubGenerator { 7 class InterceptorStubGenerator {
8 final Compiler compiler; 8 final Compiler compiler;
9 final Namer namer; 9 final Namer namer;
10 final JavaScriptBackend backend; 10 final JavaScriptBackend backend;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 ''', typeCheck); 284 ''', typeCheck);
285 } 285 }
286 } 286 }
287 return null; 287 return null;
288 } 288 }
289 289
290 jsAst.Expression generateOneShotInterceptor(String name) { 290 jsAst.Expression generateOneShotInterceptor(String name) {
291 Selector selector = backend.oneShotInterceptors[name]; 291 Selector selector = backend.oneShotInterceptors[name];
292 Set<ClassElement> classes = 292 Set<ClassElement> classes =
293 backend.getInterceptedClassesOn(selector.name); 293 backend.getInterceptedClassesOn(selector.name);
294 String getInterceptorName = 294 String getInterceptorName = namer.nameForGetInterceptor(classes);
295 namer.getInterceptorName(backend.getInterceptorMethod, classes);
296 295
297 List<String> parameterNames = <String>[]; 296 List<String> parameterNames = <String>[];
298 parameterNames.add('receiver'); 297 parameterNames.add('receiver');
299 298
300 if (selector.isSetter) { 299 if (selector.isSetter) {
301 parameterNames.add('value'); 300 parameterNames.add('value');
302 } else { 301 } else {
303 for (int i = 0; i < selector.argumentCount; i++) { 302 for (int i = 0; i < selector.argumentCount; i++) {
304 parameterNames.add('a$i'); 303 parameterNames.add('a$i');
305 } 304 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 363
365 var map = new jsAst.ObjectInitializer(properties); 364 var map = new jsAst.ObjectInitializer(properties);
366 elements.add(map); 365 elements.add(map);
367 } 366 }
368 } 367 }
369 } 368 }
370 369
371 return new jsAst.ArrayInitializer(elements); 370 return new jsAst.ArrayInitializer(elements);
372 } 371 }
373 } 372 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/class_stub_generator.dart ('k') | pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698