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

Unified Diff: runtime/vm/object.cc

Issue 1174313002: Allow setting break-on-exceptions option over the service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/isolate.cc ('k') | runtime/vm/raw_object.h » ('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 fdcb170e59cf5bf6dbf4f104a25535e66cc38522..4a45437f71644ec831ef82f2803e7389758f21ff 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -2868,7 +2868,7 @@ static RawFunction* EvaluateHelper(const Class& cls,
Script& script = Script::Handle();
script = Script::New(Symbols::EvalSourceUri(),
func_src,
- RawScript::kSourceTag);
+ RawScript::kEvaluateTag);
// In order to tokenize the source, we need to get the key to mangle
// private names from the library from which the class originates.
const Library& lib = Library::Handle(cls.library());
@@ -6292,7 +6292,7 @@ RawFunction* Function::NewEvalFunction(const Class& owner,
0));
ASSERT(!script.IsNull());
result.set_is_debuggable(false);
- result.set_is_visible(false);
+ result.set_is_visible(true);
result.set_eval_script(script);
return result.raw();
}
@@ -8317,6 +8317,8 @@ const char* Script::GetKindAsCString() const {
return "source";
case RawScript::kPatchTag:
return "patch";
+ case RawScript::kEvaluateTag:
+ return "evaluate";
default:
UNIMPLEMENTED();
}
@@ -8592,16 +8594,22 @@ void Script::PrintJSONImpl(JSONStream* stream, bool ref) const {
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.AddFixedServiceId("libraries/%" Pd "/scripts/%s",
- lib_index, encoded_uri.ToCString());
+ if (lib.IsNull()) {
+ ASSERT(kind() == RawScript::kEvaluateTag);
+ jsobj.AddServiceId(*this);
+ } else {
+ ASSERT(kind() != RawScript::kEvaluateTag);
+ jsobj.AddFixedServiceId("libraries/%" Pd "/scripts/%s",
+ lib.index(), encoded_uri.ToCString());
+ }
jsobj.AddPropertyStr("uri", uri);
jsobj.AddProperty("_kind", GetKindAsCString());
if (ref) {
return;
}
- jsobj.AddProperty("library", lib);
+ if (!lib.IsNull()) {
+ jsobj.AddProperty("library", lib);
+ }
const String& source = String::Handle(Source());
jsobj.AddProperty("lineOffset", line_offset());
jsobj.AddProperty("columnOffset", col_offset());
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698