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

Unified Diff: runtime/vm/parser.cc

Issue 8380020: Refactor the dart api a bit: (Closed) Base URL: http://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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 775)
+++ runtime/vm/parser.cc (working copy)
@@ -2863,19 +2863,18 @@
}
-Dart_Result Parser::CallLibraryTagHandler(Dart_LibraryTag tag,
+Dart_Handle Parser::CallLibraryTagHandler(Dart_LibraryTag tag,
intptr_t token_pos,
const String& url) {
Dart_LibraryTagHandler handler = Isolate::Current()->library_tag_handler();
if (handler == NULL) {
ErrorMsg(token_pos, "no library handler registered");
}
- Dart_Result result = handler(tag,
+ Dart_Handle result = handler(tag,
Api::NewLocalHandle(library_),
Api::NewLocalHandle(url));
- if (!Dart_IsValidResult(result)) {
- ErrorMsg(token_pos, "library handler failed: %s",
- Dart_GetErrorCString(result));
+ if (!Dart_IsValid(result)) {
+ ErrorMsg(token_pos, "library handler failed: %s", Dart_GetError(result));
}
return result;
}
@@ -2909,10 +2908,9 @@
}
ExpectToken(Token::kRPAREN);
ExpectToken(Token::kSEMICOLON);
- Dart_Result result = CallLibraryTagHandler(kCanonicalizeUrl,
+ Dart_Handle handle = CallLibraryTagHandler(kCanonicalizeUrl,
import_pos,
url);
- Dart_Handle handle = Dart_GetResult(result);
const String& canon_url = String::CheckedHandle(Api::UnwrapHandle(handle));
// Lookup the library URL.
Library& library = Library::Handle(Library::LookupLibrary(canon_url));
@@ -2951,10 +2949,9 @@
ConsumeToken();
ExpectToken(Token::kRPAREN);
ExpectToken(Token::kSEMICOLON);
- Dart_Result result = CallLibraryTagHandler(kCanonicalizeUrl,
+ Dart_Handle handle = CallLibraryTagHandler(kCanonicalizeUrl,
source_pos,
url);
- Dart_Handle handle = Dart_GetResult(result);
const String& canon_url = String::CheckedHandle(Api::UnwrapHandle(handle));
CallLibraryTagHandler(kSourceTag, source_pos, canon_url);
}
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698