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

Unified Diff: src/api.cc

Issue 83323003: Remove usage of deprecated APIs from v8 itself (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/allocation-tracker.cc ('k') | src/debug.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 adc3e7afa00805d5e418ee10705eefba3724ff53..18aca94a48c73dd88bd37c99e6b4242a9db80f74 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3401,13 +3401,14 @@ Local<Array> v8::Object::GetOwnPropertyNames() {
Local<String> v8::Object::ObjectProtoToString() {
- i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
- ON_BAILOUT(isolate, "v8::Object::ObjectProtoToString()",
+ i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate();
+ Isolate* isolate = reinterpret_cast<Isolate*>(i_isolate);
+ ON_BAILOUT(i_isolate, "v8::Object::ObjectProtoToString()",
return Local<v8::String>());
- ENTER_V8(isolate);
+ ENTER_V8(i_isolate);
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
- i::Handle<i::Object> name(self->class_name(), isolate);
+ i::Handle<i::Object> name(self->class_name(), i_isolate);
// Native implementation of Object.prototype.toString (v8natives.js):
// var c = %_ClassOf(this);
@@ -3415,13 +3416,11 @@ Local<String> v8::Object::ObjectProtoToString() {
// return "[object " + c + "]";
if (!name->IsString()) {
- return v8::String::New("[object ]");
-
+ return v8::String::NewFromUtf8(isolate, "[object ]");
} else {
i::Handle<i::String> class_name = i::Handle<i::String>::cast(name);
if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Arguments"))) {
- return v8::String::New("[object Object]");
-
+ return v8::String::NewFromUtf8(isolate, "[object Object]");
} else {
const char* prefix = "[object ";
Local<String> str = Utils::ToLocal(class_name);
@@ -3447,7 +3446,8 @@ Local<String> v8::Object::ObjectProtoToString() {
i::OS::MemCopy(ptr, postfix, postfix_len * v8::internal::kCharSize);
// Copy the buffer into a heap-allocated string and return it.
- Local<String> result = v8::String::New(buf.start(), buf_len);
+ Local<String> result = v8::String::NewFromUtf8(
+ isolate, buf.start(), String::kNormalString, buf_len);
return result;
}
}
« no previous file with comments | « src/allocation-tracker.cc ('k') | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698