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

Unified Diff: src/api.cc

Issue 1154423004: Update all callsites of the TryCatch ctor to pass an Isolate (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « samples/shell.cc ('k') | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index c38c0547368b0ac9e8fe645b72d246698531567e..9464cdfaa33c54e29758178bb4af2e97831dee63 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -305,7 +305,7 @@ bool RunExtraCode(Isolate* isolate, const char* utf8_source) {
// Run custom script if provided.
base::ElapsedTimer timer;
timer.Start();
- TryCatch try_catch;
+ TryCatch try_catch(isolate);
Local<String> source_string = String::NewFromUtf8(isolate, utf8_source);
if (try_catch.HasCaught()) return false;
ScriptOrigin origin(String::NewFromUtf8(isolate, "<embedded script>"));
@@ -7473,11 +7473,12 @@ void Isolate::VisitHandlesForPartialDependence(
String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj)
: str_(NULL), length_(0) {
i::Isolate* isolate = i::Isolate::Current();
+ Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate);
if (obj.IsEmpty()) return;
ENTER_V8(isolate);
i::HandleScope scope(isolate);
- TryCatch try_catch;
- Handle<String> str = obj->ToString(reinterpret_cast<v8::Isolate*>(isolate));
+ TryCatch try_catch(v8_isolate);
+ Handle<String> str = obj->ToString(v8_isolate);
if (str.IsEmpty()) return;
i::Handle<i::String> i_str = Utils::OpenHandle(*str);
length_ = v8::Utf8Length(*i_str, isolate);
@@ -7494,11 +7495,12 @@ String::Utf8Value::~Utf8Value() {
String::Value::Value(v8::Handle<v8::Value> obj)
: str_(NULL), length_(0) {
i::Isolate* isolate = i::Isolate::Current();
+ Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate);
if (obj.IsEmpty()) return;
ENTER_V8(isolate);
i::HandleScope scope(isolate);
- TryCatch try_catch;
- Handle<String> str = obj->ToString(reinterpret_cast<v8::Isolate*>(isolate));
+ TryCatch try_catch(v8_isolate);
+ Handle<String> str = obj->ToString(v8_isolate);
if (str.IsEmpty()) return;
length_ = str->Length();
str_ = i::NewArray<uint16_t>(length_ + 1);
« no previous file with comments | « samples/shell.cc ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698