Bug 1359269 - Part 2: Add codegen support for attributes on types in WebIDL; r=bzbarsky
☠☠ backed out by 0c70617150d9 ☠ ☠
authorManish Goregaokar <manishearth@gmail.com>
Sat, 02 Mar 2019 01:23:10 +0000
changeset 519942 c3f37539cb314566aef560602fecf68fe2de1602
parent 519941 bb694b612b1ba466b71f22aa1793f7d3149ec945
child 519943 7fd8a3c1f827da2987586dfee361c1dd528fd009
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1359269
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1359269 - Part 2: Add codegen support for attributes on types in WebIDL; r=bzbarsky Depends on D19733 Differential Revision: https://phabricator.services.mozilla.com/D19734
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -4645,16 +4645,22 @@ def getJSToNativeConversionInfo(type, de
     assert defaultValue is None or not isOptional
 
     # Also, we should not have a defaultValue if we know we're an object
     assert not isDefinitelyObject or defaultValue is None
 
     # And we can't both be an object and be null or undefined
     assert not isDefinitelyObject or not isNullOrUndefined
 
+    # Types can also have extended attributes, copy them over
+    isClamp = isClamp or type.clamp
+    isEnforceRange = isEnforceRange or type.enforceRange
+    if type.treatNullAsEmpty:
+        treatNullAs = "EmptyString"
+
     # If exceptionCode is not set, we'll just rethrow the exception we got.
     # Note that we can't just set failureCode to exceptionCode, because setting
     # failureCode will prevent pending exceptions from being set in cases when
     # they really should be!
     if exceptionCode is None:
         exceptionCode = "return false;\n"
 
     # Unfortunately, .capitalize() on a string will lowercase things inside the