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

Side by Side Diff: pkg/kernel/lib/interpreter/interpreter.dart

Issue 2795883003: Fix Setter lookup (Closed)
Patch Set: Created 3 years, 8 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
« 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 library kernel.interpreter; 4 library kernel.interpreter;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../ast.dart' as ast show Class; 7 import '../ast.dart' as ast show Class;
8 8
9 class NotImplemented { 9 class NotImplemented {
10 String message; 10 String message;
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 Getter lookupGetter(Name name) { 308 Getter lookupGetter(Name name) {
309 Getter getter = getters[name]; 309 Getter getter = getters[name];
310 if (getter != null) return getter; 310 if (getter != null) return getter;
311 if (superclass != null) return superclass.lookupGetter(name); 311 if (superclass != null) return superclass.lookupGetter(name);
312 return (Value receiver) => notImplemented(obj: name); 312 return (Value receiver) => notImplemented(obj: name);
313 } 313 }
314 314
315 Setter lookupSetter(Name name) { 315 Setter lookupSetter(Name name) {
316 Setter setter = setters[name]; 316 Setter setter = setters[name];
317 if (setter != null) return setter; 317 if (setter != null) return setter;
318 if (superclass != null) return lookupSetter(name); 318 if (superclass != null) return superclass.lookupSetter(name);
319 return (Value receiver, Value value) => notImplemented(obj: name); 319 return (Value receiver, Value value) => notImplemented(obj: name);
320 } 320 }
321 321
322 Value getProperty(ObjectValue object, Member member) { 322 Value getProperty(ObjectValue object, Member member) {
323 if (member is Field) { 323 if (member is Field) {
324 int index = instanceFields.indexOf(member); 324 int index = instanceFields.indexOf(member);
325 // TODO: throw NoSuchMethodError instead. 325 // TODO: throw NoSuchMethodError instead.
326 if (index < 0) return notImplemented(m: 'NoSuchMethod: ${member}'); 326 if (index < 0) return notImplemented(m: 'NoSuchMethod: ${member}');
327 return object.fields[index]; 327 return object.fields[index];
328 } 328 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 490
491 class NullValue extends LiteralValue { 491 class NullValue extends LiteralValue {
492 Object get value => null; 492 Object get value => null;
493 493
494 const NullValue(); 494 const NullValue();
495 } 495 }
496 496
497 notImplemented({String m, Object obj}) { 497 notImplemented({String m, Object obj}) {
498 throw new NotImplemented(m ?? 'Evaluation for $obj is not implemented'); 498 throw new NotImplemented(m ?? 'Evaluation for $obj is not implemented');
499 } 499 }
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