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

Unified Diff: third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl

Issue 2683853005: bindings: Make some value iterator properties aliases to Array.prototype functions (Closed)
Patch Set: Remove constexpr from Internals.h to fix the Android build 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/templates/interface_base.cpp.tmpl
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
index e0807a7bb7f1b50008603ed66e56f95cf9e9afc5..2851b6a677ff63f703dd716a5b6505d1f5547bf3 100644
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
@@ -514,6 +514,17 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo
{% if has_array_iterator and not is_partial %}
// Array iterator (@@iterator)
{%+ if is_global %}instanceTemplate{% else %}prototypeTemplate{% endif %}->SetIntrinsicDataProperty(v8::Symbol::GetIterator(isolate), v8::kArrayProto_values, v8::DontEnum);
+ {% if iterable %}
+ {% if is_global %}
+#error "iterable<V> on [Global] and [PrimaryGlobal] is currently unsupported."
+ {% endif %}
+ // For value iterators, the properties below must originally be set to the corresponding ones in %ArrayPrototype%.
+ // See https://heycam.github.io/webidl/#es-iterators.
+ prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "entries"), v8::kArrayProto_entries);
+ prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "forEach"), v8::kArrayProto_forEach);
+ prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "keys"), v8::kArrayProto_keys);
+ prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "values"), v8::kArrayProto_values);
+ {% endif %}
{% endif %}
{% if iterator_method %}

Powered by Google App Engine
This is Rietveld 408576698