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

Side by Side Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 1933763002: Use null-aware operators to clean up the code (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Additional clean-up Created 4 years, 7 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
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 analyzer.src.generated.error; 5 library analyzer.src.generated.error;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart' show AstNode; 9 import 'package:analyzer/dart/ast/ast.dart' show AstNode;
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 3129 matching lines...) Expand 10 before | Expand all | Expand 10 after
3140 this._source = _defaultSource; 3140 this._source = _defaultSource;
3141 } 3141 }
3142 3142
3143 Source get source => _source; 3143 Source get source => _source;
3144 3144
3145 /** 3145 /**
3146 * Set the source to be used when reporting errors to the given [source]. 3146 * Set the source to be used when reporting errors to the given [source].
3147 * Setting the source to `null` will cause the default source to be used. 3147 * Setting the source to `null` will cause the default source to be used.
3148 */ 3148 */
3149 void set source(Source source) { 3149 void set source(Source source) {
3150 this._source = source == null ? _defaultSource : source; 3150 this._source = source ?? _defaultSource;
3151 } 3151 }
3152 3152
3153 /** 3153 /**
3154 * Creates an error with properties with the given [errorCode] and 3154 * Creates an error with properties with the given [errorCode] and
3155 * [arguments]. The [node] is used to compute the location of the error. 3155 * [arguments]. The [node] is used to compute the location of the error.
3156 */ 3156 */
3157 AnalysisErrorWithProperties newErrorWithProperties( 3157 AnalysisErrorWithProperties newErrorWithProperties(
3158 ErrorCode errorCode, AstNode node, List<Object> arguments) => 3158 ErrorCode errorCode, AstNode node, List<Object> arguments) =>
3159 new AnalysisErrorWithProperties( 3159 new AnalysisErrorWithProperties(
3160 _source, node.offset, node.length, errorCode, arguments); 3160 _source, node.offset, node.length, errorCode, arguments);
(...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after
5809 * Initialize a newly created error code to have the given [name]. 5809 * Initialize a newly created error code to have the given [name].
5810 */ 5810 */
5811 const TodoCode(String name) : super(name, "{0}"); 5811 const TodoCode(String name) : super(name, "{0}");
5812 5812
5813 @override 5813 @override
5814 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 5814 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
5815 5815
5816 @override 5816 @override
5817 ErrorType get type => ErrorType.TODO; 5817 ErrorType get type => ErrorType.TODO;
5818 } 5818 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698