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

Side by Side Diff: pkg/smoke/lib/static.dart

Issue 583803002: fix toString calls on Type objects in smoke (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix typo Created 6 years, 3 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 | « pkg/smoke/lib/mirrors.dart ('k') | pkg/smoke/pubspec.yaml » ('j') | 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 /// Static implementation of smoke services using code-generated data. 5 /// Static implementation of smoke services using code-generated data.
6 library smoke.static; 6 library smoke.static;
7 7
8 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:logging/logging.dart'; 10 import 'package:logging/logging.dart';
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 void write(Object object, Symbol name, value) { 109 void write(Object object, Symbol name, value) {
110 var setter = _setters[name]; 110 var setter = _setters[name];
111 if (setter == null) { 111 if (setter == null) {
112 throw new MissingCodeException('setter "$name" in $object'); 112 throw new MissingCodeException('setter "$name" in $object');
113 } 113 }
114 setter(object, value); 114 setter(object, value);
115 } 115 }
116 116
117 invoke(object, Symbol name, List args, {Map namedArgs, bool adjust: false}) { 117 invoke(object, Symbol name, List args, {Map namedArgs, bool adjust: false}) {
118 var method; 118 var method;
119 if (object is Type) { 119 if (object is Type && name != #toString) {
120 var classMethods = _staticMethods[object]; 120 var classMethods = _staticMethods[object];
121 method = classMethods == null ? null : classMethods[name]; 121 method = classMethods == null ? null : classMethods[name];
122 } else { 122 } else {
123 var getter = _getters[name]; 123 var getter = _getters[name];
124 method = getter == null ? null : getter(object); 124 method = getter == null ? null : getter(object);
125 } 125 }
126 if (method == null) { 126 if (method == null) {
127 throw new MissingCodeException('method "$name" in $object'); 127 throw new MissingCodeException('method "$name" in $object');
128 } 128 }
129 var tentativeError; 129 var tentativeError;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 /// Exception thrown when trynig to access something that should be there, but 284 /// Exception thrown when trynig to access something that should be there, but
285 /// the code generator didn't include it. 285 /// the code generator didn't include it.
286 class MissingCodeException implements Exception { 286 class MissingCodeException implements Exception {
287 final String description; 287 final String description;
288 MissingCodeException(this.description); 288 MissingCodeException(this.description);
289 289
290 String toString() => 'Missing $description. ' 290 String toString() => 'Missing $description. '
291 'Code generation for the smoke package seems incomplete.'; 291 'Code generation for the smoke package seems incomplete.';
292 } 292 }
OLDNEW
« no previous file with comments | « pkg/smoke/lib/mirrors.dart ('k') | pkg/smoke/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698