Commit 5e177bd6 authored by jochen@chromium.org's avatar jochen@chromium.org

Add versions with an Isolate parameter for inlined API methods that need one

We shouldn't have APIs that call Isolate::GetCurrent() internally. This
change removes all remaining occurrences of inlined methods in v8.h

BUG=none
R=svenpanne@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/85693002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18058 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5201e8c3
......@@ -1524,6 +1524,8 @@ class V8_EXPORT Primitive : public Value { };
class V8_EXPORT Boolean : public Primitive {
public:
bool Value() const;
V8_INLINE static Handle<Boolean> New(Isolate* isolate, bool value);
// Will be deprecated soon.
V8_INLINE static Handle<Boolean> New(bool value);
};
......@@ -3094,6 +3096,8 @@ class V8_EXPORT Template : public Data {
/** Adds a property to each instance created by this template.*/
void Set(Handle<String> name, Handle<Data> value,
PropertyAttribute attributes = None);
V8_INLINE void Set(Isolate* isolate, const char* name, Handle<Data> value);
// Will be deprecated soon.
V8_INLINE void Set(const char* name, Handle<Data> value);
void SetAccessorProperty(
......@@ -6031,14 +6035,23 @@ Handle<Boolean> ScriptOrigin::ResourceIsSharedCrossOrigin() const {
}
Handle<Boolean> Boolean::New(bool value) {
Isolate* isolate = Isolate::GetCurrent();
Handle<Boolean> Boolean::New(Isolate* isolate, bool value) {
return value ? True(isolate) : False(isolate);
}
Handle<Boolean> Boolean::New(bool value) {
return Boolean::New(Isolate::GetCurrent(), value);
}
void Template::Set(Isolate* isolate, const char* name, v8::Handle<Data> value) {
Set(v8::String::NewFromUtf8(isolate, name), value);
}
void Template::Set(const char* name, v8::Handle<Data> value) {
Set(v8::String::NewFromUtf8(Isolate::GetCurrent(), name), value);
Set(Isolate::GetCurrent(), name, value);
}
......
......@@ -3137,7 +3137,7 @@ void Debugger::NotifyMessageHandler(v8::DebugEvent event,
v8::Local<v8::Function> fun =
v8::Local<v8::Function>::Cast(api_exec_state->Get(fun_name));
v8::Handle<v8::Boolean> running = v8::Boolean::New(auto_continue);
v8::Handle<v8::Boolean> running = v8::Boolean::New(isolate, auto_continue);
static const int kArgc = 1;
v8::Handle<Value> argv[kArgc] = { running };
cmd_processor = v8::Local<v8::Object>::Cast(
......
......@@ -1631,7 +1631,7 @@ THREADED_TEST(PrimitiveAndWrappedBooleans) {
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
Local<Value> primitive_false = Boolean::New(false);
Local<Value> primitive_false = Boolean::New(env->GetIsolate(), false);
CHECK(primitive_false->IsBoolean());
CHECK(!primitive_false->IsBooleanObject());
CHECK(!primitive_false->BooleanValue());
......@@ -1654,7 +1654,7 @@ THREADED_TEST(PrimitiveAndWrappedBooleans) {
CHECK(!false_boolean_object->IsTrue());
CHECK(!false_boolean_object->IsFalse());
Local<Value> primitive_true = Boolean::New(true);
Local<Value> primitive_true = Boolean::New(env->GetIsolate(), true);
CHECK(primitive_true->IsBoolean());
CHECK(!primitive_true->IsBooleanObject());
CHECK(primitive_true->BooleanValue());
......@@ -2625,7 +2625,7 @@ THREADED_TEST(EmbedderData) {
CheckEmbedderData(&env, 2, v8::String::NewFromUtf8(env->GetIsolate(),
"over the lazy dog."));
CheckEmbedderData(&env, 1, v8::Number::New(1.2345));
CheckEmbedderData(&env, 0, v8::Boolean::New(true));
CheckEmbedderData(&env, 0, v8::Boolean::New(env->GetIsolate(), true));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment