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

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: Comment shortened 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 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 bool get isConstructor() => false; 1352 bool get isConstructor() => false;
1353 1353
1354 bool get isField() => true; 1354 bool get isField() => true;
1355 1355
1356 bool get isMethod() => false; 1356 bool get isMethod() => false;
1357 1357
1358 bool get isPrivate() => _isPrivate(simpleName); 1358 bool get isPrivate() => _isPrivate(simpleName);
1359 1359
1360 bool get isStatic() => _variable.modifiers.isStatic(); 1360 bool get isStatic() => _variable.modifiers.isStatic();
1361 1361
1362 // TODO(johnniwinther): Should this return true on const as well?
1362 bool get isFinal() => _variable.modifiers.isFinal(); 1363 bool get isFinal() => _variable.modifiers.isFinal();
1363 1364
1364 TypeMirror get type() => _convertTypeToTypeMirror(system, 1365 TypeMirror get type() => _convertTypeToTypeMirror(system,
1365 _variable.computeType(system.compiler), 1366 _variable.computeType(system.compiler),
1366 system.compiler.types.dynamicType); 1367 system.compiler.types.dynamicType);
1367 1368
1368 Location get location() { 1369 Location get location() {
1369 var script = _variable.getCompilationUnit().script; 1370 var script = _variable.getCompilationUnit().script;
1370 var node = _variable.variables.parseNode(_diagnosticListener); 1371 var node = _variable.variables.parseNode(_diagnosticListener);
1371 if (node !== null) { 1372 if (node !== null) {
1372 var span = system.compiler.spanFromNode(node, script.uri); 1373 var span = system.compiler.spanFromNode(node, script.uri);
1373 return new Dart2JsLocation(script, span); 1374 return new Dart2JsLocation(script, span);
1374 } else { 1375 } else {
1375 var span = system.compiler.spanFromElement(_variable); 1376 var span = system.compiler.spanFromElement(_variable);
1376 return new Dart2JsLocation(script, span); 1377 return new Dart2JsLocation(script, span);
1377 } 1378 }
1378 } 1379 }
1379 } 1380 }
1380 1381
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698