mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Hoist 7fd65affab
as its own patch
This commit is contained in:
parent
9b4713f536
commit
a4f96761b2
2 changed files with 30 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
||||||
|
--- WebIDL.py
|
||||||
|
+++ WebIDL.py
|
||||||
|
@@ -3391,6 +3391,11 @@ class IDLValue(IDLObject):
|
||||||
|
# extra normalization step.
|
||||||
|
assert self.type.isDOMString()
|
||||||
|
return self
|
||||||
|
+ elif self.type.isString() and type.isByteString():
|
||||||
|
+ # Allow ByteStrings to use default value just like
|
||||||
|
+ # DOMString. No coercion is required here.
|
||||||
|
+ assert self.type.isDOMString()
|
||||||
|
+ return self
|
||||||
|
raise WebIDLError("Cannot coerce type %s to type %s." %
|
||||||
|
(self.type, type), [location])
|
||||||
|
|
||||||
|
@@ -5759,6 +5764,14 @@ class Parser(Tokenizer):
|
||||||
|
booleanType = BuiltinTypes[IDLBuiltinType.Types.boolean]
|
||||||
|
p[0] = IDLValue(location, booleanType, p[1])
|
||||||
|
|
||||||
|
+ def p_ConstValueByteString(self, p):
|
||||||
|
+ """
|
||||||
|
+ ConstValue : BYTESTRING
|
||||||
|
+ """
|
||||||
|
+ location = self.getLocation(p, 1)
|
||||||
|
+ bytestringType = BuiltinTypes[IDLBuiltinType.Types.bytestring]
|
||||||
|
+ p[0] = IDLValue(location, bytestringType, p[1])
|
||||||
|
+
|
||||||
|
def p_ConstValueInteger(self, p):
|
||||||
|
"""
|
||||||
|
ConstValue : INTEGER
|
|
@ -3,6 +3,7 @@ patch < abstract.patch
|
||||||
patch < debug.patch
|
patch < debug.patch
|
||||||
patch < pref-main-thread.patch
|
patch < pref-main-thread.patch
|
||||||
patch < callback-location.patch
|
patch < callback-location.patch
|
||||||
|
patch < bytestring.patch
|
||||||
|
|
||||||
wget https://hg.mozilla.org/mozilla-central/archive/tip.tar.gz/dom/bindings/parser/tests/ -O tests.tar.gz
|
wget https://hg.mozilla.org/mozilla-central/archive/tip.tar.gz/dom/bindings/parser/tests/ -O tests.tar.gz
|
||||||
rm -r tests
|
rm -r tests
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue