njs_generate_import_statement(njs_vm_t *vm, njs_generator_t *generator,
    njs_parser_node_t *node)
{
    njs_variable_t       *var;
    njs_parser_node_t    *lvalue;
    njs_vmcode_import_t  *import;

    lvalue = node->left;

    var = njs_variable_reference(vm, lvalue);
    if (njs_slow_path(var == NULL)) {
        return NJS_ERROR;
    }

    njs_generate_code(generator, njs_vmcode_import_t, import,
                      NJS_VMCODE_IMPORT, 1, node);

    import->module = node->u.module;
    import->retval = lvalue->index;

    return njs_generator_stack_pop(vm, generator, NULL);
}
njs_generate_import_statement(njs_vm_t *vm, njs_generator_t *generator,
    njs_parser_node_t *node)
{
    njs_variable_t       *var;
    njs_parser_node_t    *lvalue;
    njs_vmcode_import_t  *import;

    lvalue = node->left;

    var = njs_variable_reference(vm, lvalue);
    if (njs_slow_path(var == NULL)) {
        return NJS_ERROR;
    }

    njs_generate_code(generator, njs_vmcode_import_t, import,
                      NJS_VMCODE_IMPORT, 1, node);

    import->module = node->u.module;
    import->retval = lvalue->index;

    return njs_generator_stack_pop(vm, generator, NULL);
}