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

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

Issue 13896034: Add the ability to change the working directory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed tests Created 7 years, 7 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 | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/directory.h » ('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) 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/dartutils.h" 5 #include "bin/dartutils.h"
6 6
7 #include "bin/extensions.h" 7 #include "bin/extensions.h"
8 #include "bin/directory.h" 8 #include "bin/directory.h"
9 #include "bin/file.h" 9 #include "bin/file.h"
10 #include "bin/io_buffer.h" 10 #include "bin/io_buffer.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 args[1] = os_error; 559 args[1] = os_error;
560 return Dart_New(clazz, Dart_Null(), 2, args); 560 return Dart_New(clazz, Dart_Null(), 2, args);
561 } 561 }
562 562
563 563
564 Dart_Handle DartUtils::NewDartExceptionWithMessage(const char* library_url, 564 Dart_Handle DartUtils::NewDartExceptionWithMessage(const char* library_url,
565 const char* exception_name, 565 const char* exception_name,
566 const char* message) { 566 const char* message) {
567 // Create a Dart Exception object with a message. 567 // Create a Dart Exception object with a message.
568 Dart_Handle clazz = GetDartClass(library_url, exception_name); 568 Dart_Handle clazz = GetDartClass(library_url, exception_name);
569 Dart_Handle args[1]; 569 if (message != NULL) {
570 args[0] = NewString(message); 570 Dart_Handle args[1];
571 return Dart_New(clazz, Dart_Null(), 1, args); 571 args[0] = NewString(message);
572 return Dart_New(clazz, Dart_Null(), 1, args);
573 } else {
574 return Dart_New(clazz, Dart_Null(), 0, NULL);
575 }
572 } 576 }
573 577
574 578
575 Dart_Handle DartUtils::NewDartArgumentError(const char* message) { 579 Dart_Handle DartUtils::NewDartArgumentError(const char* message) {
576 return NewDartExceptionWithMessage(kCoreLibURL, 580 return NewDartExceptionWithMessage(kCoreLibURL,
577 "ArgumentError", 581 "ArgumentError",
578 message); 582 message);
579 } 583 }
580 584
581 585
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 new CObjectString(CObject::NewString(os_error->message())); 752 new CObjectString(CObject::NewString(os_error->message()));
749 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); 753 CObjectArray* result = new CObjectArray(CObject::NewArray(3));
750 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); 754 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError)));
751 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); 755 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code())));
752 result->SetAt(2, error_message); 756 result->SetAt(2, error_message);
753 return result; 757 return result;
754 } 758 }
755 759
756 } // namespace bin 760 } // namespace bin
757 } // namespace dart 761 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/directory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698