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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 8383037: Improve error handling in the process library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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/socket_macos.cc ('k') | tests/standalone/src/ProcessInvalidArgumentsTest.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 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 if ((offset + length) <= array_obj.Length()) { 868 if ((offset + length) <= array_obj.Length()) {
869 Object& element = Object::Handle(); 869 Object& element = Object::Handle();
870 Integer& integer = Integer::Handle(); 870 Integer& integer = Integer::Handle();
871 for (int i = 0; i < length; i++) { 871 for (int i = 0; i < length; i++) {
872 element = array_obj.At(offset + i); 872 element = array_obj.At(offset + i);
873 integer ^= element.raw(); 873 integer ^= element.raw();
874 native_array[i] = static_cast<uint8_t>(integer.AsInt64Value() & 0xff); 874 native_array[i] = static_cast<uint8_t>(integer.AsInt64Value() & 0xff);
875 ASSERT(integer.AsInt64Value() <= 0xff); 875 ASSERT(integer.AsInt64Value() <= 0xff);
876 // TODO(hpayer): value should always be smaller then 0xff. Add error 876 // TODO(hpayer): value should always be smaller then 0xff. Add error
877 // handling. 877 // handling.
878 } 878 }
879 RETURN_CINT(0); 879 RETURN_CINT(0);
880 } 880 }
881 RETURN_FAILURE("Invalid length passed in to access array elements"); 881 RETURN_FAILURE("Invalid length passed in to access array elements");
882 } 882 }
883 RETURN_FAILURE("Object is not an Array"); 883 RETURN_FAILURE("Object is not an Array");
884 } 884 }
885 885
886 886
887 DART_EXPORT Dart_Result Dart_ArrayGetAt(Dart_Handle array, intptr_t index) { 887 DART_EXPORT Dart_Result Dart_ArrayGetAt(Dart_Handle array, intptr_t index) {
888 Zone zone; // Setup a VM zone as we are creating some handles. 888 Zone zone; // Setup a VM zone as we are creating some handles.
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1727 ASSERT(isolate != NULL); 1727 ASSERT(isolate != NULL);
1728 ApiState* state = isolate->api_state(); 1728 ApiState* state = isolate->api_state();
1729 ASSERT(state != NULL); 1729 ASSERT(state != NULL);
1730 ApiLocalScope* scope = state->top_scope(); 1730 ApiLocalScope* scope = state->top_scope();
1731 ASSERT(scope != NULL); 1731 ASSERT(scope != NULL);
1732 return scope->zone().Reallocate(ptr, old_size, new_size); 1732 return scope->zone().Reallocate(ptr, old_size, new_size);
1733 } 1733 }
1734 1734
1735 1735
1736 } // namespace dart 1736 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/socket_macos.cc ('k') | tests/standalone/src/ProcessInvalidArgumentsTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698