Chromium Code Reviews| 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()); |