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

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp

Issue 2332003002: IndexedDB: Avoid side effects for array key conversion w/ HasOwnProperty (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
index 268c0fe736103392fce6ce28fbd0db0b5f5fc7f8..4f41b5be783c15efc476a8ca31bcec2a4bc630d1 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
@@ -213,9 +213,12 @@ static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Local<v8::Value>
IDBKey::KeyArray subkeys;
uint32_t length = array->Length();
v8::TryCatch block(isolate);
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();
for (uint32_t i = 0; i < length; ++i) {
+ if (!v8CallBoolean(array->HasOwnProperty(context, i)))
+ return nullptr;
v8::Local<v8::Value> item;
- if (!v8Call(array->Get(isolate->GetCurrentContext(), i), item, block)) {
+ if (!v8Call(array->Get(context, i), item, block)) {
exceptionState.rethrowV8Exception(block.Exception());
return nullptr;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/indexeddb/bindings-edges.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698