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

Unified Diff: runtime/vm/object.cc

Issue 1154163004: Libraries have uris not urls. Scripts have uris not names. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger_test.cc ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 3314c72efe8a016b79b7350f1873ae1c91e2eb9d..53e17fa6b561f23238e05c528699197b5adc869c 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -8544,15 +8544,16 @@ RawLibrary* Script::FindLibrary() const {
void Script::PrintJSONImpl(JSONStream* stream, bool ref) const {
JSONObject jsobj(stream);
AddTypeProperties(&jsobj, "Script", JSONType(), ref);
- const String& name = String::Handle(url());
- ASSERT(!name.IsNull());
- const String& encoded_url = String::Handle(String::EncodeIRI(name));
- ASSERT(!encoded_url.IsNull());
+ const String& uri = String::Handle(url());
+ ASSERT(!uri.IsNull());
+ const String& encoded_uri = String::Handle(String::EncodeIRI(uri));
+ ASSERT(!encoded_uri.IsNull());
const Library& lib = Library::Handle(FindLibrary());
+ // TODO(rmacnak): This can fail for eval scripts. Use a ring-id for those.
intptr_t lib_index = (lib.IsNull()) ? -1 : lib.index();
jsobj.AddPropertyF("id", "libraries/%" Pd "/scripts/%s",
- lib_index, encoded_url.ToCString());
- jsobj.AddPropertyStr("name", name);
+ lib_index, encoded_uri.ToCString());
+ jsobj.AddPropertyStr("uri", uri);
jsobj.AddProperty("kind", GetKindAsCString());
if (ref) {
return;
@@ -9897,7 +9898,7 @@ void Library::PrintJSONImpl(JSONStream* stream, bool ref) const {
jsobj.AddPropertyF("id", "libraries/%" Pd "", id);
jsobj.AddProperty("name", library_name);
const String& library_url = String::Handle(url());
- jsobj.AddPropertyStr("url", library_url);
+ jsobj.AddPropertyStr("uri", library_url);
if (ref) {
return;
}
« no previous file with comments | « runtime/vm/debugger_test.cc ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698