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

Side by Side Diff: pkg/dartdoc/mirrors/dart2js_mirror.dart

Issue 10879003: Const variables handled as final (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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('mirrors.dart2js'); 5 #library('mirrors.dart2js');
6 6
7 #import('../../../lib/compiler/compiler.dart', prefix: 'diagnostics'); 7 #import('../../../lib/compiler/compiler.dart', prefix: 'diagnostics');
8 #import('../../../lib/compiler/implementation/elements/elements.dart'); 8 #import('../../../lib/compiler/implementation/elements/elements.dart');
9 #import('../../../lib/compiler/implementation/apiimpl.dart', prefix: 'api'); 9 #import('../../../lib/compiler/implementation/apiimpl.dart', prefix: 'api');
10 #import('../../../lib/compiler/implementation/scanner/scannerlib.dart'); 10 #import('../../../lib/compiler/implementation/scanner/scannerlib.dart');
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 bool get isConstructor() => false; 1349 bool get isConstructor() => false;
1350 1350
1351 bool get isField() => true; 1351 bool get isField() => true;
1352 1352
1353 bool get isMethod() => false; 1353 bool get isMethod() => false;
1354 1354
1355 bool get isPrivate() => _isPrivate(simpleName); 1355 bool get isPrivate() => _isPrivate(simpleName);
1356 1356
1357 bool get isStatic() => _variable.modifiers.isStatic(); 1357 bool get isStatic() => _variable.modifiers.isStatic();
1358 1358
1359 // TODO(johnniwinther): Should this return true on const as well?
ngeoffray 2012/08/22 14:24:23 Why don't you do what you did in the compiler with
Johnni Winther 2012/08/22 16:13:16 I need to coordinate with turnidge and gbracha.
1359 bool get isFinal() => _variable.modifiers.isFinal(); 1360 bool get isFinal() => _variable.modifiers.isFinal();
1360 1361
1361 TypeMirror get type() => _convertTypeToTypeMirror(system, 1362 TypeMirror get type() => _convertTypeToTypeMirror(system,
1362 _variable.computeType(system.compiler), 1363 _variable.computeType(system.compiler),
1363 system.compiler.types.dynamicType); 1364 system.compiler.types.dynamicType);
1364 1365
1365 Location get location() { 1366 Location get location() {
1366 var script = _variable.getCompilationUnit().script; 1367 var script = _variable.getCompilationUnit().script;
1367 var node = _variable.variables.parseNode(_diagnosticListener); 1368 var node = _variable.variables.parseNode(_diagnosticListener);
1368 if (node !== null) { 1369 if (node !== null) {
1369 var span = system.compiler.spanFromNode(node, script.uri); 1370 var span = system.compiler.spanFromNode(node, script.uri);
1370 return new Dart2JsLocation(script, span); 1371 return new Dart2JsLocation(script, span);
1371 } else { 1372 } else {
1372 var span = system.compiler.spanFromElement(_variable); 1373 var span = system.compiler.spanFromElement(_variable);
1373 return new Dart2JsLocation(script, span); 1374 return new Dart2JsLocation(script, span);
1374 } 1375 }
1375 } 1376 }
1376 } 1377 }
1377 1378
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698