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

Side by Side Diff: pkg/analyzer/lib/src/util/asserts.dart

Issue 887943004: Check PackageMapUriResolver constructor arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for the server and tests Created 5 years, 10 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
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 library engine.utilities.asserts;
6
7 /**
8 * Ensures that the given [value] is not null.
9 * Otherwise throws an [ArgumentError].
10 * An optional [description] is used in the error message.
11 */
12 void notNull(Object value, [String description]) {
13 if (value == null) {
14 if (description == null) {
15 throw new ArgumentError('Must not be null');
16 } else {
17 throw new ArgumentError('Must not be null: $description');
18 }
19 }
20 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698