src/third_party/mozjs/extract/js/src/devtools/rootAnalysis/CFG.js
// given edge is the matching destructor call.
given edge is the matching destructor call.
given edge is the matching destructor call .
function isMatchingDestructor(constructor, edge)
{
    if (edge.Kind != "Call")
        return false;
    var callee = edge.Exp[0];
    if (callee.Kind != "Var")
        return false;
    var variable = callee.Variable;
    assert(variable.Kind == "Func");
    if (variable.Name[1].charAt(0) != '~')
        return false;
    if (!("PEdgeCallInstance" in edge))
        return false;
    var constructExp = constructor.PEdgeCallInstance.Exp;
    assert(constructExp.Kind == "Var");
    var destructExp = edge.PEdgeCallInstance.Exp;
    if (destructExp.Kind != "Var")
        return false;
    return sameVariable(constructExp.Variable, destructExp.Variable);
}
function isMatchingDestructor ( constructor , edge ) { if ( edge . Kind != "Call" ) return false ; var callee = edge . Exp [ 0 ] ; if ( callee . Kind != "Var" ) return false ; var variable = callee . Variable ; assert ( variable . Kind == "Func" ) ; if ( variable . Name [ 1 ] . charAt ( 0 ) != '~' ) return false ; if ( ! ( "PEdgeCallInstance" in edge ) ) return false ; var constructExp = constructor . PEdgeCallInstance . Exp ; assert ( constructExp . Kind == "Var" ) ; var destructExp = edge . PEdgeCallInstance . Exp ; if ( destructExp . Kind != "Var" ) return false ; return sameVariable ( constructExp . Variable , destructExp . Variable ) ; }
given edge is the matching destructor call.
given edge is the matching destructor call .
// Note that in some situations, a regular function can begin with '~', so // we don't necessarily have a destructor in hand. This is probably a // sixgill artifact, but in js::wasm::ModuleGenerator::~ModuleGenerator, a // templatized static inline EraseIf is invoked, and it gets named ~EraseIf // for some reason.