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

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

Issue 2810843002: bindings: Make the sequence conversion code more complaint with WebIDL. (Closed)
Patch Set: Adjust even more tests Created 3 years, 8 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 516ea9297977d1458b01ed7d5cffd2e19ab9e409..ea4ff3ce628cfc898c29ad4efbb32e891f037095 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
@@ -904,6 +904,23 @@ v8::Local<v8::Object> GetEsIterator(v8::Isolate* isolate,
return iterator.As<v8::Object>();
}
+bool IsV8Sequence(v8::Isolate* isolate,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
+ if (!value->IsObject())
+ return false;
+ v8::TryCatch block(isolate);
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();
+ v8::Local<v8::Value> iterator_getter;
+ if (!value.As<v8::Object>()
+ ->Get(context, v8::Symbol::GetIterator(isolate))
+ .ToLocal(&iterator_getter)) {
+ exception_state.RethrowV8Exception(block.Exception());
+ return false;
+ }
+ return iterator_getter->IsFunction();
+}
+
bool AddHiddenValueToArray(v8::Isolate* isolate,
v8::Local<v8::Object> object,
v8::Local<v8::Value> value,
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8Binding.h ('k') | third_party/WebKit/Source/bindings/core/v8/V8BindingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698