Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7_array_length issue #586

Open
biyuexiug opened this issue Jul 28, 2017 · 1 comment
Open

v7_array_length issue #586

biyuexiug opened this issue Jul 28, 2017 · 1 comment

Comments

@biyuexiug
Copy link

include <stdio.h>
#include "v7.h"

int main(void)
{
struct v7* v7 = v7_create();
v7_val_t a = v7_mk_array(v7);

v7_array_push(v7, a, v7_mk_number(v7, 0));
v7_array_push(v7, a, v7_mk_number(v7, 1));
v7_array_push(v7, a, v7_mk_number(v7, 2));
printf("%d\n", v7_array_length(v7, a));

v7_array_del(v7, a, 0);
printf("%d\n", v7_array_length(v7, a));

v7_destroy(v7);
return 0;

}

the output is:
3
3
if I change v7_array_del(v7, a, 0); to v7_array_del(v7, a, 2);
the output is:
3
2

it seems that only the last entry can be deleted

@cpq
Copy link
Member

cpq commented Jul 28, 2017

FYI - the development of v7 is currently suspended in favor of https://github.com/cesanta/mjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants