Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
9,901 | [
0.030399367213249207,
0.055276140570640564,
0.009909289889037609,
0.013831586576998234,
0.008566295728087425,
-0.026583757251501083,
-0.041268836706876755,
-0.023508677259087563,
0.016166137531399727,
-0.036047473549842834,
0.04611365497112274,
-0.03037426434457302,
0.021588319912552834,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def definition_body(self):
unforgeable = CopyUnforgeablePropertiesToInstance(self.descriptor)
if not self.descriptor.isGlobal():
create = CreateBindingJSObject(self.descriptor, "scope")
return CGGeneric("""\
let scope = scope.reflector().get_jsobject();
assert!(!scope.get().is_nu... | |
9,902 | [
0.008784137666225433,
-0.01622200571000576,
-0.013240182772278786,
-0.016778316348791122,
0.009779932908713818,
0.01636664569377899,
-0.05847932770848274,
-0.07285438477993011,
0.008472604677081108,
0.02434413507580757,
-0.005301636178046465,
-0.07267636060714722,
0.06911598145961761,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class PropertyArrays():
def __init__(self, descriptor):
self.static_methods = MethodDefiner(descriptor, "StaticMethods",
static=True, unforgeable=False)
self.static_attrs = AttrDefiner(descriptor, "StaticAttributes",
... | |
9,903 | [
0.002741810167208314,
0.030246373265981674,
-0.011506517417728901,
-0.0002489390899427235,
0.03481850028038025,
-0.003449610434472561,
-0.029824329540133476,
-0.014748037792742252,
-0.009783177636563778,
0.016295526176691055,
0.01376327220350504,
-0.05688193812966347,
0.04684670642018318,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def define(self):
interface = self.descriptor.interface
name = self.descriptor.name
if (interface.getUserData("hasConcreteDescendant", False) or
interface.getUserData("hasProxyDescendant", False)):
depth = self.descriptor.prototypeDepth
check = "class.inte... | |
9,904 | [
0.022905131801962852,
0.016861630603671074,
0.018156666308641434,
0.004669978283345699,
0.009431525133550167,
-0.009869744069874287,
-0.02710418775677681,
-0.02495887689292431,
0.041938237845897675,
0.00860087014734745,
0.05849900096654892,
-0.028019869700074196,
0.0415981262922287,
-0.052... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def definition_body(self):
name = self.descriptor.interface.identifier.name
if self.descriptor.interface.isCallback():
assert not self.descriptor.interface.ctor() and self.descriptor.interface.hasConstants()
return CGGeneric("""\
rooted!(in(cx) let mut interface = ptr::null_mut()... | |
9,905 | [
0.02368653565645218,
0.0030440897680819035,
0.03239627182483673,
-0.025685086846351624,
0.01892455480992794,
0.02208275906741619,
-0.014224257320165634,
-0.026721373200416565,
0.03066912852227688,
0.0531960092484951,
0.023427464067935944,
-0.05021052062511444,
0.05487380549311638,
-0.05438... | 6 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}], "kwarg"... | def __init__(self, descriptor):
self.static_methods = MethodDefiner(descriptor, "StaticMethods",
static=True, unforgeable=False)
self.static_attrs = AttrDefiner(descriptor, "StaticAttributes",
static=True, unforgeable=Fa... | |
9,906 | [
-0.008483202196657658,
0.025000790134072304,
0.017021814361214638,
0.030962858349084854,
0.02488997019827366,
0.010350503958761692,
0.009214608930051327,
0.03136180713772774,
0.043817874044179916,
0.04898204281926155,
0.03395497426390648,
-0.07220973074436188,
0.04078143090009689,
0.009192... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}], "kwarg"... | def __init__(self, descriptor):
assert descriptor.interface.hasInterfaceObject()
args = [
Argument('*mut JSContext', 'cx'),
Argument('HandleObject', 'global'),
]
CGAbstractMethod.__init__(self, descriptor, 'DefineDOMInterface',
'v... | |
9,907 | [
0.05665700137615204,
0.025240229442715645,
0.036362651735544205,
0.027956979349255562,
-0.002586136804893613,
-0.008521770127117634,
-0.024311427026987076,
-0.03873109817504883,
0.02661021612584591,
0.014257131144404411,
0.01546457502990961,
-0.023579994216561317,
0.023324573412537575,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def definition_body(self):
customDefineProperty = 'proxyhandler::define_property'
if self.descriptor.operations['IndexedSetter'] or self.descriptor.operations['NamedSetter']:
customDefineProperty = 'defineProperty'
customDelete = 'proxyhandler::delete'
if self.descriptor.ope... | |
9,908 | [
0.04991373047232628,
0.03389890119433403,
0.008872569538652897,
0.024262215942144394,
-0.01865449920296669,
-0.02907424233853817,
-0.03619755804538727,
0.0043163001537323,
0.03149920329451561,
-0.021660437807440758,
0.0030548793729394674,
-0.031650763005018234,
0.04688253253698349,
-0.0292... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def definition_body(self):
if self.descriptor.interface.isCallback():
function = "GetConstructorObject"
else:
function = "GetProtoObject"
return CGGeneric("""\
assert!(!global.get().is_null());
if !ConstructorEnabled(cx, global) {
return;
}
rooted!(in(cx) let mut pr... | |
9,909 | [
0.013498480431735516,
0.043415091931819916,
0.019743654876947403,
0.02528182789683342,
-0.02365834452211857,
-0.027494478970766068,
0.01865696907043457,
-0.014781556092202663,
0.0027543576434254646,
0.039120715111494064,
-0.0046937004663050175,
-0.05451762676239014,
0.04349364712834358,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "errorResult", "annotation": null, "type_comment": null}}, {"_type... | def __init__(self, errorResult, arguments, argsPre, returnType,
extendedAttributes, descriptorProvider, nativeMethodName,
static, object="this"):
CGThing.__init__(self)
assert errorResult is None or isinstance(errorResult, str)
isFallible = errorResult is not ... | |
9,910 | [
0.01465222891420126,
0.017469491809606552,
0.0369073785841465,
-0.00038041509105823934,
-0.04059811308979988,
-0.03348729386925697,
-0.003915257751941681,
-0.022710340097546577,
0.016042405739426613,
0.04015522450208664,
-0.010106470435857773,
-0.04241887852549553,
0.04630645737051964,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expression", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, expression, cases, default=None):
CGList.__init__(self, [CGIndenter(c) for c in cases], "\n")
self.prepend(CGWrapper(CGGeneric(expression),
pre="match ", post=" {"))
if default is not None:
self.append(
CGIndenter(
... | |
9,911 | [
0.016979694366455078,
0.036589499562978745,
0.017907969653606415,
0.010746071115136147,
-0.027435678988695145,
-0.036331646144390106,
-0.00037086676456965506,
-0.025114992633461952,
0.01905542053282261,
0.050771478563547134,
0.01060425117611885,
-0.027564605697989464,
0.02200784906744957,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "returnType", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, returnType, argsPre, arguments, nativeMethodName, static,
descriptor, idlNode, argConversionStartsAt=0,
getter=False, setter=False):
CGThing.__init__(self)
self.returnType = returnType
self.descriptor = descriptor
self.idlNode = idlNod... | |
9,912 | [
0.021757790818810463,
0.007861344143748283,
0.012181483209133148,
0.006391841918230057,
-0.027675073593854904,
-0.03547750413417816,
0.001483411411754787,
-0.03288542106747627,
0.0221767146140337,
0.03422073647379875,
-0.004195771645754576,
-0.026627765968441963,
0.039692915976047516,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expression", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, expression, body, fallThrough=False):
CGList.__init__(self, [], "\n")
self.append(CGWrapper(CGGeneric(expression), post=" => {"))
bodyList = CGList([body], "\n")
if fallThrough:
raise TypeError("fall through required but unsupported")
# bodyList... | |
9,913 | [
0.0709434524178505,
0.04071721062064171,
0.034766051918268204,
0.024251557886600494,
-0.014348641969263554,
-0.030884863808751106,
0.01020282506942749,
-0.004236965905874968,
0.01123780943453312,
0.00959712453186512,
0.0018318040529266,
-0.009009065106511116,
-0.006521575152873993,
-0.0087... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def definition_body(self):
nativeName = CGSpecializedMethod.makeNativeName(self.descriptor,
self.method)
return CGWrapper(CGMethodCall([], nativeName, self.method.isStatic(),
self.descriptor, self.method),
... | |
9,914 | [
0.0024493648670613766,
0.04528395086526871,
-0.0007467486429959536,
0.003175970632582903,
0.03459581360220909,
-0.0194777250289917,
0.0076235015876591206,
0.0015132739208638668,
0.03752567619085312,
0.0016861357726156712,
0.023813920095562935,
-0.06281624734401703,
0.06483199447393417,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, descriptor, attr):
self.attr = attr
name = 'get_' + descriptor.internalNameFor(attr.identifier.name)
args = [Argument('*mut JSContext', 'cx'),
Argument('HandleObject', '_obj'),
Argument('*const %s' % descriptor.concreteType, 'this'),
... | |
9,915 | [
0.06556286662817001,
0.0037606526166200638,
0.011672346852719784,
0.017233282327651978,
0.03172541782259941,
-0.0014955545775592327,
0.0042381067760288715,
-0.021816840395331383,
0.0003658140485640615,
0.005824939347803593,
0.0026962109841406345,
0.001855049398727715,
0.022502128034830093,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "attr", "annotation": null, "type_comment": null}}], "kwarg"... | def makeNativeName(descriptor, attr):
name = attr.identifier.name
nativeName = descriptor.binaryNameFor(name)
if nativeName == name:
nativeName = descriptor.internalNameFor(name)
nativeName = MakeNativeName(nativeName)
infallible = ('infallible' in
... | |
9,916 | [
0.044087592512369156,
0.03529880940914154,
0.018511520698666573,
0.008692990988492966,
-0.02871321141719818,
-0.01268027164041996,
0.03177850693464279,
-0.0340774804353714,
0.0451173409819603,
-0.008058378472924232,
-0.005223577376455069,
0.0006514504202641547,
0.013494490645825863,
-0.031... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def generate_code(self):
nativeName = CGSpecializedSetter.makeNativeName(self.descriptor,
self.attr)
checkForArg = CGGeneric(
"let args = CallArgs::from_vp(vp, argc);\n"
"if argc == 0 {\n"
" throw_type_error(c... | |
9,917 | [
0.010113098658621311,
0.030921848490834236,
-0.003751633455976844,
-0.0003997761523351073,
0.04024267569184303,
-0.007421709597110748,
0.02840522490441799,
-0.0037953248247504234,
0.05000624433159828,
0.009577151387929916,
0.031504400074481964,
-0.07060527801513672,
0.06459333747625351,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, descriptor, attr):
self.attr = attr
name = 'set_' + descriptor.internalNameFor(attr.identifier.name)
args = [Argument('*mut JSContext', 'cx'),
Argument('HandleObject', 'obj'),
Argument('*const %s' % descriptor.concreteType, 'this'),
... | |
9,918 | [
0.05885820835828781,
0.030735287815332413,
-0.010289523750543594,
0.032467979937791824,
0.014914478175342083,
-0.014341357164084911,
-0.0361466184258461,
-0.041744545102119446,
0.03342762589454651,
-0.005531285423785448,
0.015314330346882343,
-0.02748315967619419,
0.020818959921598434,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def definition_body(self):
attrName = self.attr.identifier.name
forwardToAttrName = self.attr.getExtendedAttribute("PutForwards")[0]
# JS_GetProperty and JS_SetProperty can only deal with ASCII
assert all(ord(c) < 128 for c in attrName)
assert all(ord(c) < 128 for c in forwardToA... | |
9,919 | [
0.016166413202881813,
0.034603606909513474,
-0.010547520592808723,
-0.004289970267564058,
-0.009934667497873306,
0.0003792027127929032,
-0.03437136858701706,
-0.040951475501060486,
-0.002375611336901784,
0.022552985697984695,
0.05475679039955139,
0.005593088921159506,
0.038190409541130066,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def define(self):
if self.member.isAttr():
internalMemberName = self.descriptor.internalNameFor(self.member.identifier.name)
getterinfo = ("%s_getterinfo" % internalMemberName)
getter = ("get_%s" % internalMemberName)
getterinfal = "infallible" in self.descriptor.... | |
9,920 | [
-0.06322477012872696,
-0.00034964142832905054,
-0.04859274998307228,
-0.003593086265027523,
-0.007677293382585049,
0.006277316249907017,
-0.033847831189632416,
-0.010409506969153881,
0.051483023911714554,
0.023799609392881393,
0.0021521823946386576,
-0.007519231177866459,
0.02531248703598976... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "t", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def getJSReturnTypeTag(t):
if t.nullable():
# Sometimes it might return null, sometimes not
return "JSVAL_TYPE_UNKNOWN"
if t.isVoid():
# No return, every time
return "JSVAL_TYPE_UNDEFINED"
if t.isArray():
# No idea yet
asser... | |
9,921 | [
-0.036751940846443176,
0.02540658600628376,
-0.0019561429508030415,
-0.03138589486479759,
-0.04481196030974388,
0.022756416350603104,
-0.03230578824877739,
-0.010814225301146507,
0.010578776709735394,
0.02015005052089691,
-0.010332376696169376,
-0.006833495572209358,
0.06785310804843903,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "existingType", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "t", "annotation": null, "type_comment": null}}], "kwarg":... | def getSingleReturnType(existingType, t):
type = CGMemberJITInfo.getJSReturnTypeTag(t)
if existingType == "":
# First element of the list; just return its type
return type
if type == existingType:
return existingType
if ((type == "JSVAL_TYPE_DOUBLE" a... | |
9,922 | [
-0.04477430507540703,
-0.01287534274160862,
-0.03658388555049896,
-0.025532275438308716,
-0.0012974992860108614,
-0.007786361034959555,
-0.030271798372268677,
-0.017385534942150116,
0.027978481724858284,
0.048356249928474426,
-0.013159277848899364,
-0.006028150673955679,
0.03512052819132805,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "t", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def getJSArgType(t):
assert not t.isVoid()
if t.nullable():
# Sometimes it might return null, sometimes not
return "JSJitInfo_ArgType::Null as i32 | %s" % CGMemberJITInfo.getJSArgType(t.inner)
if t.isArray():
# No idea yet
assert False
if t... | |
9,923 | [
-0.03102189116179943,
0.017360875383019447,
0.00827542319893837,
-0.060817793011665344,
-0.045142654329538345,
0.010776659473776817,
0.0011185777839273214,
-0.0290734451264143,
-0.002419138327240944,
0.020228812471032143,
-0.02248375490307808,
-0.01679166592657566,
0.11025140434503555,
-0.... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "existingType", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "t", "annotation": null, "type_comment": null}}], "kwarg":... | def getSingleArgType(existingType, t):
type = CGMemberJITInfo.getJSArgType(t)
if existingType == "":
# First element of the list; just return its type
return type
if type == existingType:
return existingType
return "%s | %s" % (existingType, type) | |
9,924 | [
0.037480536848306656,
-0.019395748153328896,
-0.021501880139112473,
-0.012926916591823101,
0.04115552082657814,
0.00025755781098268926,
-0.010707957670092583,
-0.01697799563407898,
0.04070420563220978,
0.06271112710237503,
-0.0005500387051142752,
-0.017149925231933594,
0.010584383271634579,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def getEnumValueName(value):
# Some enum values can be empty strings. Others might have weird
# characters in them. Deal with the former by returning "_empty",
# deal with possible name collisions from that by throwing if the
# enum value is actually "_empty", and throw on any value
# containing n... | |
9,925 | [
-0.010783502832055092,
0.032536644488573074,
-0.03730173408985138,
-0.015771958976984024,
-0.007265524473041296,
-0.028689824044704437,
-0.005056705791503191,
0.005925342440605164,
0.0370783731341362,
0.03350455313920975,
0.005568580701947212,
0.027175914496183395,
0.04157046228647232,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "isTypedMethod", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly... | def jitInfoInitializer(isTypedMethod):
initializer = fill(
"""
JSJitInfo {
call: ${opName} as *const os::raw::c_void,
protoID: PrototypeList::ID::${name} as u16,
depth: ${depth},
_bitfield_1:
... | |
9,926 | [
0.024135801941156387,
0.050346739590168,
0.012784316204488277,
0.009480157867074013,
0.024728696793317795,
0.014587707817554474,
-0.017379259690642357,
-0.03671013563871384,
0.01582290790975094,
0.02692735381424427,
0.01546469982713461,
-0.029224824160337448,
0.045751795172691345,
-0.02549... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "enum", "annotation": null, "type_comment": null}}], "kwarg": null... | def __init__(self, enum):
CGThing.__init__(self)
decl = """\
#[repr(usize)]
#[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf, Debug)]
pub enum %s {
%s
}
""" % (enum.identifier.name, ",\n ".join(map(getEnumValueName, enum.values())))
inner = """\
use dom::bindings::conversions::T... | |
9,927 | [
0.020905667915940285,
0.0554475337266922,
0.022247906774282455,
-0.008201911114156246,
0.020347392186522484,
0.009526332840323448,
-0.025561930611729622,
-0.03349658101797104,
0.0156792514026165,
0.029838088899850845,
0.017009612172842026,
-0.02425532601773739,
0.054592300206422806,
-0.012... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "enum", "annotation": n... | class CGEnum(CGThing):
def __init__(self, enum):
CGThing.__init__(self)
decl = """\
#[repr(usize)]
#[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf, Debug)]
pub enum %s {
%s
}
""" % (enum.identifier.name, ",\n ".join(map(getEnumValueName, enum.values())))
inner = """\
use do... | |
9,928 | [
0.023139940574765205,
0.044178497046232224,
0.012867883779108524,
0.010228793136775494,
0.00029994931537657976,
-0.0356740728020668,
-0.022249942645430565,
-0.053745970129966736,
0.022892719134688377,
0.018071897327899933,
0.012478508986532688,
-0.004094607662409544,
0.03221297264099121,
-... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "constants", "annotatio... | class CGConstant(CGThing):
def __init__(self, constants):
CGThing.__init__(self)
self.constants = constants
def define(self):
def stringDecl(const):
name = const.identifier.name
value = convertConstIDLValueToRust(const.value)
return CGGeneric("pub con... | |
9,929 | [
0.009923640638589859,
0.0009253894095309079,
-0.07435797899961472,
-0.001205172622576356,
0.013063156045973301,
-0.029731307178735733,
-0.024165352806448936,
-0.03949648514389992,
0.07297144085168839,
-0.012974021025002003,
0.027968425303697586,
-0.003874874673783779,
0.04003129154443741,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def convertConstIDLValueToRust(value):
tag = value.type.tag()
if tag in [IDLType.Tags.int8, IDLType.Tags.uint8,
IDLType.Tags.int16, IDLType.Tags.uint16,
IDLType.Tags.int32, IDLType.Tags.uint32,
IDLType.Tags.int64, IDLType.Tags.uint64,
IDLType.Tags.unre... | |
9,930 | [
-0.04462158679962158,
-0.0038749699015170336,
0.016545884311199188,
-0.02809947356581688,
-0.013467303477227688,
0.014335011132061481,
0.04055643081665039,
-0.003491633106023073,
0.046380773186683655,
-0.00379473646171391,
0.009461582638323307,
-0.04386085644364357,
0.08681834489107132,
-0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "type", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptorProvider", "annotation": null, "type_comment": null}}],... | def getUnionTypeTemplateVars(type, descriptorProvider):
# For dictionaries and sequences we need to pass None as the failureCode
# for getJSToNativeConversionInfo.
# Also, for dictionaries we would need to handle conversion of
# null/undefined to the dictionary correctly.
if type.isDictionary():
... | |
9,931 | [
-0.028987936675548553,
0.02234731987118721,
0.022771188989281654,
-0.0005423463881015778,
0.002207651501521468,
0.003888410283252597,
0.020793134346604347,
-0.014223163016140461,
0.04587205499410629,
-0.011126563884317875,
0.00013015946024097502,
-0.036405645310878754,
0.06932614743709564,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "type", "annotation": n... | class CGUnionStruct(CGThing):
def __init__(self, type, descriptorProvider):
assert not type.nullable()
assert not type.hasNullableType
CGThing.__init__(self)
self.type = type
self.descriptorProvider = descriptorProvider
def define(self):
templateVars = map(lambd... | |
9,932 | [
-0.054539863020181656,
0.010754251852631569,
0.040017563849687576,
-0.019046461209654808,
-0.005642701406031847,
-0.00452103465795517,
0.009585718624293804,
-0.02179594896733761,
0.042792048305273056,
-0.0011076066875830293,
0.027069969102740288,
-0.030269375070929527,
0.044941648840904236,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "type", "annotation": n... | class CGUnionConversionStruct(CGThing):
def __init__(self, type, descriptorProvider):
assert not type.nullable()
assert not type.hasNullableType
CGThing.__init__(self)
self.type = type
self.descriptorProvider = descriptorProvider
def from_jsval(self):
memberType... | |
9,933 | [
-0.013508513569831848,
0.011688928119838238,
0.01963268779218197,
-0.030809303745627403,
0.02170548401772976,
-0.003924770746380091,
-0.017171241343021393,
-0.0006146255764178932,
0.051160406321287155,
0.01368517242372036,
-0.001493503456003964,
-0.03330608457326889,
0.07099330425262451,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def define(self):
templateVars = map(lambda t: getUnionTypeTemplateVars(t, self.descriptorProvider),
self.type.flatMemberTypes)
enumValues = [
" %s(%s)," % (v["name"], v["typeName"]) for v in templateVars
]
enumConversions = [
" ... | |
9,934 | [
-0.041924070566892624,
-0.004391130059957504,
0.03897528350353241,
-0.023603124544024467,
-0.015961917117238045,
-0.010602816008031368,
0.0005200444138608873,
-0.025333935394883156,
0.04466772824525833,
0.01241696160286665,
0.023090291768312454,
-0.032616157084703445,
0.05202687531709671,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def from_jsval(self):
memberTypes = self.type.flatMemberTypes
names = []
conversions = []
def get_name(memberType):
if self.type.isGeckoInterface():
return memberType.inner.identifier.name
return memberType.name
def get_match(name):
... | |
9,935 | [
-0.03521330654621124,
0.018729686737060547,
-0.00590527942404151,
-0.00341900996863842,
-0.016758140176534653,
-0.019016683101654053,
-0.012159946374595165,
0.031045610085129738,
0.057649001479148865,
0.015098548494279385,
0.011835514567792416,
-0.028175637125968933,
0.029323626309633255,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "t", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def try_method(self, t):
templateVars = getUnionTypeTemplateVars(t, self.descriptorProvider)
returnType = "Result<Option<%s>, ()>" % templateVars["typeName"]
jsConversion = templateVars["jsConversion"]
return CGWrapper(
CGIndenter(jsConversion, 4),
pre="unsafe fn... | |
9,936 | [
0.04523114114999771,
0.02322712540626526,
0.021836135536432266,
-0.004730563145130873,
0.0013070504646748304,
0.021332502365112305,
-0.030697697773575783,
-0.031944792717695236,
-0.023898636922240257,
0.0272442065179348,
0.006319408770650625,
-0.01582850143313408,
0.03669334203004837,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "declaring", "annotation": null, "type_comment": null}}], "kwarg":... | def getDecorators(self, declaring):
decorators = []
if self.inline:
decorators.append('inline')
if declaring:
if self.static:
decorators.append('static')
if self.virtual:
decorators.append('virtual')
if decorators:
... | |
9,937 | [
-0.0072123208083212376,
0.04667665809392929,
0.0646519809961319,
0.000011353529771440662,
-0.004197940230369568,
-0.05488760769367218,
-0.03999447450041771,
-0.03999447450041771,
0.030599964782595634,
0.020009566098451614,
0.032449278980493546,
-0.00723697803914547,
0.02889859676361084,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def define(self):
from_jsval = self.from_jsval()
methods = CGIndenter(CGList([
self.try_method(t) for t in self.type.flatMemberTypes
], "\n\n"))
return """
%s
impl %s {
%s
}
""" % (from_jsval.define(), self.type, methods.define()) | |
9,938 | [
0.05154234915971756,
0.02733379229903221,
0.0025092035066336393,
-0.00905116368085146,
-0.004835100378841162,
0.03161295875906944,
-0.031060034409165382,
-0.032069724053144455,
-0.012921647168695927,
0.02035009302198887,
0.027189550921320915,
-0.0025287363678216934,
0.030891751870512962,
-... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "declaring", "annotation": null, "type_comment": null}}], "kwarg":... | def getDecorators(self, declaring):
decorators = []
if self.explicit:
decorators.append('explicit')
if self.inline and declaring:
decorators.append('inline')
if decorators:
return ' '.join(decorators) + ' '
return '' | |
9,939 | [
0.04902255907654762,
0.07493380457162857,
-0.0030461137648671865,
-0.017630087211728096,
-0.01262342743575573,
0.005095641128718853,
-0.014414910227060318,
-0.020868992432951927,
-0.008554033003747463,
0.03350428491830826,
0.013833568431437016,
-0.017867369577288628,
0.023479100316762924,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cgClass", "annotation": null, "type_comment": null}}], "kwarg": n... | def declare(self, cgClass):
templateClause = '<%s>' % ', '.join(self.templateArgs) \
if self.bodyInHeader and self.templateArgs else ''
args = ', '.join([a.declare() for a in self.args])
if self.bodyInHeader:
body = CGIndenter(CGGeneric(self.getBody())).defin... | |
9,940 | [
0.05045553669333458,
0.05035606771707535,
0.03175540640950203,
0.0005991439684294164,
-0.04150334745645523,
-0.021982599049806595,
-0.02971629612147808,
-0.02824913151562214,
0.03526167944073677,
0.04389059543609619,
-0.012669835239648819,
-0.015231155790388584,
0.021447954699397087,
-0.03... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cgClass", "annotation": null, "type_comment": null}}], "kwarg": n... | def getInitializationList(self, cgClass):
items = [str(c) for c in self.baseConstructors]
for m in cgClass.members:
if not m.static:
initialize = m.body
if initialize:
items.append(m.name + "(" + initialize + ")")
if len(items) > 0... | |
9,941 | [
0.07556058466434479,
0.08359117805957794,
0.037519559264183044,
0.017990615218877792,
-0.012573876418173313,
-0.03173127397894859,
0.004986529238522053,
0.0005182079621590674,
0.032435256987810135,
-0.013571182265877724,
0.005638363305479288,
-0.013121416792273521,
0.008389102295041084,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cgClass", "annotation": null, "type_comment": null}}], "kwarg": n... | def getBody(self, cgClass):
initializers = [" parent: %s" % str(self.baseConstructors[0])]
return (self.body + (
"let mut ret = Rc::new(%s {\n"
"%s\n"
"});\n"
"// Note: callback cannot be moved after calling init.\n"
"mat... | |
9,942 | [
0.07992429286241531,
0.05307658389210701,
0.0029572939965873957,
-0.01641089841723442,
-0.027871156111359596,
-0.01096638385206461,
-0.028799401596188545,
-0.03843887150287628,
0.017838967964053154,
0.04474617913365364,
-0.009936983697116375,
-0.030965307727456093,
0.009038490243256092,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cgClass", "annotation": null, "type_comment": null}}], "kwarg": n... | def define(self, cgClass):
if self.bodyInHeader:
return ''
args = ', '.join([a.define() for a in self.args])
body = ' ' + self.getBody()
body = '\n' + stripTrailingWhitespace(body.replace('\n', '\n '))
if len(body) > 0:
body += '\n'
return... | |
9,943 | [
0.08252952247858047,
0.05365142971277237,
0.012012415565550327,
-0.016262033954262733,
-0.005728533957153559,
0.004983039572834969,
-0.013678458519279957,
-0.0077265785075724125,
0.006139008328318596,
0.041747670620679855,
-0.0040956903249025345,
-0.034721314907073975,
0.037498053163290024,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cgClass", "annotation": null, "type_comment": null}}], "kwarg": n... | def declare(self, cgClass):
args = ', '.join([a.declare() for a in self.args])
body = ' ' + self.getBody(cgClass)
body = stripTrailingWhitespace(body.replace('\n', '\n '))
if len(body) > 0:
body += '\n'
body = ' {\n' + body + '}'
return string.Template(... | |
9,944 | [
0.025941194966435432,
0.05759861692786217,
-0.002620846265926957,
-0.01700686477124691,
-0.0213922131806612,
0.01864318922162056,
0.006305302958935499,
-0.056813180446624756,
0.006321666296571493,
-0.00020522234262898564,
0.013668762519955635,
-0.032202862203121185,
0.02646481990814209,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": n... | class ClassMember(ClassItem):
def __init__(self, name, type, visibility="priv", static=False,
body=None):
self.type = type
self.static = static
self.body = body
ClassItem.__init__(self, name, visibility)
def declare(self, cgClass):
return '%s %s: %s,\n' ... | |
9,945 | [
0.05475299805402756,
0.03442688658833504,
0.014300783164799213,
-0.007281648926436901,
-0.016763418912887573,
-0.009838039055466652,
-0.026401447132229805,
-0.05440298095345497,
0.02565140463411808,
0.016713416203856468,
-0.014013268053531647,
-0.039477162063121796,
0.029951641336083412,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cgClass", "annotation": null, "type_comment": null}}], "kwarg": n... | def define(self, cgClass):
if not self.static:
return ''
if self.body:
body = " = " + self.body
else:
body = ""
return '%s %s::%s%s;\n' % (self.type, cgClass.getNameString(),
self.name, body) | |
9,946 | [
0.04368093982338905,
0.05368635803461075,
0.02304316870868206,
-0.0007041057106107473,
-0.019307129085063934,
0.015967724844813347,
-0.026484929025173187,
-0.046163104474544525,
-0.022006800398230553,
0.016364360228180885,
0.020189961418509483,
-0.041864100843667984,
0.05363517999649048,
-... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": n... | class CGClass(CGThing):
def __init__(self, name, bases=[], members=[], constructors=[],
destructor=None, methods=[],
typedefs=[], enums=[], unions=[], templateArgs=[],
templateSpecialization=[],
disallowCopyConstruction=False, indent='',
... | |
9,947 | [
0.07615679502487183,
0.04034850746393204,
0.03470025584101677,
0.004236187785863876,
-0.020133715122938156,
0.010755998082458973,
-0.03097078949213028,
-0.031159965321421623,
0.0073643457144498825,
0.03318684920668602,
0.03226799517869949,
-0.015093530528247356,
0.04434822499752045,
-0.043... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def define(self):
result = ''
if self.templateArgs:
templateArgs = [a.declare() for a in self.templateArgs]
templateArgs = templateArgs[len(self.templateSpecialization):]
result = result + self.indent + 'template <%s>\n' % ','.join([str(a) for a in templateArgs])
... | |
9,948 | [
0.04701777175068855,
0.03240478038787842,
0.02003355696797371,
0.005607379134744406,
-0.05522571876645088,
0.002026781439781189,
-0.027968695387244225,
-0.008053750731050968,
0.015134883113205433,
0.012157723307609558,
0.05636439099907875,
-0.0097854845225811,
0.020199613645672798,
-0.0407... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cgClass", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "memberList", "annotation": null, "type_comment": null}}], "kwa... | def declareMembers(cgClass, memberList):
result = ''
for member in memberList:
declaration = member.declare(cgClass)
declaration = CGIndenter(CGGeneric(declaration)).define()
result = result + declaration
return result | |
9,949 | [
0.072484090924263,
0.028435366228222847,
0.028208428993821144,
0.009003776125609875,
0.019925180822610855,
-0.01800755225121975,
0.002680708421394229,
0.007097494788467884,
-0.006700352765619755,
0.005656436551362276,
0.012016382068395615,
0.01520486455410719,
0.030160097405314445,
-0.0481... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, descriptor, operation):
nativeName = MakeNativeName(descriptor.binaryNameFor(operation))
operation = descriptor.operations[operation]
assert len(operation.signatures()) == 1
signature = operation.signatures()[0]
(returnType, arguments) = signature
# W... | |
9,950 | [
0.02879350073635578,
0.0487833172082901,
-0.014634994789958,
0.046877361834049225,
0.008344216272234917,
0.004586198832839727,
0.019241048023104668,
-0.002871692180633545,
0.037619877606630325,
-0.03730221837759018,
0.01957005076110363,
-0.03918548300862312,
0.04129564389586449,
-0.0143286... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGProxyUnwrap(CGAbstractMethod):
def __init__(self, descriptor):
args = [Argument('HandleObject', 'obj')]
CGAbstractMethod.__init__(self, descriptor, "UnwrapProxy",
'*const ' + descriptor.concreteType, args,
alwaysInline=True,... | |
9,951 | [
0.03446125611662865,
0.005361160263419151,
-0.03617361932992935,
-0.02469545044004917,
-0.0407220758497715,
-0.014274131506681442,
-0.00428090151399374,
-0.008053446188569069,
0.031946226954460144,
0.002413023728877306,
0.03365859016776085,
-0.011698901653289795,
0.05645439028739929,
-0.04... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getArguments(self):
def process(arg):
argVal = arg.identifier.name
if arg.type.isGeckoInterface() and not arg.type.unroll().inner.isCallback():
argVal += ".r()"
return argVal
args = [(a, process(a)) for a in self.arguments]
if self.idlNode.... | |
9,952 | [
0.030332235619425774,
0.041103389114141464,
-0.007931865751743317,
0.025797748938202858,
0.022225966677069664,
0.017970524728298187,
-0.04113129526376724,
-0.008273696526885033,
0.024109523743391037,
-0.031057754531502724,
0.04679591581225395,
0.010694415308535099,
0.0471307709813118,
-0.0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getBody(self):
indexedGetter = self.descriptor.operations['IndexedGetter']
indexedSetter = self.descriptor.operations['IndexedSetter']
get = ""
if indexedGetter or indexedSetter:
get = "let index = get_array_index_from_id(cx, id);\n"
if indexedGetter:
... | |
9,953 | [
0.04073665663599968,
0.05306485667824745,
0.02260982058942318,
0.04268578067421913,
0.04529273137450218,
0.01893085055053234,
-0.021245434880256653,
-0.015812255442142487,
0.025436047464609146,
-0.010829810984432697,
0.04560946300625801,
-0.04400143772363663,
0.04716876149177551,
-0.035668... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'),
Argument('HandleId', 'id'),
Argument('MutableHandle<PropertyDescriptor>', 'desc', mutable=T... | |
9,954 | [
0.04565088078379631,
0.029702775180339813,
0.018130118027329445,
0.04409719631075859,
-0.00023937152582220733,
0.009185012429952621,
-0.015434019267559052,
-0.04558233544230461,
0.03511781990528107,
0.01528550498187542,
0.044188592582941055,
-0.03801955282688141,
0.039344754070043564,
-0.0... | 20 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'),
Argument('HandleId', 'id'),
Argument('Handle<PropertyDescriptor>', 'desc'),
Argument(... | |
9,955 | [
0.04878976568579674,
0.018482178449630737,
-0.018601762130856514,
0.02468719519674778,
-0.006709921173751354,
0.019917171448469162,
0.004331553354859352,
-0.0369909331202507,
0.06170470267534256,
-0.011287283152341843,
0.04411274939775467,
-0.014881409704685211,
0.0335097461938858,
-0.0483... | 19 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getBody(self):
set = ""
indexedSetter = self.descriptor.operations['IndexedSetter']
if indexedSetter:
set += ("let index = get_array_index_from_id(cx, id);\n" +
"if let Some(index) = index {\n" +
" let this = UnwrapProxy(proxy);\n" +
... | |
9,956 | [
0.05960455164313316,
0.04905705899000168,
0.009285159409046173,
0.01775120571255684,
0.00507177272811532,
0.03714063763618469,
0.0018977069994434714,
0.053545352071523666,
0.04497271031141281,
0.0034307402092963457,
0.056328095495700836,
-0.08213578909635544,
0.014183010905981064,
-0.02677... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGDOMJSProxyHandler_delete(CGAbstractExternMethod):
def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'),
Argument('HandleId', 'id'),
Argument('*mut ObjectOpResult', 'res')]
CGAbstractExternMethod.__init__(s... | |
9,957 | [
0.08607430011034012,
0.04203084483742714,
-0.00910356268286705,
0.0002566959010437131,
-0.0024938262067735195,
0.038660887628793716,
-0.008161612786352634,
0.059582702815532684,
0.04544760659337044,
-0.001992135774344206,
0.027661725878715515,
-0.0439966544508934,
-0.009126964956521988,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getBody(self):
set = ""
if self.descriptor.operations['NamedDeleter']:
if self.descriptor.hasUnforgeableMembers:
raise TypeError("Can't handle a deleter on an interface that has "
"unforgeables. Figure out how that should work!")
... | |
9,958 | [
0.06411910057067871,
0.03271382674574852,
0.03695451095700264,
0.04444234073162079,
0.03116294927895069,
-0.0057673268020153046,
-0.012988600879907608,
-0.009111407212913036,
0.020367387682199478,
-0.0008223892655223608,
0.020658176392316818,
-0.04960385710000992,
0.04555703327059746,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGDOMJSProxyHandler_ownPropertyKeys(CGAbstractExternMethod):
def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'),
Argument('HandleObject', 'proxy'),
Argument('*mut AutoIdVector', 'props')]
CGAbstractExternMethod.__init__(self, descriptor, "o... | |
9,959 | [
0.05900903791189194,
0.0210727471858263,
-0.007255867123603821,
0.04914747551083565,
0.01758512109518051,
0.030039021745324135,
-0.024707362055778503,
0.0019693064969033003,
0.03223048150539398,
-0.007543161977082491,
0.029958846047520638,
-0.008391683921217918,
0.05510717257857323,
-0.036... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getBody(self):
body = dedent(
"""
let unwrapped_proxy = UnwrapProxy(proxy);
""")
if self.descriptor.operations['IndexedGetter']:
body += dedent(
"""
for i in 0..(*unwrapped_proxy).Length() {
rooted!(... | |
9,960 | [
0.08010516315698624,
0.02102459780871868,
0.036275848746299744,
0.029371893033385277,
0.028048833832144737,
0.006940041668713093,
-0.02790450118482113,
-0.005613976623862982,
-0.010788938030600548,
-0.018991898745298386,
0.01918434351682663,
-0.0535958856344223,
0.03704563155770302,
-0.030... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGDOMJSProxyHandler_getOwnEnumerablePropertyKeys(CGAbstractExternMethod):
def __init__(self, descriptor):
assert (descriptor.operations["IndexedGetter"] and
descriptor.interface.getExtendedAttribute("LegacyUnenumerableNamedProperties"))
args = [Argument('*mut JSContext', 'cx'),... | |
9,961 | [
0.029030712321400642,
0.022832728922367096,
0.01888967864215374,
0.026935966685414314,
0.01898825541138649,
-0.008434432558715343,
-0.01953042484819889,
0.023177746683359146,
-0.007590373046696186,
-0.01494662743061781,
0.022179661318659782,
-0.05554773285984993,
0.06368027627468109,
-0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}], "kwarg"... | def __init__(self, descriptor):
assert (descriptor.operations["IndexedGetter"] and
descriptor.interface.getExtendedAttribute("LegacyUnenumerableNamedProperties"))
args = [Argument('*mut JSContext', 'cx'),
Argument('HandleObject', 'proxy'),
Argument('*mut A... | |
9,962 | [
0.04517492279410362,
0.030943088233470917,
0.05489422753453255,
0.05534052103757858,
0.0379350371658802,
0.01630214788019657,
0.0023105039726942778,
-0.004103430081158876,
0.034563031047582626,
0.00037869176594540477,
0.050208136439323425,
-0.06481188535690308,
0.027223967015743256,
-0.021... | 17 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGDOMJSProxyHandler_hasOwn(CGAbstractExternMethod):
def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'),
Argument('HandleId', 'id'), Argument('*mut bool', 'bp')]
CGAbstractExternMethod.__init__(self, descriptor, "hasOwn", ... | |
9,963 | [
0.05730109289288521,
0.025669412687420845,
-0.008824685588479042,
0.048304926604032516,
0.011957514099776745,
0.03197464346885681,
-0.022226598113775253,
0.008560867980122566,
0.030101541429758072,
-0.0070505146868526936,
0.03186911717057228,
-0.004662968683987856,
0.05497950315475464,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getBody(self):
body = dedent(
"""
let unwrapped_proxy = UnwrapProxy(proxy);
""")
if self.descriptor.operations['IndexedGetter']:
body += dedent(
"""
for i in 0..(*unwrapped_proxy).Length() {
rooted!(... | |
9,964 | [
0.012406744062900543,
0.025789136067032814,
0.000974737573415041,
0.04863676801323891,
0.008977415040135384,
0.023604849353432655,
-0.02966260351240635,
0.00017349145491607487,
0.014634715393185616,
-0.031016860157251358,
0.037569716572761536,
-0.002686671679839492,
0.05737391114234924,
-0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getBody(self):
indexedGetter = self.descriptor.operations['IndexedGetter']
if indexedGetter:
indexed = ("let index = get_array_index_from_id(cx, id);\n" +
"if let Some(index) = index {\n" +
" let this = UnwrapProxy(proxy);\n" +
... | |
9,965 | [
0.044547270983457565,
0.02725476212799549,
0.019678529351949692,
0.034609612077474594,
0.02293778583407402,
0.02996055968105793,
-0.006979728117585182,
-0.001631165505386889,
0.044793251901865005,
-0.004070995841175318,
0.034929387271404266,
-0.046146150678396225,
0.02939480170607567,
-0.0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGDOMJSProxyHandler_get(CGAbstractExternMethod):
def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'),
Argument('HandleValue', 'receiver'), Argument('HandleId', 'id'),
Argument('MutableHandleValue', 'vp')]
C... | |
9,966 | [
0.027193790301680565,
0.03229871019721031,
-0.0009815149242058396,
0.027931012213230133,
0.0050458041951060295,
0.036276932805776596,
-0.03157539665699005,
-0.01667793095111847,
0.06270568072795868,
-0.028111841529607773,
0.025705434381961823,
0.0006181197240948677,
0.04860107600688934,
-0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getBody(self):
getFromExpando = """\
rooted!(in(cx) let expando = get_expando_object(proxy));
if !expando.is_null() {
let mut hasProp = false;
if !JS_HasPropertyById(cx, expando.handle(), id, &mut hasProp) {
return false;
}
if hasProp {
return JS_ForwardGetPropertyTo(cx, exp... | |
9,967 | [
0.039221640676259995,
0.02003268152475357,
0.033498018980026245,
0.05472787097096443,
0.025790510699152946,
0.01066623441874981,
-0.002243272727355361,
0.0018883966840803623,
0.05053206905722618,
-0.0023900687228888273,
0.01660078763961792,
-0.06900272518396378,
0.043645478785037994,
-0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGDOMJSProxyHandler_className(CGAbstractExternMethod):
def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', '_proxy')]
CGAbstractExternMethod.__init__(self, descriptor, "className", "*const i8", args, doesNotPanic=True)
self.descriptor = de... | |
9,968 | [
-0.021174011752009392,
0.029241403564810753,
0.008616389706730843,
0.03527460992336273,
0.010338512249290943,
-0.009922428987920284,
0.0003268709115218371,
0.015649352222681046,
0.03231579437851906,
0.05607876926660538,
0.007518392521888018,
-0.06310595571994781,
0.05214909464120865,
0.026... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, descriptor, constructor=None):
args = [Argument('*mut JSContext', 'cx'), Argument('u32', 'argc'), Argument('*mut JSVal', 'vp')]
name = CONSTRUCT_HOOK_NAME
if constructor:
name += "_" + constructor.identifier.name
else:
constructor = descriptor.i... | |
9,969 | [
0.03171299025416374,
0.054763857275247574,
-0.022665884345769882,
0.00018478441052138805,
-0.007152265403419733,
-0.00707406597211957,
0.01717987470328808,
0.022413238883018494,
0.03784865885972977,
-0.005095011554658413,
0.06255976855754852,
0.012114939279854298,
-0.012848813086748123,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "hookName", "annotation": null, "type_comment": null}}, {"_t... | def finalizeHook(descriptor, hookName, context):
release = ""
if descriptor.isGlobal():
release += """\
finalize_global(obj);
"""
elif descriptor.weakReferenceable:
release += """\
let weak_box_ptr = JS_GetReservedSlot(obj, DOM_WEAK_SLOT).to_private() as *mut WeakBox<%s>;
if !weak_box_ptr.is... | |
9,970 | [
0.04421268031001091,
0.025075849145650864,
0.06720327585935593,
0.025392595678567886,
-0.02787378616631031,
-0.03201789781451225,
-0.008420205675065517,
0.013844507746398449,
0.03288895636796951,
0.026936741545796394,
-0.00650652265176177,
-0.00316582596860826,
0.021974362432956696,
-0.036... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def definition_body(self):
preamble = CGGeneric("""\
let global = global_root_from_object(JS_CALLEE(cx, vp).to_object());
let args = CallArgs::from_vp(vp, argc);
""")
name = self.constructor.identifier.name
nativeName = MakeNativeName(self.descriptor.binaryNameFor(name))
callGenerator = ... | |
9,971 | [
0.01332735363394022,
0.05469023436307907,
0.008901340886950493,
0.02061363123357296,
0.01335201133042574,
-0.0021328697912395,
-0.02104513719677925,
0.004715737886726856,
0.021932804957032204,
0.030032778158783913,
0.020810890942811966,
-0.04169575497508049,
0.060608021914958954,
-0.021982... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGInterfaceTrait(CGThing):
def __init__(self, descriptor):
CGThing.__init__(self)
def attribute_arguments(needCx, argument=None):
if needCx:
yield "cx", "*mut JSContext"
if argument:
yield "value", argument_type(descriptor, argument)
... | |
9,972 | [
0.013252098113298416,
0.0574214830994606,
0.014842863194644451,
0.033303432166576385,
0.0007685222662985325,
-0.00015564881323371083,
-0.008588847704231739,
0.0076010338962078094,
0.015060951933264732,
0.027761412784457207,
0.031250834465026855,
-0.05205906555056572,
0.04705585166811943,
-... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}], "kwarg"... | def __init__(self, descriptor):
CGThing.__init__(self)
def attribute_arguments(needCx, argument=None):
if needCx:
yield "cx", "*mut JSContext"
if argument:
yield "value", argument_type(descriptor, argument)
def members():
for... | |
9,973 | [
0.05032838135957718,
0.037275299429893494,
0.018839500844478607,
-0.008625800721347332,
0.009567775763571262,
0.015919378027319908,
-0.022795796394348145,
0.02197493240237236,
0.024343326687812805,
0.021611599251627922,
0.04629134759306908,
-0.06491553783416748,
0.021799994632601738,
-0.03... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "For", "_fields": {"body": [{"_type": "If", "_fields": {"body":... | def members():
for m in descriptor.interface.members:
if (m.isMethod() and not m.isStatic() and
(not m.isIdentifierLess() or m.isStringifier())):
name = CGSpecializedMethod.makeNativeName(descriptor, m)
infallible = 'infallible'... | |
9,974 | [
0.010161498561501503,
0.04019642993807793,
0.04548543319106102,
-0.00033138913568109274,
-0.0027684629894793034,
-0.006207968108355999,
-0.005546842701733112,
-0.021208904683589935,
0.030358880758285522,
0.017176039516925812,
0.0248979851603508,
-0.04289381951093674,
0.03718169778585434,
-... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGDescriptor(CGThing):
def __init__(self, descriptor):
CGThing.__init__(self)
assert not descriptor.concrete or not descriptor.interface.isCallback()
cgThings = []
if not descriptor.interface.isCallback():
cgThings.append(CGGetProtoObjectMethod(descriptor))
... | |
9,975 | [
0.012709533795714378,
0.04378639534115791,
0.04389572516083717,
0.004772908519953489,
-0.007591554895043373,
0.00875317957252264,
-0.006019946187734604,
-0.01477312482893467,
0.035832688212394714,
0.021906863898038864,
0.027660319581627846,
-0.0604044534265995,
0.023984121158719063,
-0.042... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}], "kwarg"... | def __init__(self, descriptor):
CGThing.__init__(self)
assert not descriptor.concrete or not descriptor.interface.isCallback()
cgThings = []
if not descriptor.interface.isCallback():
cgThings.append(CGGetProtoObjectMethod(descriptor))
if (descriptor.interface.hasInt... | |
9,976 | [
0.05188049376010895,
0.04889187961816788,
0.022846562787890434,
-0.015363350510597229,
0.018853960558772087,
0.012293015606701374,
-0.030890140682458878,
-0.047140736132860184,
0.007208866998553276,
0.04875178635120392,
0.01226966641843319,
-0.0028558203484863043,
0.053001224994659424,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "enumName", "annotation... | class CGNonNamespacedEnum(CGThing):
def __init__(self, enumName, names, first, comment="", deriving="", repr=""):
# Account for first value
entries = ["%s = %s" % (names[0], first)] + names[1:]
# Append a Last.
entries.append('Last = ' + str(first + len(entries)))
# Indent.... | |
9,977 | [
0.08752025663852692,
0.029603874310851097,
0.03435511142015457,
-0.01592274196445942,
0.053116414695978165,
0.020990731194615364,
-0.027118610218167305,
-0.019540993496775627,
0.014278082177042961,
0.05082607641816139,
0.04894994571805,
-0.018590746447443962,
0.018517648801207542,
-0.02202... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "enumName", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, enumName, names, first, comment="", deriving="", repr=""):
# Account for first value
entries = ["%s = %s" % (names[0], first)] + names[1:]
# Append a Last.
entries.append('Last = ' + str(first + len(entries)))
# Indent.
entries = [' ' + e for e in ... | |
9,978 | [
0.022745300084352493,
0.0029702477622777224,
0.02000262215733528,
0.02120845578610897,
0.010279125533998013,
0.043599098920822144,
0.055042680352926254,
0.030665960162878036,
-0.010675158351659775,
0.019612500444054604,
0.01964796707034111,
-0.052489154040813446,
0.040714558213949203,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dictionary", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, dictionary, descriptorProvider):
self.dictionary = dictionary
if all(CGDictionary(d, descriptorProvider).generatable for
d in CGDictionary.getDictionaryDependencies(dictionary)):
self.generatable = True
else:
self.generatable = False
... | |
9,979 | [
0.019575394690036774,
0.020882004871964455,
0.027034949511289597,
-0.0050482661463320255,
-0.009205661714076996,
0.015370485372841358,
0.016451409086585045,
0.0042138174176216125,
-0.00009623257210478187,
-0.012133656069636345,
0.029790708795189857,
-0.0345420204102993,
0.04017231985926628,
... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dictionary", "annotati... | class CGDictionary(CGThing):
def __init__(self, dictionary, descriptorProvider):
self.dictionary = dictionary
if all(CGDictionary(d, descriptorProvider).generatable for
d in CGDictionary.getDictionaryDependencies(dictionary)):
self.generatable = True
else:
... | |
9,980 | [
0.06806527823209763,
0.021548425778746605,
-0.009147915989160538,
-0.004071719478815794,
0.012615753337740898,
0.041231393814086914,
-0.0029835361056029797,
-0.02006562612950802,
-0.04462748020887375,
0.004747350234538317,
-0.00020702392794191837,
-0.04988902807235718,
0.06959591060876846,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def struct(self):
d = self.dictionary
if d.parent:
inheritance = " pub parent: %s::%s,\n" % (self.makeModuleName(d.parent),
self.makeClassName(d.parent))
else:
inheritance = ""
memberDecls = [" pub %s:... | |
9,981 | [
0.04569273814558983,
0.02996581606566906,
0.004848920740187168,
0.008434300310909748,
0.0037810036446899176,
-0.005721213296055794,
-0.003684794995933771,
0.020383425056934357,
0.005455035716295242,
0.00003001512413902674,
0.035481784492731094,
-0.021281374618411064,
0.022333256900310516,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def impl(self):
d = self.dictionary
if d.parent:
initParent = "parent: try!(%s::%s::new(cx, val)),\n" % (
self.makeModuleName(d.parent),
self.makeClassName(d.parent))
else:
initParent = ""
def memberInit(memberInfo):
me... | |
9,982 | [
-0.0016633773921057582,
0.03214958310127258,
0.033408649265766144,
-0.004040406085550785,
-0.015911981463432312,
0.052012428641319275,
0.053749069571495056,
0.03353889659047127,
-0.051057275384664536,
0.0009660071227699518,
-0.004091962706297636,
-0.022836841642856598,
0.02876313216984272,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dictionary", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg... | def getDictionaryDependencies(dictionary):
deps = set()
if dictionary.parent:
deps.add(dictionary.parent)
for member in dictionary.members:
if member.type.isDictionary():
deps.add(member.type.unroll().inner)
return deps | |
9,983 | [
0.02935601957142353,
0.03574644774198532,
0.016587648540735245,
0.009086387231945992,
-0.04762864485383034,
-0.01683727465569973,
0.01361709926277399,
0.010234666988253593,
0.033000558614730835,
-0.0019018382299691439,
0.03190220519900322,
-0.008200215175747871,
0.03472298011183739,
0.0119... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "memberInfo", "annotation": null, "type_comment": null}}, {"_type"... | def getMemberConversion(self, memberInfo, memberType):
def indent(s):
return CGIndenter(CGGeneric(s), 8).define()
member, info = memberInfo
templateBody = info.template
default = info.default
replacements = {"val": "rval.handle()"}
conversion = string.Templat... | |
9,984 | [
0.05550108850002289,
0.015826670452952385,
-0.005659650545567274,
-0.005542926024645567,
-0.04290679469704628,
0.012426689267158508,
0.02621815912425518,
0.025667458772659302,
-0.022602686658501625,
-0.019478056579828262,
0.0317012257874012,
0.01200169138610363,
0.04281102120876312,
-0.013... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "memberInfo", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg... | def memberInsert(memberInfo):
member, _ = memberInfo
name = self.makeMemberName(member.identifier.name)
if member.optional and not member.defaultValue:
insertion = CGIfWrapper("let Some(ref %s) = self.%s" % (name, name),
varInse... | |
9,985 | [
0.029416950419545174,
0.04277602583169937,
0.07097851485013962,
0.015023335814476013,
-0.00710684759542346,
0.007191184908151627,
0.015686791390180588,
-0.008326930925250053,
-0.003384748473763466,
0.008799221366643906,
0.023524563759565353,
-0.06045318394899368,
0.009755047969520092,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptors", "annotat... | class CGRegisterProxyHandlersMethod(CGAbstractMethod):
def __init__(self, descriptors):
docs = "Create the global vtables used by the generated DOM bindings to implement JS proxies."
CGAbstractMethod.__init__(self, None, 'RegisterProxyHandlers', 'void', [],
unsafe=T... | |
9,986 | [
0.034954480826854706,
0.023541491478681564,
0.07483543455600739,
-0.011964285746216774,
-0.009764968417584896,
0.013371848501265049,
0.01222233846783638,
-0.012069852091372013,
-0.009155023843050003,
0.02247408963739872,
0.005263699218630791,
-0.05386274307966232,
0.04813865199685097,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation":... | class CGRegisterProxyHandlers(CGThing):
def __init__(self, config):
descriptors = config.getDescriptors(proxy=True)
length = len(descriptors)
self.root = CGList([
CGGeneric("pub static mut proxy_handlers: [*const libc::c_void; %d] = [0 as *const libc::c_void; %d];"
... | |
9,987 | [
0.04039112105965614,
0.009472738020122051,
0.07893745601177216,
-0.02810872532427311,
0.021154364570975304,
0.007045386359095573,
0.0021026928443461657,
0.012337012216448784,
-0.013544619083404541,
0.03832787275314331,
-0.003076667431741953,
-0.06864549219608307,
0.04005129262804985,
-0.05... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, config):
descriptors = config.getDescriptors(proxy=True)
length = len(descriptors)
self.root = CGList([
CGGeneric("pub static mut proxy_handlers: [*const libc::c_void; %d] = [0 as *const libc::c_void; %d];"
% (length, length)),
CGR... | |
9,988 | [
0.017760878428816795,
0.027118029072880745,
0.06494162231683731,
-0.00849907100200653,
0.012476200237870216,
-0.005846516229212284,
0.0024039840791374445,
-0.018796022981405258,
0.02041683904826641,
0.032198403030633926,
0.033560432493686676,
-0.048161402344703674,
0.04404807090759277,
-0.... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, config, prefix, webIDLFile):
descriptors = config.getDescriptors(webIDLFile=webIDLFile,
hasInterfaceObject=True)
# We also want descriptors that have an interface prototype object
# (isCallback=False), but we don't want to include a ... | |
9,989 | [
-0.02268003486096859,
0.005775483790785074,
-0.014344637282192707,
0.010501916520297527,
0.005952225998044014,
0.01673921011388302,
0.015302466228604317,
0.005077066365629435,
0.024150986224412918,
0.039955172687768936,
0.022976504638791084,
-0.01556472945958376,
0.07808590680360794,
-0.00... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "descriptorProvider", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ty", "annotation": null, "type_comment": null}}, {"... | def argument_type(descriptorProvider, ty, optional=False, defaultValue=None, variadic=False):
info = getJSToNativeConversionInfo(
ty, descriptorProvider, isArgument=True)
declType = info.declType
if variadic:
if ty.isGeckoInterface():
declType = CGWrapper(declType, pre="&[", pos... | |
9,990 | [
0.029351022094488144,
0.0017144150333479047,
0.0328124538064003,
-0.01507855486124754,
-0.024585630744695663,
-0.019725404679775238,
-0.008007518947124481,
0.013822007924318314,
0.02965923212468624,
0.0008994381641969085,
0.030062275007367134,
-0.06723707914352417,
0.05889171361923218,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idlObject", "annotatio... | class CGCallback(CGClass):
def __init__(self, idlObject, descriptorProvider, baseName, methods,
getters=[], setters=[]):
self.baseName = baseName
self._deps = idlObject.getDeps()
name = idlObject.identifier.name
# For our public methods that needThisHandling we want ... | |
9,991 | [
0.004472621250897646,
0.016794895753264427,
0.03291749581694603,
0.008260498754680157,
0.005007966421544552,
0.013993671163916588,
-0.007301857694983482,
0.04073602706193924,
0.030427521094679832,
0.060008447617292404,
0.017081243917346,
-0.06986875832080841,
0.08978857100009918,
0.0158487... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "descriptorProvider", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "returnType", "annotation": null, "type_comment": nu... | def method_arguments(descriptorProvider, returnType, arguments, passJSBits=True, trailing=None):
if needCx(returnType, arguments, passJSBits):
yield "cx", "*mut JSContext"
for argument in arguments:
ty = argument_type(descriptorProvider, argument.type, argument.optional,
... | |
9,992 | [
0.005570824723690748,
0.03520268574357033,
0.002530192956328392,
0.0074218991212546825,
0.004699558485299349,
-0.010672280564904213,
-0.036164890974760056,
-0.007603779900819063,
0.029288632795214653,
-0.006770649459213018,
0.005538555793464184,
-0.04801646247506142,
0.07223591208457947,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getConstructors(self):
return [ClassConstructor(
[Argument("*mut JSObject", "aCallback")],
bodyInHeader=True,
visibility="pub",
explicit=False,
baseConstructors=[
"%s::new()" % self.baseName
])] | |
9,993 | [
0.03511333093047142,
-0.0028486952651292086,
0.04691968858242035,
-0.008890045806765556,
-0.02340104803442955,
-0.004833080805838108,
0.00883712898939848,
0.023530399426817894,
0.012312008067965508,
0.010977325029671192,
0.03426665812730789,
-0.04616709053516388,
0.038758717477321625,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idlObject", "annotation": null, "type_comment": null}}, {"_type":... | def __init__(self, idlObject, descriptorProvider, baseName, methods,
getters=[], setters=[]):
self.baseName = baseName
self._deps = idlObject.getDeps()
name = idlObject.identifier.name
# For our public methods that needThisHandling we want most of the
# same args... | |
9,994 | [
0.05950244888663292,
0.00949339009821415,
0.008149354718625546,
-0.04712029546499252,
-0.022818192839622498,
-0.0049078576266765594,
0.005622446537017822,
0.017806947231292725,
0.0649515688419342,
0.0006039796862751245,
0.03420296311378479,
-0.054442550987005234,
0.05994032695889473,
0.014... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "method", "annotation": null, "type_comment": null}}], "kwarg": nu... | def getMethodImpls(self, method):
assert method.needThisHandling
args = list(method.args)
# Strip out the JSContext*/JSObject* args
# that got added.
assert args[0].name == "cx" and args[0].argType == "*mut JSContext"
assert args[1].name == "aThisObj" and args[1].argType ... | |
9,995 | [
0.01772119291126728,
-0.00628882460296154,
0.03278369456529617,
0.0022841726895421743,
-0.021535390987992287,
-0.02313060499727726,
0.0227624773979187,
0.008395325392484665,
0.04123014956712723,
0.023355569690465927,
0.004670602735131979,
-0.06286779791116714,
0.04797913134098053,
-0.04372... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "callback", "annotation... | class CGCallbackFunction(CGCallback):
def __init__(self, callback, descriptorProvider):
CGCallback.__init__(self, callback, descriptorProvider,
"CallbackFunction",
methods=[CallCallback(callback, descriptorProvider)])
def getConstructors(self):
... | |
9,996 | [
0.02668975479900837,
0.020930631086230278,
-0.028365135192871094,
0.022431492805480957,
-0.005904555320739746,
-0.04742259532213211,
-0.004458957351744175,
0.02990090101957321,
0.05244874209165573,
0.0007453410653397441,
0.018964385613799095,
-0.031064361333847046,
0.061896029859781265,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "callback", "annotation": null, "type_comment": null}}], "kwarg": ... | def __init__(self, callback):
impl = string.Template("""\
impl CallbackContainer for ${type} {
fn new(callback: *mut JSObject) -> Rc<${type}> {
${type}::new(callback)
}
fn callback(&self) -> *mut JSObject {
self.parent.callback()
}
}
impl ToJSValConvertible for ${type} {
un... | |
9,997 | [
0.03530155122280121,
0.01823650673031807,
-0.018022488802671432,
0.026200193911790848,
-0.02378968521952629,
-0.058482978492975235,
0.001745928660966456,
0.00493365665897727,
0.05303117632865906,
-0.016839763149619102,
0.012627006508409977,
-0.04861566424369812,
0.05834781005978584,
-0.005... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "callback", "annotation... | class CGCallbackFunctionImpl(CGGeneric):
def __init__(self, callback):
impl = string.Template("""\
impl CallbackContainer for ${type} {
fn new(callback: *mut JSObject) -> Rc<${type}> {
${type}::new(callback)
}
fn callback(&self) -> *mut JSObject {
self.parent.callback()
}
}
... | |
9,998 | [
0.002612748881801963,
0.00729778129607439,
-0.016805201768875122,
0.01361615490168333,
0.005132932215929031,
-0.030887171626091003,
0.02227555215358734,
0.012481475248932838,
0.04123067110776901,
0.059146665036678314,
0.014918049797415733,
-0.06559642404317856,
0.05322244390845299,
-0.0312... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotation": null, "type_comment": null}}], "kwarg"... | def __init__(self, descriptor):
iface = descriptor.interface
attrs = [m for m in iface.members if m.isAttr() and not m.isStatic()]
getters = [CallbackGetter(a, descriptor) for a in attrs]
setters = [CallbackSetter(a, descriptor) for a in attrs
if not a.readonly]
... | |
9,999 | [
0.008193600922822952,
0.021212881430983543,
-0.01576165109872818,
-0.005568521097302437,
-0.006618552841246128,
-0.032528653740882874,
0.03451700881123543,
0.004267151467502117,
0.03520958498120308,
0.03134457394480705,
-0.0031082064379006624,
-0.05974012240767479,
0.043408770114183426,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "descriptor", "annotati... | class CGCallbackInterface(CGCallback):
def __init__(self, descriptor):
iface = descriptor.interface
attrs = [m for m in iface.members if m.isAttr() and not m.isStatic()]
getters = [CallbackGetter(a, descriptor) for a in attrs]
setters = [CallbackSetter(a, descriptor) for a in attrs
... | |
10,000 | [
0.03504650294780731,
0.015948127955198288,
0.027810780331492424,
-0.031871646642684937,
-0.019541379064321518,
0.0030456495005637407,
-0.025042006745934486,
0.0038855106104165316,
0.06192205473780632,
-0.006478927098214626,
-0.007155738305300474,
-0.023639163002371788,
0.026432545855641365,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def getResultConversion(self):
replacements = {
"val": "rval.handle()",
}
info = getJSToNativeConversionInfo(
self.retvalType,
self.descriptorProvider,
exceptionCode=self.exceptionCode,
isCallbackReturnValue="Callback",
# X... |