Lines Matching refs:decl
23 static void HoistVar(PandaGen *pg, varbinder::Variable *var, const varbinder::VarDecl *decl)
28 pg->LoadConst(decl->Node(), Constant::JS_UNDEFINED);
29 pg->StoreGlobalVar(decl->Node(), decl->Name());
33 varbinder::ConstScopeFindResult result(decl->Name(), scope, 0, var);
35 pg->LoadConst(decl->Node(), Constant::JS_UNDEFINED);
36 pg->StoreAccToLexEnv(decl->Node(), result, true);
39 static void HoistFunction(PandaGen *pg, varbinder::Variable *var, const varbinder::FunctionDecl *decl)
41 const ir::ScriptFunction *scriptFunction = decl->Node()->AsScriptFunction();
47 pg->DefineFunction(decl->Node(), scriptFunction, internalName);
48 pg->StoreGlobalVar(decl->Node(), var->Declaration()->Name());
53 varbinder::ConstScopeFindResult result(decl->Name(), scope, 0, var);
55 pg->DefineFunction(decl->Node(), scriptFunction, internalName);
56 pg->StoreAccToLexEnv(decl->Node(), result, true);
69 const auto *decl = var->Declaration();
71 if (decl->IsVarDecl()) {
72 HoistVar(pg, var, decl->AsVarDecl());
74 ASSERT(decl->IsFunctionDecl());
75 HoistFunction(pg, var, decl->AsFunctionDecl());