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

Side by Side Diff: runtime/bin/file_impl.dart

Issue 8400038: Use strict equality when comparing with null, especially when null is a default value. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « corelib/src/implementation/splay_tree.dart ('k') | runtime/bin/process_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class _FileInputStream implements FileInputStream { 5 class _FileInputStream implements FileInputStream {
6 _FileInputStream(File file) { 6 _FileInputStream(File file) {
7 _file = new File(file.name); 7 _file = new File(file.name);
8 _file.openSync(); 8 _file.openSync();
9 } 9 }
10 10
(...skipping 14 matching lines...) Expand all
25 if (bytesRead < bytesToRead) { 25 if (bytesRead < bytesToRead) {
26 List<int> newBuffer = new List<int>(bytesRead); 26 List<int> newBuffer = new List<int>(bytesRead);
27 newBuffer.copyFrom(buffer, 0, 0, bytesRead); 27 newBuffer.copyFrom(buffer, 0, 0, bytesRead);
28 return newBuffer; 28 return newBuffer;
29 } else { 29 } else {
30 return buffer; 30 return buffer;
31 } 31 }
32 } 32 }
33 33
34 int readInto(List<int> buffer, int offset, int len) { 34 int readInto(List<int> buffer, int offset, int len) {
35 if (offset == null) offset = 0; 35 if (offset === null) offset = 0;
36 if (len == null) len = buffer.length; 36 if (len === null) len = buffer.length;
37 if (offset < 0) throw new StreamException("Illegal offset $offset"); 37 if (offset < 0) throw new StreamException("Illegal offset $offset");
38 if (len < 0) throw new StreamException("Illegal length $len"); 38 if (len < 0) throw new StreamException("Illegal length $len");
39 return _file.readListSync(buffer, offset, len); 39 return _file.readListSync(buffer, offset, len);
40 } 40 }
41 41
42 int available() { 42 int available() {
43 return _file.lengthSync() - _file.positionSync(); 43 return _file.lengthSync() - _file.positionSync();
44 } 44 }
45 45
46 bool closed() { 46 bool closed() {
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 var _existsHandler; 322 var _existsHandler;
323 var _createHandler; 323 var _createHandler;
324 var _openHandler; 324 var _openHandler;
325 var _closeHandler; 325 var _closeHandler;
326 var _readByteHandler; 326 var _readByteHandler;
327 var _readListHandler; 327 var _readListHandler;
328 var _noPendingWriteHandler; 328 var _noPendingWriteHandler;
329 var _errorHandler; 329 var _errorHandler;
330 } 330 }
OLDNEW
« no previous file with comments | « corelib/src/implementation/splay_tree.dart ('k') | runtime/bin/process_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698