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

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: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)} '
Ivan Posva 2012/10/02 00:19:38 Peter can you explain why you are using NoSuchMeth
ahe 2012/10/02 04:49:24 It makes sense to use safeToString here because th
Ivan Posva 2012/10/02 05:19:11 It just feels very strange to be calling some rand
ahe 2012/10/02 05:39:47 Agreed, I would like to find a better place for th
ahe 2012/10/02 07:47:11 Filed http://dartbug.com/5596.
+ 'is not a String');
+ }
+ }
// Constructor from Path for file.
_File.fromPath(Path path) : this(path.toNativePath());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698