| Index: third_party/WebKit/Source/bindings/core/v8/ToV8.h
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8.h b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
|
| index 39ad5ddf5d831d4db8ed1707974769eb52a02703..3f4a97795b59ea2d00ceff072b9e83cefde0a52c 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/ToV8.h
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
|
| @@ -198,11 +198,15 @@ inline v8::Local<v8::Value> toV8(const Dictionary& value, v8::Local<v8::Object>
|
| template<typename Sequence>
|
| inline v8::Local<v8::Value> toV8SequenceInternal(const Sequence& sequence, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
|
| {
|
| - v8::Local<v8::Array> array = v8::Array::New(isolate, sequence.size());
|
| + v8::Local<v8::Array> array;
|
| + {
|
| + v8::Context::Scope contextScope(creationContext->CreationContext());
|
| + array = v8::Array::New(isolate, sequence.size());
|
| + }
|
| uint32_t index = 0;
|
| typename Sequence::const_iterator end = sequence.end();
|
| for (typename Sequence::const_iterator iter = sequence.begin(); iter != end; ++iter) {
|
| - v8::Local<v8::Value> value = toV8(*iter, creationContext, isolate);
|
| + v8::Local<v8::Value> value = toV8(*iter, array, isolate);
|
| if (value.IsEmpty())
|
| value = v8::Undefined(isolate);
|
| if (!v8CallBoolean(array->Set(isolate->GetCurrentContext(), v8::Integer::New(isolate, index++), value)))
|
| @@ -226,9 +230,13 @@ inline v8::Local<v8::Value> toV8(const HeapVector<T, inlineCapacity>& value, v8:
|
| template<typename T>
|
| inline v8::Local<v8::Value> toV8(const Vector<std::pair<String, T>>& value, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
|
| {
|
| - v8::Local<v8::Object> object = v8::Object::New(isolate);
|
| + v8::Local<v8::Object> object;
|
| + {
|
| + v8::Context::Scope contextScope(creationContext->CreationContext());
|
| + object = v8::Object::New(isolate);
|
| + }
|
| for (unsigned i = 0; i < value.size(); ++i) {
|
| - v8::Local<v8::Value> v8Value = toV8(value[i].second, creationContext, isolate);
|
| + v8::Local<v8::Value> v8Value = toV8(value[i].second, object, isolate);
|
| if (v8Value.IsEmpty())
|
| v8Value = v8::Undefined(isolate);
|
| if (!v8CallBoolean(object->Set(isolate->GetCurrentContext(), v8String(isolate, value[i].first), v8Value)))
|
|
|