Lines Matching refs:ir

17 #include <ir/base/scriptFunction.h>
18 #include <ir/expression.h>
19 #include <ir/expressions/arrayExpression.h>
20 #include <ir/expressions/callExpression.h>
21 #include <ir/expressions/functionExpression.h>
22 #include <ir/expressions/identifier.h>
23 #include <ir/expressions/memberExpression.h>
24 #include <ir/statements/expressionStatement.h>
25 #include <ir/statements/blockStatement.h>
39 void ParserImpl::AddCommonjsParams(ArenaVector<ir::Expression *> &params)
42 ir::Expression *param = AllocNode<ir::Identifier>(paramName);
49 void ParserImpl::AddReflectApplyArgs(ArenaVector<ir::Expression *> &args, ir::FunctionExpression *wrapper)
55 ir::Expression *thisValue = AllocNode<ir::Identifier>(binder::Binder::CJS_MANDATORY_PARAM_EXPORTS);
59 ArenaVector<ir::Expression *> elements(Allocator()->Adapter());
61 ir::Expression *arg = AllocNode<ir::Identifier>(argName);
65 ir::ArrayExpression *wrapperArgsArray =
66 AllocNode<ir::ArrayExpression>(ir::AstNodeType::ARRAY_EXPRESSION, std::move(elements), false);
73 ir::FunctionExpression *wrapper = nullptr;
79 ArenaVector<ir::Expression *> params(Allocator()->Adapter());
90 AllocNode<ir::ScriptFunction>(functionScope, std::move(params), nullptr, program_.Ast(), nullptr,
95 wrapper = AllocNode<ir::FunctionExpression>(funcNode);
99 ArenaVector<ir::Expression *> arguments(Allocator()->Adapter());
102 auto *apply = AllocNode<ir::Identifier>("apply");
103 auto *reflect = AllocNode<ir::Identifier>("Reflect");
104 auto *reflectApply = AllocNode<ir::MemberExpression>(reflect, apply,
105 ir::MemberExpression::MemberExpressionKind::PROPERTY_ACCESS, false, false);
107 auto *callExpr = AllocNode<ir::CallExpression>(reflectApply, std::move(arguments), nullptr, false);
109 auto *exprStatementNode = AllocNode<ir::ExpressionStatement>(callExpr);
111 ArenaVector<ir::Statement *> statements(Allocator()->Adapter());
114 auto *blockStmt = AllocNode<ir::BlockStatement>(Binder()->GetScope(), std::move(statements));