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

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

Issue 2826673004: bindings: Make the sequence conversion code more compliant with WebIDL. (Closed)
Patch Set: Fix more test expectations 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.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
index f783f6ab25da629154318713a47ad392a43c46bb..0beb32ac29fe00354deffc1356f3121fcb0e17e3 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -829,6 +829,12 @@ inline bool ToV8Sequence(v8::Local<v8::Value> value,
length = sequence_length;
return true;
}
+// Validates that the passed object is a sequence type per the WebIDL spec: it
+// has a callable @iterator.
+// https://heycam.github.io/webidl/#es-sequence
+CORE_EXPORT bool HasCallableIteratorSymbol(v8::Isolate*,
+ v8::Local<v8::Value>,
+ ExceptionState&);
// TODO(rakuco): remove the specializations below (and consequently the
// non-IDLBase version of NativeValueTraitsBase) once we manage to convert all
@@ -895,7 +901,8 @@ struct NativeValueTraits<double> {
};
template <>
-struct NativeValueTraits<v8::Local<v8::Value>> {
+struct NativeValueTraits<v8::Local<v8::Value>>
+ : public NativeValueTraitsBase<v8::Local<v8::Value>> {
static inline v8::Local<v8::Value> NativeValue(
v8::Isolate* isolate,
v8::Local<v8::Value> value,
@@ -904,15 +911,6 @@ struct NativeValueTraits<v8::Local<v8::Value>> {
}
};
-template <>
-struct NativeValueTraits<ScriptValue> {
- static inline ScriptValue NativeValue(v8::Isolate* isolate,
- v8::Local<v8::Value> value,
- ExceptionState& exception_state) {
- return ScriptValue(ScriptState::Current(isolate), value);
- }
-};
-
template <typename T>
struct NativeValueTraits<Vector<T>> {
static inline Vector<T> NativeValue(v8::Isolate* isolate,

Powered by Google App Engine
This is Rietveld 408576698