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

Unified Diff: src/d8.cc

Issue 669373002: pass isolate to Value::To* functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 6 years, 2 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 | « src/api.cc ('k') | src/d8-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 85d1048f30b81e927ba060cdc760643877e6cfcd..fb24bcce585c802450a500b8b5000c5aa445058b 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -186,7 +186,7 @@ ScriptCompiler::CachedData* CompileForCachedData(
int name_length = 0;
uint16_t* name_buffer = NULL;
if (name->IsString()) {
- Local<String> name_string = name->ToString();
+ Local<String> name_string = Local<String>::Cast(name);
name_length = name_string->Length();
name_buffer = new uint16_t[name_length];
name_string->Write(name_buffer, 0, name_length);
@@ -410,7 +410,7 @@ void Shell::RealmOwner(const v8::FunctionCallbackInfo<v8::Value>& args) {
Throw(args.GetIsolate(), "Invalid argument");
return;
}
- int index = data->RealmFind(args[0]->ToObject()->CreationContext());
+ int index = data->RealmFind(args[0]->ToObject(isolate)->CreationContext());
if (index == -1) return;
args.GetReturnValue().Set(index);
}
@@ -480,7 +480,7 @@ void Shell::RealmEval(const v8::FunctionCallbackInfo<v8::Value>& args) {
Throw(args.GetIsolate(), "Invalid argument");
return;
}
- ScriptCompiler::Source script_source(args[1]->ToString());
+ ScriptCompiler::Source script_source(args[1]->ToString(isolate));
Handle<UnboundScript> script = ScriptCompiler::CompileUnbound(
isolate, &script_source);
if (script.IsEmpty()) return;
@@ -526,7 +526,7 @@ void Shell::Write(const v8::FunctionCallbackInfo<v8::Value>& args) {
// Explicitly catch potential exceptions in toString().
v8::TryCatch try_catch;
- Handle<String> str_obj = args[i]->ToString();
+ Handle<String> str_obj = args[i]->ToString(args.GetIsolate());
if (try_catch.HasCaught()) {
try_catch.ReThrow();
return;
« no previous file with comments | « src/api.cc ('k') | src/d8-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698