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

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

Issue 10343010: Fix two semantic errors from my previous check-in. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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') | 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 "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 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 if (bytes == NULL) { 1624 if (bytes == NULL) {
1625 return Api::NewError("%s expects argument 'bytes' to be non-null.", 1625 return Api::NewError("%s expects argument 'bytes' to be non-null.",
1626 CURRENT_FUNC); 1626 CURRENT_FUNC);
1627 } 1627 }
1628 if (length == NULL) { 1628 if (length == NULL) {
1629 return Api::NewError("%s expects argument 'length' to be non-null.", 1629 return Api::NewError("%s expects argument 'length' to be non-null.",
1630 CURRENT_FUNC); 1630 CURRENT_FUNC);
1631 } 1631 }
1632 const char* cstring = str.ToCString(); 1632 const char* cstring = str.ToCString();
1633 *length = Utf8::Length(str); 1633 *length = Utf8::Length(str);
1634 char* result = reinterpret_cast<char*>(Api::Allocate(isolate, *length)); 1634 uint8_t* result = reinterpret_cast<uint8_t*>(Api::Allocate(isolate, *length));
1635 if (result == NULL) { 1635 if (result == NULL) {
1636 return Api::NewError("Unable to allocate memory"); 1636 return Api::NewError("Unable to allocate memory");
1637 } 1637 }
1638 memmove(result, cstring, *length); 1638 memmove(result, cstring, *length);
1639 *bytes = result; 1639 *bytes = result;
1640 return Api::Success(isolate); 1640 return Api::Success(isolate);
1641 } 1641 }
1642 1642
1643 1643
1644 // --- Lists --- 1644 // --- Lists ---
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
3322 *buffer = NULL; 3322 *buffer = NULL;
3323 } 3323 }
3324 delete debug_region; 3324 delete debug_region;
3325 } else { 3325 } else {
3326 *buffer = NULL; 3326 *buffer = NULL;
3327 *buffer_size = 0; 3327 *buffer_size = 0;
3328 } 3328 }
3329 } 3329 }
3330 3330
3331 } // namespace dart 3331 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698