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

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

Issue 2279343002: IndexedDB: Avoid side effects for array key conversion w/ HasOwnProperty (Closed)
Patch Set: Created 4 years, 4 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 098a4180c05a7ff283381be8899540340aea9b0e..264029b612221e3ad8821e86929eb78530b73ea4 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