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

Side by Side Diff: runtime/bin/directory.cc

Issue 1096803002: Fix check for return of error before calling SyncDirectoryListing. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "bin/directory.h" 5 #include "bin/directory.h"
6 6
7 #include "bin/dartutils.h" 7 #include "bin/dartutils.h"
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // Create the list to hold the directory listing here, and pass it to the 136 // Create the list to hold the directory listing here, and pass it to the
137 // SyncDirectoryListing object, which adds elements to it. 137 // SyncDirectoryListing object, which adds elements to it.
138 Dart_Handle follow_links = Dart_GetNativeArgument(args, 2); 138 Dart_Handle follow_links = Dart_GetNativeArgument(args, 2);
139 // Create the list to hold the directory listing here, and pass it to the 139 // Create the list to hold the directory listing here, and pass it to the
140 // SyncDirectoryListing object, which adds elements to it. 140 // SyncDirectoryListing object, which adds elements to it.
141 Dart_Handle results = 141 Dart_Handle results =
142 Dart_New(DartUtils::GetDartType(DartUtils::kCoreLibURL, "List"), 142 Dart_New(DartUtils::GetDartType(DartUtils::kCoreLibURL, "List"),
143 Dart_Null(), 143 Dart_Null(),
144 0, 144 0,
145 NULL); 145 NULL);
146 if (Dart_IsError(results)) Dart_PropagateError(results);
146 SyncDirectoryListing sync_listing(results, 147 SyncDirectoryListing sync_listing(results,
147 DartUtils::GetStringValue(path), 148 DartUtils::GetStringValue(path),
148 DartUtils::GetBooleanValue(recursive), 149 DartUtils::GetBooleanValue(recursive),
149 DartUtils::GetBooleanValue(follow_links)); 150 DartUtils::GetBooleanValue(follow_links));
150 Directory::List(&sync_listing); 151 Directory::List(&sync_listing);
151 Dart_SetReturnValue(args, results); 152 Dart_SetReturnValue(args, results);
152 } 153 }
153 154
154 155
155 CObject* Directory::CreateRequest(const CObjectArray& request) { 156 CObject* Directory::CreateRequest(const CObjectArray& request) {
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 if (listing->error()) { 421 if (listing->error()) {
421 listing->HandleError("Invalid path"); 422 listing->HandleError("Invalid path");
422 listing->HandleDone(); 423 listing->HandleDone();
423 } else { 424 } else {
424 while (ListNext(listing)) {} 425 while (ListNext(listing)) {}
425 } 426 }
426 } 427 }
427 428
428 } // namespace bin 429 } // namespace bin
429 } // namespace dart 430 } // namespace dart
OLDNEW
« 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