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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp

Issue 2709983004: WIP bindings: Add support for the record<K,V> WebIDL type. (Closed)
Patch Set: Rebased patch using NativeValueTraits for IDL types Created 3 years, 10 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/V8Binding.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
index 0ccf6f2bea17d3dae699317ce7d50db252d5a6a6..d140278f9560be4fe6b5e8243c00a2c5c479f941 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
@@ -897,6 +897,30 @@ v8::Local<v8::Object> getEsIterator(v8::Isolate* isolate,
return iterator.As<v8::Object>();
}
+v8::MaybeLocal<v8::String> getStringValueInArray(v8::Local<v8::Context> context,
+ v8::Local<v8::Array> array,
+ uint32_t index) {
+ v8::Local<v8::Value> value;
+ if (!array->Get(context, index).ToLocal(&value))
+ return v8::MaybeLocal<v8::String>();
+ return value->ToString(context);
+}
+
+bool isPropertyEnumerable(v8::Isolate* isolate,
+ v8::Local<v8::Value> descriptor,
+ ExceptionState& exceptionState) {
+ if (descriptor->IsUndefined())
+ return false;
+ if (!descriptor->IsObject())
+ return false;
+ v8::Local<v8::Value> enumerable;
+ if (!v8::Local<v8::Object>::Cast(descriptor)
+ ->Get(isolate->GetCurrentContext(), v8String(isolate, "enumerable"))
+ .ToLocal(&enumerable))
+ return false;
+ return toBoolean(isolate, enumerable, exceptionState);
+}
+
bool addHiddenValueToArray(v8::Isolate* isolate,
v8::Local<v8::Object> object,
v8::Local<v8::Value> value,

Powered by Google App Engine
This is Rietveld 408576698