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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart

Issue 876083005: dart2js: fix getter name in new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dart2js.new_js_emitter.model_emitter; 5 library dart2js.new_js_emitter.model_emitter;
6 6
7 import '../../dart2jslib.dart' show Compiler; 7 import '../../dart2jslib.dart' show Compiler;
8 import '../../dart_types.dart' show DartType; 8 import '../../dart_types.dart' show DartType;
9 import '../../js/js.dart' as js; 9 import '../../js/js.dart' as js;
10 import '../../js_backend/js_backend.dart' show 10 import '../../js_backend/js_backend.dart' show
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 switch (flags) { 406 switch (flags) {
407 case 1: return "function() { return this[#]; }"; 407 case 1: return "function() { return this[#]; }";
408 case 2: return "function(receiver) { return receiver[#]; }"; 408 case 2: return "function(receiver) { return receiver[#]; }";
409 case 3: return "function(receiver) { return this[#]; }"; 409 case 3: return "function(receiver) { return this[#]; }";
410 } 410 }
411 return null; 411 return null;
412 } 412 }
413 413
414 js.Expression fieldName = js.string(field.name); 414 js.Expression fieldName = js.string(field.name);
415 js.Expression code = js.js(getterTemplateFor(field.getterFlags), fieldName); 415 js.Expression code = js.js(getterTemplateFor(field.getterFlags), fieldName);
416 String getterName = "${namer.getterPrefix}${field.name}"; 416 String getterName = "${namer.getterPrefix}${field.accessorName}";
417 return new StubMethod(getterName, code); 417 return new StubMethod(getterName, code);
418 } 418 }
419 419
420 Method _generateSetter(Field field) { 420 Method _generateSetter(Field field) {
421 String setterTemplateFor(int flags) { 421 String setterTemplateFor(int flags) {
422 switch (flags) { 422 switch (flags) {
423 case 1: return "function(val) { return this[#] = val; }"; 423 case 1: return "function(val) { return this[#] = val; }";
424 case 2: return "function(receiver, val) { return receiver[#] = val; }"; 424 case 2: return "function(receiver, val) { return receiver[#] = val; }";
425 case 3: return "function(receiver, val) { return this[#] = val; }"; 425 case 3: return "function(receiver, val) { return this[#] = val; }";
426 } 426 }
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 887
888 var end = Date.now(); 888 var end = Date.now();
889 print('Setup: ' + (end - start) + ' ms.'); 889 print('Setup: ' + (end - start) + ' ms.');
890 890
891 #main(); // Start main. 891 #main(); // Start main.
892 892
893 }(Date.now(), #code) 893 }(Date.now(), #code)
894 }"""; 894 }""";
895 895
896 } 896 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698