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

Side by Side Diff: pkg/analysis_server/test/analysis/notification_outline_test.dart

Issue 652903006: Issue 21373. Fix for removing line info in case of exception (causes NPE in outline computer). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/analysis_server/pubspec.yaml ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('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 library test.analysis.notification.outline; 5 library test.analysis.notification.outline;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/protocol.dart'; 10 import 'package:analysis_server/src/protocol.dart';
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 expect(location.offset, testCode.indexOf("B(int p);")); 249 expect(location.offset, testCode.indexOf("B(int p);"));
250 expect(location.length, "B".length); 250 expect(location.length, "B".length);
251 } 251 }
252 expect(element.parameters, "(int p)"); 252 expect(element.parameters, "(int p)");
253 expect(element.returnType, isNull); 253 expect(element.returnType, isNull);
254 } 254 }
255 } 255 }
256 }); 256 });
257 } 257 }
258 258
259 /**
260 * Code like this caused NPE in the past.
261 *
262 * https://code.google.com/p/dart/issues/detail?id=21373
263 */
264 test_invalidGetterInConstructor() {
265 addTestFile('''
266 class A {
267 A() {
268 get badGetter {
269 const int CONST = 0;
270 }
271 }
272 }
273 ''');
274 return prepareOutline().then((_) {
275 expect(outline, isNotNull);
276 });
277 }
278
259 test_localFunctions() { 279 test_localFunctions() {
260 addTestFile(''' 280 addTestFile('''
261 class A { 281 class A {
262 A() { 282 A() {
263 int local_A() {} 283 int local_A() {}
264 } 284 }
265 m() { 285 m() {
266 local_m() {} 286 local_m() {}
267 } 287 }
268 } 288 }
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 Location location = element.location; 754 Location location = element.location;
735 expect(location.offset, testCode.indexOf("propB(int v) {}")); 755 expect(location.offset, testCode.indexOf("propB(int v) {}"));
736 expect(location.length, "propB".length); 756 expect(location.length, "propB".length);
737 } 757 }
738 expect(element.parameters, "(int v)"); 758 expect(element.parameters, "(int v)");
739 expect(element.returnType, ""); 759 expect(element.returnType, "");
740 } 760 }
741 }); 761 });
742 } 762 }
743 } 763 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/pubspec.yaml ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698