@@ -2093,7 +2093,7 @@ class IDLType(IDLObject):
2093
2093
'utf8string' ,
2094
2094
'jsstring' ,
2095
2095
'object' ,
2096
- 'void ' ,
2096
+ 'undefined ' ,
2097
2097
# Funny stuff
2098
2098
'interface' ,
2099
2099
'dictionary' ,
@@ -2168,8 +2168,8 @@ def isUTF8String(self):
2168
2168
def isJSString (self ):
2169
2169
return False
2170
2170
2171
- def isVoid (self ):
2172
- return self .name == "Void "
2171
+ def isUndefined (self ):
2172
+ return self .name == "Undefined "
2173
2173
2174
2174
def isSequence (self ):
2175
2175
return False
@@ -2355,7 +2355,7 @@ def _getDependentObjects(self):
2355
2355
2356
2356
class IDLNullableType (IDLParametrizedType ):
2357
2357
def __init__ (self , location , innerType ):
2358
- assert not innerType .isVoid ()
2358
+ assert not innerType .isUndefined ()
2359
2359
assert not innerType == BuiltinTypes [IDLBuiltinType .Types .any ]
2360
2360
2361
2361
IDLParametrizedType .__init__ (self , location , None , innerType )
@@ -2414,7 +2414,7 @@ def isUnrestricted(self):
2414
2414
def isInteger (self ):
2415
2415
return self .inner .isInteger ()
2416
2416
2417
- def isVoid (self ):
2417
+ def isUndefined (self ):
2418
2418
return False
2419
2419
2420
2420
def isSequence (self ):
@@ -2517,7 +2517,7 @@ def withExtendedAttributes(self, attrs):
2517
2517
2518
2518
class IDLSequenceType (IDLParametrizedType ):
2519
2519
def __init__ (self , location , parameterType ):
2520
- assert not parameterType .isVoid ()
2520
+ assert not parameterType .isUndefined ()
2521
2521
2522
2522
IDLParametrizedType .__init__ (self , location , parameterType .name , parameterType )
2523
2523
# Need to set self.name up front if our inner type is already complete,
@@ -2561,7 +2561,7 @@ def isUTF8String(self):
2561
2561
def isJSString (self ):
2562
2562
return False
2563
2563
2564
- def isVoid (self ):
2564
+ def isUndefined (self ):
2565
2565
return False
2566
2566
2567
2567
def isSequence (self ):
@@ -2602,7 +2602,7 @@ class IDLRecordType(IDLParametrizedType):
2602
2602
def __init__ (self , location , keyType , valueType ):
2603
2603
assert keyType .isString ()
2604
2604
assert keyType .isComplete ()
2605
- assert not valueType .isVoid ()
2605
+ assert not valueType .isUndefined ()
2606
2606
2607
2607
IDLParametrizedType .__init__ (self , location , valueType .name , valueType )
2608
2608
self .keyType = keyType
@@ -2673,7 +2673,7 @@ def __hash__(self):
2673
2673
def prettyName (self ):
2674
2674
return "(" + " or " .join (m .prettyName () for m in self .memberTypes ) + ")"
2675
2675
2676
- def isVoid (self ):
2676
+ def isUndefined (self ):
2677
2677
return False
2678
2678
2679
2679
def isUnion (self ):
@@ -2836,8 +2836,8 @@ def isUTF8String(self):
2836
2836
def isJSString (self ):
2837
2837
return self .inner .isJSString ()
2838
2838
2839
- def isVoid (self ):
2840
- return self .inner .isVoid ()
2839
+ def isUndefined (self ):
2840
+ return self .inner .isUndefined ()
2841
2841
2842
2842
def isJSONType (self ):
2843
2843
return self .inner .isJSONType ()
@@ -2972,7 +2972,7 @@ def isUTF8String(self):
2972
2972
def isJSString (self ):
2973
2973
return False
2974
2974
2975
- def isVoid (self ):
2975
+ def isUndefined (self ):
2976
2976
return False
2977
2977
2978
2978
def isSequence (self ):
@@ -3178,7 +3178,7 @@ class IDLBuiltinType(IDLType):
3178
3178
'utf8string' ,
3179
3179
'jsstring' ,
3180
3180
'object' ,
3181
- 'void ' ,
3181
+ 'undefined ' ,
3182
3182
# Funny stuff
3183
3183
'ArrayBuffer' ,
3184
3184
'ArrayBufferView' ,
@@ -3215,7 +3215,7 @@ class IDLBuiltinType(IDLType):
3215
3215
Types .utf8string : IDLType .Tags .utf8string ,
3216
3216
Types .jsstring : IDLType .Tags .jsstring ,
3217
3217
Types .object : IDLType .Tags .object ,
3218
- Types .void : IDLType .Tags .void ,
3218
+ Types .undefined : IDLType .Tags .undefined ,
3219
3219
Types .ArrayBuffer : IDLType .Tags .interface ,
3220
3220
Types .ArrayBufferView : IDLType .Tags .interface ,
3221
3221
Types .Int8Array : IDLType .Tags .interface ,
@@ -3251,7 +3251,7 @@ class IDLBuiltinType(IDLType):
3251
3251
Types .utf8string : "USVString" , # That's what it is in spec terms
3252
3252
Types .jsstring : "USVString" , # Again, that's what it is in spec terms
3253
3253
Types .object : "object" ,
3254
- Types .void : "void " ,
3254
+ Types .undefined : "undefined " ,
3255
3255
Types .ArrayBuffer : "ArrayBuffer" ,
3256
3256
Types .ArrayBufferView : "ArrayBufferView" ,
3257
3257
Types .Int8Array : "Int8Array" ,
@@ -3456,8 +3456,8 @@ def isDistinguishableFrom(self, other):
3456
3456
return False
3457
3457
if self .isObject ():
3458
3458
return other .isPrimitive () or other .isString () or other .isEnum ()
3459
- if self .isVoid ():
3460
- return not other .isVoid ()
3459
+ if self .isUndefined ():
3460
+ return not other .isUndefined ()
3461
3461
# Not much else we could be!
3462
3462
assert self .isSpiderMonkeyInterface ()
3463
3463
# Like interfaces, but we know we're not a callback
@@ -3591,9 +3591,9 @@ def withExtendedAttributes(self, attrs):
3591
3591
IDLBuiltinType .Types .object :
3592
3592
IDLBuiltinType (BuiltinLocation ("<builtin type>" ), "Object" ,
3593
3593
IDLBuiltinType .Types .object ),
3594
- IDLBuiltinType .Types .void :
3595
- IDLBuiltinType (BuiltinLocation ("<builtin type>" ), "Void " ,
3596
- IDLBuiltinType .Types .void ),
3594
+ IDLBuiltinType .Types .undefined :
3595
+ IDLBuiltinType (BuiltinLocation ("<builtin type>" ), "Undefined " ,
3596
+ IDLBuiltinType .Types .undefined ),
3597
3597
IDLBuiltinType .Types .ArrayBuffer :
3598
3598
IDLBuiltinType (BuiltinLocation ("<builtin type>" ), "ArrayBuffer" ,
3599
3599
IDLBuiltinType .Types .ArrayBuffer ),
@@ -4196,9 +4196,9 @@ def expand(self, members, isJSImplemented):
4196
4196
self .addMethod ("values" , members , False , self .iteratorType ,
4197
4197
affectsNothing = True , newObject = True )
4198
4198
4199
- # void forEach(callback(valueType, keyType), optional any thisArg)
4199
+ # undefined forEach(callback(valueType, keyType), optional any thisArg)
4200
4200
self .addMethod ("forEach" , members , False ,
4201
- BuiltinTypes [IDLBuiltinType .Types .void ],
4201
+ BuiltinTypes [IDLBuiltinType .Types .undefined ],
4202
4202
self .getForEachArguments ())
4203
4203
4204
4204
def isValueIterator (self ):
@@ -4256,8 +4256,8 @@ def expand(self, members, isJSImplemented):
4256
4256
self .addMethod ("values" , members , False , BuiltinTypes [IDLBuiltinType .Types .object ],
4257
4257
affectsNothing = True , isIteratorAlias = self .isSetlike ())
4258
4258
4259
- # void forEach(callback(valueType, keyType), thisVal)
4260
- self .addMethod ("forEach" , members , False , BuiltinTypes [IDLBuiltinType .Types .void ],
4259
+ # undefined forEach(callback(valueType, keyType), thisVal)
4260
+ self .addMethod ("forEach" , members , False , BuiltinTypes [IDLBuiltinType .Types .undefined ],
4261
4261
self .getForEachArguments ())
4262
4262
4263
4263
def getKeyArg ():
@@ -4270,8 +4270,8 @@ def getKeyArg():
4270
4270
[getKeyArg ()], isPure = True )
4271
4271
4272
4272
if not self .readonly :
4273
- # void clear()
4274
- self .addMethod ("clear" , members , True , BuiltinTypes [IDLBuiltinType .Types .void ],
4273
+ # undefined clear()
4274
+ self .addMethod ("clear" , members , True , BuiltinTypes [IDLBuiltinType .Types .undefined ],
4275
4275
[])
4276
4276
# boolean delete(keyType key)
4277
4277
self .addMethod ("delete" , members , True ,
@@ -4280,8 +4280,8 @@ def getKeyArg():
4280
4280
# Always generate underscored functions (e.g. __add, __clear) for js
4281
4281
# implemented interfaces as convenience functions.
4282
4282
if isJSImplemented :
4283
- # void clear()
4284
- self .addMethod ("clear" , members , True , BuiltinTypes [IDLBuiltinType .Types .void ],
4283
+ # undefined clear()
4284
+ self .addMethod ("clear" , members , True , BuiltinTypes [IDLBuiltinType .Types .undefined ],
4285
4285
[], chromeOnly = True )
4286
4286
# boolean delete(keyType key)
4287
4287
self .addMethod ("delete" , members , True ,
@@ -5119,7 +5119,7 @@ def assertSignatureConstraints(self):
5119
5119
assert (arguments [0 ].type == BuiltinTypes [IDLBuiltinType .Types .domstring ] or
5120
5120
arguments [0 ].type == BuiltinTypes [IDLBuiltinType .Types .unsigned_long ])
5121
5121
assert not arguments [0 ].optional and not arguments [0 ].variadic
5122
- assert not self ._getter or not overload .returnType .isVoid ()
5122
+ assert not self ._getter or not overload .returnType .isUndefined ()
5123
5123
5124
5124
if self ._setter :
5125
5125
assert len (self ._overloads ) == 1
@@ -5480,8 +5480,8 @@ def handleExtendedAttribute(self, attr):
5480
5480
# This is called before we've done overload resolution
5481
5481
overloads = self ._overloads
5482
5482
assert len (overloads ) == 1
5483
- if not overloads [0 ].returnType .isVoid ():
5484
- raise WebIDLError ("[LenientFloat] used on a non-void method" ,
5483
+ if not overloads [0 ].returnType .isUndefined ():
5484
+ raise WebIDLError ("[LenientFloat] used on a non-undefined returning method" ,
5485
5485
[attr .location , self .location ])
5486
5486
if not overloads [0 ].includesRestrictedFloatArgument ():
5487
5487
raise WebIDLError ("[LenientFloat] used on an operation with no "
@@ -5837,7 +5837,7 @@ def t_OTHER(self, t):
5837
5837
"record" : "RECORD" ,
5838
5838
"short" : "SHORT" ,
5839
5839
"unsigned" : "UNSIGNED" ,
5840
- "void " : "VOID " ,
5840
+ "undefined " : "UNDEFINED " ,
5841
5841
":" : "COLON" ,
5842
5842
";" : "SEMICOLON" ,
5843
5843
"{" : "LBRACE" ,
@@ -6722,8 +6722,8 @@ def p_Operation(self, p):
6722
6722
"optional" if arguments [0 ].optional else "variadic" ),
6723
6723
[arguments [0 ].location ])
6724
6724
if getter :
6725
- if returnType .isVoid ():
6726
- raise WebIDLError ("getter cannot have void return type" ,
6725
+ if returnType .isUndefined ():
6726
+ raise WebIDLError ("getter cannot have undefined return type" ,
6727
6727
[self .getLocation (p , 2 )])
6728
6728
if setter :
6729
6729
if len (arguments ) != 2 :
@@ -7103,7 +7103,7 @@ def p_Other(self, p):
7103
7103
| SYMBOL
7104
7104
| TRUE
7105
7105
| UNSIGNED
7106
- | VOID
7106
+ | UNDEFINED
7107
7107
| ArgumentNameKeyword
7108
7108
"""
7109
7109
pass
@@ -7145,7 +7145,7 @@ def p_SingleTypeAnyType(self, p):
7145
7145
"""
7146
7146
p [0 ] = BuiltinTypes [IDLBuiltinType .Types .any ]
7147
7147
7148
- # Note: Promise<void > is allowed, so we want to parametrize on ReturnType,
7148
+ # Note: Promise<undefined > is allowed, so we want to parametrize on ReturnType,
7149
7149
# not Type. Promise types can't be null, hence no "Null" in there.
7150
7150
def p_SingleTypePromiseType (self , p ):
7151
7151
"""
@@ -7413,11 +7413,11 @@ def p_ReturnTypeType(self, p):
7413
7413
"""
7414
7414
p [0 ] = p [1 ]
7415
7415
7416
- def p_ReturnTypeVoid (self , p ):
7416
+ def p_ReturnTypeUndefined (self , p ):
7417
7417
"""
7418
- ReturnType : VOID
7418
+ ReturnType : UNDEFINED
7419
7419
"""
7420
- p [0 ] = BuiltinTypes [IDLBuiltinType .Types .void ]
7420
+ p [0 ] = BuiltinTypes [IDLBuiltinType .Types .undefined ]
7421
7421
7422
7422
def p_ScopedName (self , p ):
7423
7423
"""
0 commit comments