ECMAScript code generator that transforms Mozilla's Parser API ASTs back into executable JavaScript code
95
{
"context": "This evaluation assesses how well the engineer uses escodegen's context-aware code generation capabilities, specifically the internal flag system that controls how expressions are generated in different syntactic contexts.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses escodegen.generate",
"description": "Correctly uses escodegen.generate() function to generate JavaScript code from AST nodes",
"max_score": 20
},
{
"name": "Context flag handling",
"description": "Demonstrates understanding that escodegen internally tracks context using flags (e.g., F_ALLOW_IN flag controls whether 'in' operator is allowed) by properly configuring generation options or by examining/testing behavior in different contexts",
"max_score": 25
},
{
"name": "For-loop context awareness",
"description": "Correctly handles the constraint that 'in' operator cannot appear in for-loop initializers, either by detecting this issue or by using escodegen's generation in a way that respects this context constraint",
"max_score": 25
},
{
"name": "Directive context handling",
"description": "Properly handles directive contexts (like 'use strict' at the start of functions/programs) by using escodegen's directive-aware generation or by understanding F_DIRECTIVE_CTX flag behavior",
"max_score": 15
},
{
"name": "AST traversal for detection",
"description": "Implements AST node traversal to detect specific node types (like BinaryExpression with 'in' operator) that are relevant to context constraints, potentially using recursive patterns similar to escodegen's internal traversal",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-escodegendocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10