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

Unified Diff: dart/runtime/bin/file_impl.dart

Issue 10983066: Minor improvement to File diagnostics (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added a test Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: dart/runtime/bin/file_impl.dart
diff --git a/dart/runtime/bin/file_impl.dart b/dart/runtime/bin/file_impl.dart
index 145e4db197d8746f984d459fa2b03ddd78496ea8..2a94cace126e492011e331684c1bde619ad5594a 100644
--- a/dart/runtime/bin/file_impl.dart
+++ b/dart/runtime/bin/file_impl.dart
@@ -493,7 +493,12 @@ class _FileBase {
// Class for encapsulating the native implementation of files.
class _File extends _FileBase implements File {
// Constructor for file.
- _File(String this._name);
+ _File(String this._name) {
+ if (_name is! String) {
+ throw new ArgumentError('${NoSuchMethodError.safeToString(_name)} '
+ 'is not a String');
+ }
+ }
// Constructor from Path for file.
_File.fromPath(Path path) : this(path.toNativePath());

Powered by Google App Engine
This is Rietveld 408576698