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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 12517005: Add a command line option to generate source code for a script (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
Index: runtime/vm/debugger_api_impl.cc
===================================================================
--- runtime/vm/debugger_api_impl.cc (revision 19934)
+++ runtime/vm/debugger_api_impl.cc (working copy)
@@ -568,6 +568,30 @@
}
+DART_EXPORT Dart_Handle Dart_GenerateScriptSource(Dart_Handle library_url_in,
bakster 2013/03/14 08:42:16 How about a comment explaining this entry will Pre
siva 2013/03/14 09:38:46 Added the comment in the header file Added comment
+ Dart_Handle script_url_in) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ UNWRAP_AND_CHECK_PARAM(String, library_url, library_url_in);
+ UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
+
+ const Library& library = Library::Handle(Library::LookupLibrary(library_url));
+ if (library.IsNull()) {
+ return Api::NewError("%s: library '%s' not found",
+ CURRENT_FUNC, library_url.ToCString());
+ }
+
+ const Script& script = Script::Handle(library.LookupScript(script_url));
+ if (script.IsNull()) {
+ return Api::NewError("%s: script '%s' not found in library '%s'",
+ CURRENT_FUNC, script_url.ToCString(),
+ library_url.ToCString());
+ }
+
+ return Api::NewHandle(isolate, script.GenerateSource());
+}
+
+
DART_EXPORT Dart_Handle Dart_GetScriptSource(
Dart_Handle library_url_in,
Dart_Handle script_url_in) {

Powered by Google App Engine
This is Rietveld 408576698