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

Unified Diff: src/liveedit.cc

Issue 11419309: Fix gcmole offenders. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/liveedit.cc
diff --git a/src/liveedit.cc b/src/liveedit.cc
index ddb1371c4c651a41ce8a1f695665ef54144bd6d5..f491e372047f9e7eadb376a7eb9f1b41d40b27d6 100644
--- a/src/liveedit.cc
+++ b/src/liveedit.cc
@@ -938,7 +938,7 @@ JSArray* LiveEdit::GatherCompileInfo(Handle<Script> script,
}
// A logical 'catch' section.
- Handle<Object> rethrow_exception;
+ Handle<JSObject> rethrow_exception;
if (isolate->has_pending_exception()) {
Handle<Object> exception(isolate->pending_exception()->ToObjectChecked());
MessageLocation message_location = isolate->GetMessageLocation();
@@ -948,24 +948,25 @@ JSArray* LiveEdit::GatherCompileInfo(Handle<Script> script,
// If possible, copy positions from message object to exception object.
if (exception->IsJSObject() && !message_location.script().is_null()) {
- Handle<JSObject> exception_struct = Handle<JSObject>::cast(exception);
+ rethrow_exception = Handle<JSObject>::cast(exception);
Factory* factory = isolate->factory();
- JSReceiver::SetProperty(exception_struct,
- factory->LookupAsciiSymbol("startPosition"),
- Handle<Smi>(Smi::FromInt(message_location.start_pos())),
- NONE, kNonStrictMode);
- JSReceiver::SetProperty(exception_struct,
- factory->LookupAsciiSymbol("endPosition"),
- Handle<Smi>(Smi::FromInt(message_location.end_pos())),
- NONE, kNonStrictMode);
- JSReceiver::SetProperty(exception_struct,
- factory->LookupAsciiSymbol("scriptObject"),
- GetScriptWrapper(message_location.script()),
- NONE, kNonStrictMode);
+ Handle<String> start_pos_key =
+ factory->LookupAsciiSymbol("startPosition");
+ Handle<String> end_pos_key =
+ factory->LookupAsciiSymbol("endPosition");
+ Handle<String> script_obj_key =
+ factory->LookupAsciiSymbol("scriptObject");
+ Handle<Smi> start_pos(Smi::FromInt(message_location.start_pos()));
+ Handle<Smi> end_pos(Smi::FromInt(message_location.end_pos()));
+ Handle<JSValue> script_obj = GetScriptWrapper(message_location.script());
+ JSReceiver::SetProperty(
+ rethrow_exception, start_pos_key, start_pos, NONE, kNonStrictMode);
+ JSReceiver::SetProperty(
+ rethrow_exception, end_pos_key, end_pos, NONE, kNonStrictMode);
+ JSReceiver::SetProperty(
+ rethrow_exception, script_obj_key, script_obj, NONE, kNonStrictMode);
}
-
- rethrow_exception = exception;
}
// A logical 'finally' section.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698