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

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

Issue 862783002: dart2js: Fix getter/setter flags in the model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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.js_emitter.program_builder; 5 library dart2js.js_emitter.program_builder;
6 6
7 import 'js_emitter.dart' show computeMixinClass; 7 import 'js_emitter.dart' show computeMixinClass;
8 import 'model.dart'; 8 import 'model.dart';
9 9
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 InstanceField _buildInstanceField(VariableElement field, 381 InstanceField _buildInstanceField(VariableElement field,
382 ClassElement holder) { 382 ClassElement holder) {
383 assert(invariant(field, field.isDeclaration)); 383 assert(invariant(field, field.isDeclaration));
384 String name = namer.fieldPropertyName(field); 384 String name = namer.fieldPropertyName(field);
385 385
386 int getterFlags = 0; 386 int getterFlags = 0;
387 if (_fieldNeedsGetter(field)) { 387 if (_fieldNeedsGetter(field)) {
388 bool isIntercepted = backend.fieldHasInterceptedGetter(field); 388 bool isIntercepted = backend.fieldHasInterceptedGetter(field);
389 if (isIntercepted) { 389 if (isIntercepted) {
390 getterFlags += 2; 390 getterFlags += 2;
391 if (backend.isInterceptorClass(holder)) { 391 if (!backend.isInterceptorClass(holder)) {
392 getterFlags += 1; 392 getterFlags += 1;
393 } 393 }
394 } else { 394 } else {
395 getterFlags = 1; 395 getterFlags = 1;
396 } 396 }
397 } 397 }
398 398
399 int setterFlags = 0; 399 int setterFlags = 0;
400 if (_fieldNeedsSetter(field)) { 400 if (_fieldNeedsSetter(field)) {
401 bool isIntercepted = backend.fieldHasInterceptedSetter(field); 401 bool isIntercepted = backend.fieldHasInterceptedSetter(field);
402 if (isIntercepted) { 402 if (isIntercepted) {
403 setterFlags += 2; 403 setterFlags += 2;
404 if (backend.isInterceptorClass(holder)) { 404 if (!backend.isInterceptorClass(holder)) {
405 setterFlags += 1; 405 setterFlags += 1;
406 } 406 }
407 } else { 407 } else {
408 setterFlags = 1; 408 setterFlags = 1;
409 } 409 }
410 } 410 }
411 411
412 return new InstanceField(field, name, getterFlags, setterFlags); 412 return new InstanceField(field, name, getterFlags, setterFlags);
413 } 413 }
414 414
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 _registry.registerConstant(outputUnit, constantValue); 446 _registry.registerConstant(outputUnit, constantValue);
447 assert(!_constants.containsKey(constantValue)); 447 assert(!_constants.containsKey(constantValue));
448 String name = namer.constantName(constantValue); 448 String name = namer.constantName(constantValue);
449 String constantObject = namer.globalObjectForConstant(constantValue); 449 String constantObject = namer.globalObjectForConstant(constantValue);
450 Holder holder = _registry.registerHolder(constantObject); 450 Holder holder = _registry.registerHolder(constantObject);
451 Constant constant = new Constant(name, holder, constantValue); 451 Constant constant = new Constant(name, holder, constantValue);
452 _constants[constantValue] = constant; 452 _constants[constantValue] = constant;
453 } 453 }
454 } 454 }
455 } 455 }
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