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

Side by Side Diff: runtime/bin/builtin_natives.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 | « no previous file | runtime/vm/dart_api_impl.cc » ('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/builtin.h" 5 #include "bin/builtin.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 void Builtin::PrintString(FILE* out, Dart_Handle str) { 106 void Builtin::PrintString(FILE* out, Dart_Handle str) {
107 const uint8_t* characters = NULL; 107 const uint8_t* characters = NULL;
108 intptr_t length; 108 intptr_t length;
109 Dart_Handle result = Dart_StringToBytes(str, &characters, &length); 109 Dart_Handle result = Dart_StringToBytes(str, &characters, &length);
110 if (Dart_IsError(result)) { 110 if (Dart_IsError(result)) {
111 // TODO(turnidge): Consider propagating some errors here. What if 111 // TODO(turnidge): Consider propagating some errors here. What if
112 // an isolate gets interrupted by the embedder in the middle of 112 // an isolate gets interrupted by the embedder in the middle of
113 // Dart_StringToBytes? We need to make sure not to swallow the 113 // Dart_StringToBytes? We need to make sure not to swallow the
114 // interrupt. 114 // interrupt.
115 fputs(Dart_GetError(result)); 115 fputs(Dart_GetError(result), out);
116 } else { 116 } else {
117 fwrite(characters, sizeof(*characters), length, out); 117 fwrite(characters, sizeof(*characters), length, out);
118 } 118 }
119 fputc('\n', out); 119 fputc('\n', out);
120 fflush(out); 120 fflush(out);
121 } 121 }
122 122
123 123
124 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) { 124 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) {
125 Dart_EnterScope(); 125 Dart_EnterScope();
(...skipping 16 matching lines...) Expand all
142 } else { 142 } else {
143 ASSERT(id == Builtin::kIOLibrary); 143 ASSERT(id == Builtin::kIOLibrary);
144 url = Dart_NewString(DartUtils::kIOLibURL); 144 url = Dart_NewString(DartUtils::kIOLibURL);
145 } 145 }
146 Dart_Handle builtin_lib = Dart_LookupLibrary(url); 146 Dart_Handle builtin_lib = Dart_LookupLibrary(url);
147 DART_CHECK_VALID(builtin_lib); 147 DART_CHECK_VALID(builtin_lib);
148 // Setup the native resolver for built in library functions. 148 // Setup the native resolver for built in library functions.
149 Dart_Handle result = Dart_SetNativeResolver(builtin_lib, NativeLookup); 149 Dart_Handle result = Dart_SetNativeResolver(builtin_lib, NativeLookup);
150 DART_CHECK_VALID(result); 150 DART_CHECK_VALID(result);
151 } 151 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698