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

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

Issue 2656973002: binding: Sets location[Symbol.toPrimitive]. (Closed)
Patch Set: Added a layout test. Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/location-toprimitive.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0a768e60cb5c0eaf7cfdd1fc6e05c63eb76d6550..4b49ba394c7a821a1770788fd7d5611a6f7e0c42 100644
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
@@ -528,6 +528,17 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo
{% endfilter %}
{% endif %}
+ {% if interface_name == 'Location' %}
+ // Symbol.toPrimitive
+ // Prevent author scripts to inject Symbol.toPrimitive property into location
+ // objects, also prevent the look-up of Symbol.toPrimitive through the
+ // prototype chain.
+ instanceTemplate->Set(v8::Symbol::GetToPrimitive(isolate),
+ v8::Undefined(isolate),
+ static_cast<v8::PropertyAttribute>(
+ v8::ReadOnly | v8::DontEnum | v8::DontDelete));
+ {% endif %}
+
{% if legacy_caller and not is_partial %}
instanceTemplate->SetCallAsFunctionHandler({{cpp_class_or_partial}}V8Internal::{{legacy_caller.name}}MethodCallback);
{% elif has_custom_legacy_call_as_function and not is_partial %}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/location-toprimitive.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698