Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var code = [];
loadComponents(files).forEach(function(f){
var comp = getKendoFile(f);
var ast = comp.getFullAST_noDeps();
// must be an IIFE.
if (!(ast instanceof U2.AST_Lambda)) {
console.log("Got wrong node!", ast.TYPE);
throw new Error("BAD AST NOTE IN BUILD");
}
code.push(new U2.AST_SimpleStatement({
body: new U2.AST_Call({
expression: ast, args: []
})
}));
});
var min = minify(new U2.AST_Toplevel({ body: code }));
return get_wrapper().wrap([], min);
}
var code = [];
loadComponents(files).forEach(function(f){
var comp = getKendoFile(f);
var ast = comp.getFullAST_noDeps();
// must be an IIFE.
if (!(ast instanceof U2.AST_Lambda)) {
console.log("Got wrong node!", ast.TYPE);
throw new Error("BAD AST NOTE IN BUILD");
}
code.push(new U2.AST_SimpleStatement({
body: new U2.AST_Call({
expression: ast, args: []
})
}));
});
var min = minify(new U2.AST_Toplevel({ body: code }));
return get_wrapper().wrap([], min);
}
function extract_widget_info(ast) {
ast = new U2.AST_Toplevel(ast);
ast.figure_out_scope();
var widgets = [];
var scope = null;
// Quick-n-dirty heuristic that should cover the use cases in Kendo.
function dumb_eval(node) {
if (node instanceof U2.AST_Constant) {
return node.getValue();
}
if (node instanceof U2.AST_SymbolRef) {
var init = node.definition().init;
if (init) {
return dumb_eval(init);
}
return node.name;
}
function extract_widget_info(ast) {
ast = new U2.AST_Toplevel(ast);
ast.figure_out_scope();
var widgets = [];
var scope = null;
// Quick-n-dirty heuristic that should cover the use cases in Kendo.
function dumb_eval(node) {
if (node instanceof U2.AST_Constant) {
return node.getValue();
}
if (node instanceof U2.AST_SymbolRef) {
var init = node.definition().init;
if (init) {
return dumb_eval(init);
}
return node.name;
}
function rewrite_globals(code, ctx) {
var ast;
if (code instanceof u2.AST_Node) {
ast = new u2.AST_Toplevel({
body: [ code ]
});
} else {
ast = u2.parse(code);
ast.figure_out_scope({ screw_ie: true });
}
var hoisted = [];
var warnings = [];
function in_context(sym) {
if (ctx) {
return sym.global() && sym.name in ctx;
} else {
return sym.global() && !sym.undeclared();
}
};
var tt = new u2.TreeTransformer(function before(node, descend){