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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h

Issue 2900743002: bindings: Do not skip symbols in the JS -> record<> conversion. (Closed)
Patch Set: Fix tests Created 3 years, 7 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
Index: third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h b/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h
index 5276efa7e34bd2d44d84d871e727a9a894c9b189..f693688c9afdce686f9df0c5aef3cf91b3cf6edd 100644
--- a/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h
+++ b/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h
@@ -430,13 +430,10 @@ struct NativeValueTraits<IDLRecord<K, V>>
// While we could pass v8::ONLY_ENUMERABLE below, doing so breaks
// web-platform-tests' headers-record.html and deviates from the spec
// algorithm.
- // Symbols are being skipped due to
- // https://github.com/heycam/webidl/issues/294.
if (!v8_object
->GetOwnPropertyNames(context,
static_cast<v8::PropertyFilter>(
- v8::PropertyFilter::ALL_PROPERTIES |
- v8::PropertyFilter::SKIP_SYMBOLS))
+ v8::PropertyFilter::ALL_PROPERTIES))
.ToLocal(&keys)) {
exception_state.RethrowV8Exception(block.Exception());
return ImplType();
@@ -464,11 +461,14 @@ struct NativeValueTraits<IDLRecord<K, V>>
return ImplType();
}
+ // V8's GetOwnPropertyNames() does not convert numeric property indices
+ // to strings, so we have to do it ourselves.
+ if (!key->IsName())
+ key = key->ToString(context).ToLocalChecked();
+
// "4.1. Let desc be ? O.[[GetOwnProperty]](key)."
v8::Local<v8::Value> desc;
- if (!v8_object
- ->GetOwnPropertyDescriptor(
- context, key->ToString(context).ToLocalChecked())
+ if (!v8_object->GetOwnPropertyDescriptor(context, key.As<v8::Name>())
.ToLocal(&desc)) {
exception_state.RethrowV8Exception(block.Exception());
return ImplType();

Powered by Google App Engine
This is Rietveld 408576698