зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1414359. Remove vestigial support for 'creator' operations from webidl; all setters are creators. r=qdot
MozReview-Commit-ID: AeRjWxk1YwE
This commit is contained in:
Родитель
8df99bf08a
Коммит
37836d94c0
|
@ -11398,7 +11398,7 @@ class CGProxySpecialOperation(CGPerSignatureCall):
|
|||
len(arguments), resultVar=resultVar,
|
||||
objectName="proxy")
|
||||
|
||||
if operation.isSetter() or operation.isCreator():
|
||||
if operation.isSetter():
|
||||
# arguments[0] is the index or name of the item that we're setting.
|
||||
argument = arguments[1]
|
||||
info = getJSToNativeConversionInfo(
|
||||
|
@ -11825,8 +11825,6 @@ class CGDOMJSProxyHandler_defineProperty(ClassMethod):
|
|||
|
||||
indexedSetter = self.descriptor.operations['IndexedSetter']
|
||||
if indexedSetter:
|
||||
if self.descriptor.operations['IndexedCreator'] is not indexedSetter:
|
||||
raise TypeError("Can't handle creator that's different from the setter")
|
||||
set += fill(
|
||||
"""
|
||||
uint32_t index = GetArrayIndexFromId(cx, id);
|
||||
|
@ -11857,8 +11855,6 @@ class CGDOMJSProxyHandler_defineProperty(ClassMethod):
|
|||
raise TypeError("Can't handle a named setter on an interface "
|
||||
"that has unforgeables. Figure out how that "
|
||||
"should work!")
|
||||
if self.descriptor.operations['NamedCreator'] is not namedSetter:
|
||||
raise TypeError("Can't handle creator that's different from the setter")
|
||||
# If we support indexed properties, we won't get down here for
|
||||
# indices, so we can just do our setter unconditionally here.
|
||||
set += fill(
|
||||
|
@ -12337,9 +12333,6 @@ class CGDOMJSProxyHandler_setCustom(ClassMethod):
|
|||
if self.descriptor.supportsIndexedProperties():
|
||||
raise ValueError("In interface " + self.descriptor.name + ": " +
|
||||
"Can't cope with [OverrideBuiltins] and an indexed getter")
|
||||
if self.descriptor.operations['NamedCreator'] is not namedSetter:
|
||||
raise ValueError("In interface " + self.descriptor.name + ": " +
|
||||
"Can't cope with named setter that is not also a named creator")
|
||||
if self.descriptor.hasUnforgeableMembers:
|
||||
raise ValueError("In interface " + self.descriptor.name + ": " +
|
||||
"Can't cope with [OverrideBuiltins] and unforgeable members")
|
||||
|
@ -12354,10 +12347,6 @@ class CGDOMJSProxyHandler_setCustom(ClassMethod):
|
|||
# ahead and call it and have done.
|
||||
indexedSetter = self.descriptor.operations['IndexedSetter']
|
||||
if indexedSetter is not None:
|
||||
if self.descriptor.operations['IndexedCreator'] is not indexedSetter:
|
||||
raise ValueError("In interface " + self.descriptor.name + ": " +
|
||||
"Can't cope with indexed setter that is not " +
|
||||
"also an indexed creator")
|
||||
setIndexed = fill(
|
||||
"""
|
||||
uint32_t index = GetArrayIndexFromId(cx, id);
|
||||
|
@ -15016,9 +15005,6 @@ class CGBindingImplClass(CGClass):
|
|||
def appendSpecialOperation(name, op):
|
||||
if op is None:
|
||||
return
|
||||
if name == "IndexedCreator" or name == "NamedCreator":
|
||||
# These are identical to the setters
|
||||
return
|
||||
assert len(op.signatures()) == 1
|
||||
returnType, args = op.signatures()[0]
|
||||
# Make a copy of the args, since we plan to modify them.
|
||||
|
|
|
@ -393,11 +393,9 @@ class Descriptor(DescriptorProvider):
|
|||
self.operations = {
|
||||
'IndexedGetter': None,
|
||||
'IndexedSetter': None,
|
||||
'IndexedCreator': None,
|
||||
'IndexedDeleter': None,
|
||||
'NamedGetter': None,
|
||||
'NamedSetter': None,
|
||||
'NamedCreator': None,
|
||||
'NamedDeleter': None,
|
||||
'Stringifier': None,
|
||||
'LegacyCaller': None,
|
||||
|
@ -454,8 +452,6 @@ class Descriptor(DescriptorProvider):
|
|||
addIndexedOrNamedOperation('Getter', m)
|
||||
if m.isSetter():
|
||||
addIndexedOrNamedOperation('Setter', m)
|
||||
if m.isCreator():
|
||||
addIndexedOrNamedOperation('Creator', m)
|
||||
if m.isDeleter():
|
||||
addIndexedOrNamedOperation('Deleter', m)
|
||||
if m.isLegacycaller() and iface != self.interface:
|
||||
|
@ -474,15 +470,13 @@ class Descriptor(DescriptorProvider):
|
|||
if self.proxy:
|
||||
if (not self.operations['IndexedGetter'] and
|
||||
(self.operations['IndexedSetter'] or
|
||||
self.operations['IndexedDeleter'] or
|
||||
self.operations['IndexedCreator'])):
|
||||
self.operations['IndexedDeleter'])):
|
||||
raise SyntaxError("%s supports indexed properties but does "
|
||||
"not have an indexed getter.\n%s" %
|
||||
(self.interface, self.interface.location))
|
||||
if (not self.operations['NamedGetter'] and
|
||||
(self.operations['NamedSetter'] or
|
||||
self.operations['NamedDeleter'] or
|
||||
self.operations['NamedCreator'])):
|
||||
self.operations['NamedDeleter'])):
|
||||
raise SyntaxError("%s supports named properties but does "
|
||||
"not have a named getter.\n%s" %
|
||||
(self.interface, self.interface.location))
|
||||
|
|
|
@ -1095,12 +1095,12 @@ class IDLInterfaceOrNamespace(IDLObjectWithScope, IDLExposureMixins):
|
|||
testInterface = testInterface.parent
|
||||
|
||||
# Ensure that there's at most one of each {named,indexed}
|
||||
# {getter,setter,creator,deleter}, at most one stringifier,
|
||||
# {getter,setter,deleter}, at most one stringifier,
|
||||
# and at most one legacycaller. Note that this last is not
|
||||
# quite per spec, but in practice no one overloads
|
||||
# legacycallers. Also note that in practice we disallow
|
||||
# indexed deleters, but it simplifies some other code to
|
||||
# treat deleter analogously to getter/setter/creator by
|
||||
# treat deleter analogously to getter/setter by
|
||||
# prefixing it with "named".
|
||||
specialMembersSeen = {}
|
||||
for member in self.members:
|
||||
|
@ -1111,8 +1111,6 @@ class IDLInterfaceOrNamespace(IDLObjectWithScope, IDLExposureMixins):
|
|||
memberType = "getters"
|
||||
elif member.isSetter():
|
||||
memberType = "setters"
|
||||
elif member.isCreator():
|
||||
memberType = "creators"
|
||||
elif member.isDeleter():
|
||||
memberType = "deleters"
|
||||
elif member.isStringifier():
|
||||
|
@ -1158,8 +1156,8 @@ class IDLInterfaceOrNamespace(IDLObjectWithScope, IDLExposureMixins):
|
|||
ancestor = ancestor.parent
|
||||
|
||||
if self._isOnGlobalProtoChain:
|
||||
# Make sure we have no named setters, creators, or deleters
|
||||
for memberType in ["setter", "creator", "deleter"]:
|
||||
# Make sure we have no named setters or deleters
|
||||
for memberType in ["setter", "deleter"]:
|
||||
memberId = "named " + memberType + "s"
|
||||
if memberId in specialMembersSeen:
|
||||
raise WebIDLError("Interface with [Global] has a named %s" %
|
||||
|
@ -4620,7 +4618,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
Special = enum(
|
||||
'Getter',
|
||||
'Setter',
|
||||
'Creator',
|
||||
'Deleter',
|
||||
'LegacyCaller',
|
||||
base=IDLInterfaceMember.Special
|
||||
|
@ -4633,7 +4630,7 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
)
|
||||
|
||||
def __init__(self, location, identifier, returnType, arguments,
|
||||
static=False, getter=False, setter=False, creator=False,
|
||||
static=False, getter=False, setter=False,
|
||||
deleter=False, specialType=NamedOrIndexed.Neither,
|
||||
legacycaller=False, stringifier=False, jsonifier=False,
|
||||
maplikeOrSetlikeOrIterable=None, htmlConstructor=False):
|
||||
|
@ -4654,8 +4651,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
self._getter = getter
|
||||
assert isinstance(setter, bool)
|
||||
self._setter = setter
|
||||
assert isinstance(creator, bool)
|
||||
self._creator = creator
|
||||
assert isinstance(deleter, bool)
|
||||
self._deleter = deleter
|
||||
assert isinstance(legacycaller, bool)
|
||||
|
@ -4696,7 +4691,7 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
assert not arguments[0].optional and not arguments[0].variadic
|
||||
assert not self._getter or not overload.returnType.isVoid()
|
||||
|
||||
if self._setter or self._creator:
|
||||
if self._setter:
|
||||
assert len(self._overloads) == 1
|
||||
arguments = self._overloads[0].arguments
|
||||
assert len(arguments) == 2
|
||||
|
@ -4729,9 +4724,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
def isSetter(self):
|
||||
return self._setter
|
||||
|
||||
def isCreator(self):
|
||||
return self._creator
|
||||
|
||||
def isDeleter(self):
|
||||
return self._deleter
|
||||
|
||||
|
@ -4764,7 +4756,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
def isSpecial(self):
|
||||
return (self.isGetter() or
|
||||
self.isSetter() or
|
||||
self.isCreator() or
|
||||
self.isDeleter() or
|
||||
self.isLegacycaller() or
|
||||
self.isStringifier() or
|
||||
|
@ -4820,8 +4811,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
assert not method.isGetter()
|
||||
assert not self.isSetter()
|
||||
assert not method.isSetter()
|
||||
assert not self.isCreator()
|
||||
assert not method.isCreator()
|
||||
assert not self.isDeleter()
|
||||
assert not method.isDeleter()
|
||||
assert not self.isStringifier()
|
||||
|
@ -5277,7 +5266,6 @@ class Tokenizer(object):
|
|||
"static": "STATIC",
|
||||
"getter": "GETTER",
|
||||
"setter": "SETTER",
|
||||
"creator": "CREATOR",
|
||||
"deleter": "DELETER",
|
||||
"legacycaller": "LEGACYCALLER",
|
||||
"optional": "OPTIONAL",
|
||||
|
@ -5992,13 +5980,12 @@ class Parser(Tokenizer):
|
|||
|
||||
getter = True if IDLMethod.Special.Getter in p[1] else False
|
||||
setter = True if IDLMethod.Special.Setter in p[1] else False
|
||||
creator = True if IDLMethod.Special.Creator in p[1] else False
|
||||
deleter = True if IDLMethod.Special.Deleter in p[1] else False
|
||||
legacycaller = True if IDLMethod.Special.LegacyCaller in p[1] else False
|
||||
|
||||
if getter or deleter:
|
||||
if setter or creator:
|
||||
raise WebIDLError("getter and deleter are incompatible with setter and creator",
|
||||
if setter:
|
||||
raise WebIDLError("getter and deleter are incompatible with setter",
|
||||
[self.getLocation(p, 1)])
|
||||
|
||||
(returnType, identifier, arguments) = p[2]
|
||||
|
@ -6033,10 +6020,9 @@ class Parser(Tokenizer):
|
|||
if returnType.isVoid():
|
||||
raise WebIDLError("getter cannot have void return type",
|
||||
[self.getLocation(p, 2)])
|
||||
if setter or creator:
|
||||
if setter:
|
||||
if len(arguments) != 2:
|
||||
raise WebIDLError("%s has wrong number of arguments" %
|
||||
("setter" if setter else "creator"),
|
||||
raise WebIDLError("setter has wrong number of arguments",
|
||||
[self.getLocation(p, 2)])
|
||||
argType = arguments[0].type
|
||||
if argType == BuiltinTypes[IDLBuiltinType.Types.domstring]:
|
||||
|
@ -6044,18 +6030,15 @@ class Parser(Tokenizer):
|
|||
elif argType == BuiltinTypes[IDLBuiltinType.Types.unsigned_long]:
|
||||
specialType = IDLMethod.NamedOrIndexed.Indexed
|
||||
else:
|
||||
raise WebIDLError("%s has wrong argument type (must be DOMString or UnsignedLong)" %
|
||||
("setter" if setter else "creator"),
|
||||
raise WebIDLError("settter has wrong argument type (must be DOMString or UnsignedLong)",
|
||||
[arguments[0].location])
|
||||
if arguments[0].optional or arguments[0].variadic:
|
||||
raise WebIDLError("%s cannot have %s argument" %
|
||||
("setter" if setter else "creator",
|
||||
"optional" if arguments[0].optional else "variadic"),
|
||||
raise WebIDLError("setter cannot have %s argument" %
|
||||
("optional" if arguments[0].optional else "variadic"),
|
||||
[arguments[0].location])
|
||||
if arguments[1].optional or arguments[1].variadic:
|
||||
raise WebIDLError("%s cannot have %s argument" %
|
||||
("setter" if setter else "creator",
|
||||
"optional" if arguments[1].optional else "variadic"),
|
||||
raise WebIDLError("setter cannot have %s argument" %
|
||||
("optional" if arguments[1].optional else "variadic"),
|
||||
[arguments[1].location])
|
||||
|
||||
if stringifier:
|
||||
|
@ -6068,7 +6051,7 @@ class Parser(Tokenizer):
|
|||
|
||||
# identifier might be None. This is only permitted for special methods.
|
||||
if not identifier:
|
||||
if (not getter and not setter and not creator and
|
||||
if (not getter and not setter and
|
||||
not deleter and not legacycaller and not stringifier):
|
||||
raise WebIDLError("Identifier required for non-special methods",
|
||||
[self.getLocation(p, 2)])
|
||||
|
@ -6076,19 +6059,18 @@ class Parser(Tokenizer):
|
|||
location = BuiltinLocation("<auto-generated-identifier>")
|
||||
identifier = IDLUnresolvedIdentifier(
|
||||
location,
|
||||
"__%s%s%s%s%s%s%s" %
|
||||
"__%s%s%s%s%s%s" %
|
||||
("named" if specialType == IDLMethod.NamedOrIndexed.Named else
|
||||
"indexed" if specialType == IDLMethod.NamedOrIndexed.Indexed else "",
|
||||
"getter" if getter else "",
|
||||
"setter" if setter else "",
|
||||
"deleter" if deleter else "",
|
||||
"creator" if creator else "",
|
||||
"legacycaller" if legacycaller else "",
|
||||
"stringifier" if stringifier else ""),
|
||||
allowDoubleUnderscore=True)
|
||||
|
||||
method = IDLMethod(self.getLocation(p, 2), identifier, returnType, arguments,
|
||||
static=static, getter=getter, setter=setter, creator=creator,
|
||||
static=static, getter=getter, setter=setter,
|
||||
deleter=deleter, specialType=specialType,
|
||||
legacycaller=legacycaller, stringifier=stringifier)
|
||||
p[0] = method
|
||||
|
@ -6164,12 +6146,6 @@ class Parser(Tokenizer):
|
|||
"""
|
||||
p[0] = IDLMethod.Special.Setter
|
||||
|
||||
def p_SpecialCreator(self, p):
|
||||
"""
|
||||
Special : CREATOR
|
||||
"""
|
||||
p[0] = IDLMethod.Special.Creator
|
||||
|
||||
def p_SpecialDeleter(self, p):
|
||||
"""
|
||||
Special : DELETER
|
||||
|
@ -6261,7 +6237,6 @@ class Parser(Tokenizer):
|
|||
| ATTRIBUTE
|
||||
| CALLBACK
|
||||
| CONST
|
||||
| CREATOR
|
||||
| DELETER
|
||||
| DICTIONARY
|
||||
| ENUM
|
||||
|
@ -6411,7 +6386,6 @@ class Parser(Tokenizer):
|
|||
| BYTE
|
||||
| LEGACYCALLER
|
||||
| CONST
|
||||
| CREATOR
|
||||
| DELETER
|
||||
| DOUBLE
|
||||
| EXCEPTION
|
||||
|
|
|
@ -101,21 +101,6 @@ def WebIDLTest(parser, harness):
|
|||
harness.ok(threw,
|
||||
"Should have thrown for [CEReactions] used on a named getter")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface Foo {
|
||||
[CEReactions] creator boolean (DOMString name, boolean value);
|
||||
};
|
||||
""")
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw,
|
||||
"Should have thrown for [CEReactions] used on a named creator")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
|
|
|
@ -11,7 +11,7 @@ def WebIDLTest(parser, harness):
|
|||
harness.check(argument.variadic, variadic, "Argument has the right variadic value")
|
||||
|
||||
def checkMethod(method, QName, name, signatures,
|
||||
static=True, getter=False, setter=False, creator=False,
|
||||
static=True, getter=False, setter=False,
|
||||
deleter=False, legacycaller=False, stringifier=False,
|
||||
chromeOnly=False, htmlConstructor=False):
|
||||
harness.ok(isinstance(method, WebIDL.IDLMethod),
|
||||
|
@ -24,7 +24,6 @@ def WebIDLTest(parser, harness):
|
|||
harness.check(method.isStatic(), static, "Method has the correct static value")
|
||||
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
||||
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
||||
harness.check(method.isCreator(), creator, "Method has the correct creator value")
|
||||
harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
|
||||
harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
|
||||
harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
|
||||
|
|
|
@ -27,20 +27,6 @@ def WebIDLTest(parser, harness):
|
|||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface DuplicateQualifiers3 {
|
||||
creator creator byte foo(unsigned long index, byte value);
|
||||
};
|
||||
""")
|
||||
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
|
@ -68,17 +54,3 @@ def WebIDLTest(parser, harness):
|
|||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
results = parser.parse("""
|
||||
interface DuplicateQualifiers6 {
|
||||
creator setter creator byte foo(unsigned long index, byte value);
|
||||
};
|
||||
""")
|
||||
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
|
|
@ -32,24 +32,6 @@ def WebIDLTest(parser, harness):
|
|||
"Should have thrown for [Global] used on an interface with a "
|
||||
"named setter")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
[Global]
|
||||
interface Foo {
|
||||
getter any(DOMString name);
|
||||
creator void(DOMString name, any arg);
|
||||
};
|
||||
""")
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw,
|
||||
"Should have thrown for [Global] used on an interface with a "
|
||||
"named creator")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
|
|
|
@ -41,7 +41,7 @@ def WebIDLTest(parser, harness):
|
|||
harness.check(argument.variadic, variadic, "Argument has the right variadic value")
|
||||
|
||||
def checkMethod(method, QName, name, signatures,
|
||||
static=False, getter=False, setter=False, creator=False,
|
||||
static=False, getter=False, setter=False,
|
||||
deleter=False, legacycaller=False, stringifier=False):
|
||||
harness.ok(isinstance(method, WebIDL.IDLMethod),
|
||||
"Should be an IDLMethod")
|
||||
|
@ -53,7 +53,6 @@ def WebIDLTest(parser, harness):
|
|||
harness.check(method.isStatic(), static, "Method has the correct static value")
|
||||
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
||||
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
||||
harness.check(method.isCreator(), creator, "Method has the correct creator value")
|
||||
harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
|
||||
harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
|
||||
harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
|
||||
|
|
|
@ -222,73 +222,3 @@ def WebIDLTest(parser, harness):
|
|||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface SpecialMethodSignatureMismatch20 {
|
||||
creator long long foo(long index, long long value);
|
||||
};
|
||||
""")
|
||||
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface SpecialMethodSignatureMismatch22 {
|
||||
creator boolean foo(unsigned long index, boolean value, long long extraArg);
|
||||
};
|
||||
""")
|
||||
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface SpecialMethodSignatureMismatch23 {
|
||||
creator boolean foo(unsigned long index, boolean... value);
|
||||
};
|
||||
""")
|
||||
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface SpecialMethodSignatureMismatch24 {
|
||||
creator boolean foo(unsigned long index, optional boolean value);
|
||||
};
|
||||
""")
|
||||
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface SpecialMethodSignatureMismatch25 {
|
||||
creator boolean foo();
|
||||
};
|
||||
""")
|
||||
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
|
|
@ -5,25 +5,21 @@ def WebIDLTest(parser, harness):
|
|||
interface SpecialMethods {
|
||||
getter long long (unsigned long index);
|
||||
setter long long (unsigned long index, long long value);
|
||||
creator long long (unsigned long index, long long value);
|
||||
getter boolean (DOMString name);
|
||||
setter boolean (DOMString name, boolean value);
|
||||
creator boolean (DOMString name, boolean value);
|
||||
deleter boolean (DOMString name);
|
||||
readonly attribute unsigned long length;
|
||||
};
|
||||
|
||||
interface SpecialMethodsCombination {
|
||||
setter creator long long (unsigned long index, long long value);
|
||||
getter deleter boolean (DOMString name);
|
||||
setter creator boolean (DOMString name, boolean value);
|
||||
};
|
||||
""")
|
||||
|
||||
results = parser.finish()
|
||||
|
||||
def checkMethod(method, QName, name,
|
||||
static=False, getter=False, setter=False, creator=False,
|
||||
static=False, getter=False, setter=False,
|
||||
deleter=False, legacycaller=False, stringifier=False):
|
||||
harness.ok(isinstance(method, WebIDL.IDLMethod),
|
||||
"Should be an IDLMethod")
|
||||
|
@ -32,7 +28,6 @@ def WebIDLTest(parser, harness):
|
|||
harness.check(method.isStatic(), static, "Method has the correct static value")
|
||||
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
||||
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
||||
harness.check(method.isCreator(), creator, "Method has the correct creator value")
|
||||
harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
|
||||
harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
|
||||
harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
|
||||
|
@ -40,32 +35,24 @@ def WebIDLTest(parser, harness):
|
|||
harness.check(len(results), 2, "Expect 2 interfaces")
|
||||
|
||||
iface = results[0]
|
||||
harness.check(len(iface.members), 8, "Expect 8 members")
|
||||
harness.check(len(iface.members), 6, "Expect 6 members")
|
||||
|
||||
checkMethod(iface.members[0], "::SpecialMethods::__indexedgetter", "__indexedgetter",
|
||||
getter=True)
|
||||
checkMethod(iface.members[1], "::SpecialMethods::__indexedsetter", "__indexedsetter",
|
||||
setter=True)
|
||||
checkMethod(iface.members[2], "::SpecialMethods::__indexedcreator", "__indexedcreator",
|
||||
creator=True)
|
||||
checkMethod(iface.members[3], "::SpecialMethods::__namedgetter", "__namedgetter",
|
||||
checkMethod(iface.members[2], "::SpecialMethods::__namedgetter", "__namedgetter",
|
||||
getter=True)
|
||||
checkMethod(iface.members[4], "::SpecialMethods::__namedsetter", "__namedsetter",
|
||||
checkMethod(iface.members[3], "::SpecialMethods::__namedsetter", "__namedsetter",
|
||||
setter=True)
|
||||
checkMethod(iface.members[5], "::SpecialMethods::__namedcreator", "__namedcreator",
|
||||
creator=True)
|
||||
checkMethod(iface.members[6], "::SpecialMethods::__nameddeleter", "__nameddeleter",
|
||||
checkMethod(iface.members[4], "::SpecialMethods::__nameddeleter", "__nameddeleter",
|
||||
deleter=True)
|
||||
|
||||
iface = results[1]
|
||||
harness.check(len(iface.members), 3, "Expect 3 members")
|
||||
harness.check(len(iface.members), 1, "Expect 1 member")
|
||||
|
||||
checkMethod(iface.members[0], "::SpecialMethodsCombination::__indexedsettercreator",
|
||||
"__indexedsettercreator", setter=True, creator=True)
|
||||
checkMethod(iface.members[1], "::SpecialMethodsCombination::__namedgetterdeleter",
|
||||
checkMethod(iface.members[0], "::SpecialMethodsCombination::__namedgetterdeleter",
|
||||
"__namedgetterdeleter", getter=True, deleter=True)
|
||||
checkMethod(iface.members[2], "::SpecialMethodsCombination::__namedsettercreator",
|
||||
"__namedsettercreator", setter=True, creator=True)
|
||||
|
||||
parser = parser.reset();
|
||||
|
||||
|
|
|
@ -31,27 +31,12 @@ def WebIDLTest(parser, harness):
|
|||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface SpecialMethodUniqueness1 {
|
||||
setter creator boolean (DOMString name);
|
||||
creator boolean (DOMString name);
|
||||
};
|
||||
""")
|
||||
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should have thrown.")
|
||||
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface SpecialMethodUniqueness1 {
|
||||
setter boolean (DOMString name);
|
||||
creator setter boolean (DOMString name);
|
||||
setter boolean (DOMString name);
|
||||
};
|
||||
""")
|
||||
|
||||
|
|
|
@ -1211,7 +1211,7 @@ interface TestNamedGetterInterface {
|
|||
interface TestIndexedGetterAndSetterAndNamedGetterInterface {
|
||||
getter DOMString (DOMString myName);
|
||||
getter long (unsigned long index);
|
||||
setter creator void (unsigned long index, long arg);
|
||||
setter void (unsigned long index, long arg);
|
||||
readonly attribute unsigned long length;
|
||||
};
|
||||
|
||||
|
@ -1222,29 +1222,29 @@ interface TestIndexedAndNamedGetterInterface {
|
|||
};
|
||||
|
||||
interface TestIndexedSetterInterface {
|
||||
setter creator void setItem(unsigned long idx, DOMString item);
|
||||
setter void setItem(unsigned long idx, DOMString item);
|
||||
getter DOMString (unsigned long idx);
|
||||
readonly attribute unsigned long length;
|
||||
};
|
||||
|
||||
interface TestNamedSetterInterface {
|
||||
setter creator void (DOMString myName, TestIndexedSetterInterface item);
|
||||
setter void (DOMString myName, TestIndexedSetterInterface item);
|
||||
getter TestIndexedSetterInterface (DOMString name);
|
||||
};
|
||||
|
||||
interface TestIndexedAndNamedSetterInterface {
|
||||
setter creator void (unsigned long index, TestIndexedSetterInterface item);
|
||||
setter void (unsigned long index, TestIndexedSetterInterface item);
|
||||
getter TestIndexedSetterInterface (unsigned long index);
|
||||
readonly attribute unsigned long length;
|
||||
setter creator void setNamedItem(DOMString name, TestIndexedSetterInterface item);
|
||||
setter void setNamedItem(DOMString name, TestIndexedSetterInterface item);
|
||||
getter TestIndexedSetterInterface (DOMString name);
|
||||
};
|
||||
|
||||
interface TestIndexedAndNamedGetterAndSetterInterface : TestIndexedSetterInterface {
|
||||
getter long item(unsigned long index);
|
||||
getter DOMString namedItem(DOMString name);
|
||||
setter creator void (unsigned long index, long item);
|
||||
setter creator void (DOMString name, DOMString item);
|
||||
setter void (unsigned long index, long item);
|
||||
setter void (DOMString name, DOMString item);
|
||||
stringifier DOMString ();
|
||||
readonly attribute unsigned long length;
|
||||
};
|
||||
|
@ -1310,8 +1310,8 @@ interface TestHTMLConstructorInterface {
|
|||
};
|
||||
|
||||
interface TestCEReactionsInterface {
|
||||
[CEReactions] setter creator void (unsigned long index, long item);
|
||||
[CEReactions] setter creator void (DOMString name, DOMString item);
|
||||
[CEReactions] setter void (unsigned long index, long item);
|
||||
[CEReactions] setter void (DOMString name, DOMString item);
|
||||
[CEReactions] deleter void (DOMString name);
|
||||
getter long item(unsigned long index);
|
||||
getter DOMString (DOMString name);
|
||||
|
|
|
@ -819,12 +819,12 @@ interface TestExampleInterface {
|
|||
|
||||
interface TestExampleProxyInterface {
|
||||
getter long longIndexedGetter(unsigned long ix);
|
||||
setter creator void longIndexedSetter(unsigned long y, long z);
|
||||
setter void longIndexedSetter(unsigned long y, long z);
|
||||
readonly attribute unsigned long length;
|
||||
stringifier DOMString myStringifier();
|
||||
getter short shortNameGetter(DOMString nom);
|
||||
deleter void (DOMString nomnom);
|
||||
setter creator void shortNamedSetter(DOMString me, short value);
|
||||
setter void shortNamedSetter(DOMString me, short value);
|
||||
};
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
interface DOMStringMap {
|
||||
getter DOMString (DOMString name);
|
||||
[CEReactions, Throws]
|
||||
setter creator void (DOMString name, DOMString value);
|
||||
setter void (DOMString name, DOMString value);
|
||||
[CEReactions]
|
||||
deleter void (DOMString name);
|
||||
};
|
||||
|
|
|
@ -14,7 +14,7 @@ interface HTMLOptionsCollection : HTMLCollection {
|
|||
[CEReactions]
|
||||
attribute unsigned long length;
|
||||
[CEReactions, Throws]
|
||||
setter creator void (unsigned long index, HTMLOptionElement? option);
|
||||
setter void (unsigned long index, HTMLOptionElement? option);
|
||||
[CEReactions, Throws]
|
||||
void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
|
||||
[CEReactions, Throws]
|
||||
|
|
|
@ -40,7 +40,7 @@ interface HTMLSelectElement : HTMLElement {
|
|||
[CEReactions]
|
||||
void remove(long index);
|
||||
[CEReactions, Throws]
|
||||
setter creator void (unsigned long index, HTMLOptionElement? option);
|
||||
setter void (unsigned long index, HTMLOptionElement? option);
|
||||
|
||||
readonly attribute HTMLCollection selectedOptions;
|
||||
[SetterThrows, Pure]
|
||||
|
|
|
@ -15,8 +15,8 @@ interface MozStorageAsyncStatementParams
|
|||
getter any(DOMString name);
|
||||
|
||||
[Throws]
|
||||
setter creator void(unsigned long index, any arg);
|
||||
setter void(unsigned long index, any arg);
|
||||
|
||||
[Throws]
|
||||
setter creator void(DOMString name, any arg);
|
||||
setter void(DOMString name, any arg);
|
||||
};
|
||||
|
|
|
@ -15,8 +15,8 @@ interface MozStorageStatementParams
|
|||
getter any(DOMString name);
|
||||
|
||||
[Throws]
|
||||
setter creator void(unsigned long index, any arg);
|
||||
setter void(unsigned long index, any arg);
|
||||
|
||||
[Throws]
|
||||
setter creator void(DOMString name, any arg);
|
||||
setter void(DOMString name, any arg);
|
||||
};
|
||||
|
|
|
@ -22,7 +22,7 @@ interface Storage {
|
|||
getter DOMString? getItem(DOMString key);
|
||||
|
||||
[Throws, NeedsSubjectPrincipal]
|
||||
setter creator void setItem(DOMString key, DOMString value);
|
||||
setter void setItem(DOMString key, DOMString value);
|
||||
|
||||
[Throws, NeedsSubjectPrincipal]
|
||||
deleter void removeItem(DOMString key);
|
||||
|
|
Загрузка…
Ссылка в новой задаче