{"action":"created","issue":{"url":"https://api.github.com/repos/svaarala/duktape/issues/1563","repository_url":"https://api.github.com/repos/svaarala/duktape","labels_url":"https://api.github.com/repos/svaarala/duktape/issues/1563/labels{/name}","comments_url":"https://api.github.com/repos/svaarala/duktape/issues/1563/comments","events_url":"https://api.github.com/repos/svaarala/duktape/issues/1563/events","html_url":"https://github.com/svaarala/duktape/issues/1563","id":235860150,"number":1563,"title":"Enumeration of virtual properties of a proxy object ","user":{"login":"kurash","id":5510108,"avatar_url":"https://avatars0.githubusercontent.com/u/5510108?v=3","gravatar_id":"","url":"https://api.github.com/users/kurash","html_url":"https://github.com/kurash","followers_url":"https://api.github.com/users/kurash/followers","following_url":"https://api.github.com/users/kurash/following{/other_user}","gists_url":"https://api.github.com/users/kurash/gists{/gist_id}","starred_url":"https://api.github.com/users/kurash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurash/subscriptions","organizations_url":"https://api.github.com/users/kurash/orgs","repos_url":"https://api.github.com/users/kurash/repos","events_url":"https://api.github.com/users/kurash/events{/privacy}","received_events_url":"https://api.github.com/users/kurash/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-14T12:19:13Z","updated_at":"2017-06-14T13:57:18Z","closed_at":null,"body":"My (admittedly squirrelly) implementation of a C-based proxy object was working fine with 1.5, but now after moving to 2.1, the properties can't be enumerated.  I get get and set props by name, but things like for-in and JSON.stringify find no properties.\r\n\r\nduktape does call my ownKeys method, which is retuning the array of property names,  After duktape gets the array, it does some checks to make sure that names are valid strings/numbers.  It is in this check where it is testing various (internal?) conditions on the object, but those conditions don't hold.  Maybe I am not setting up the proxy object the right way for 2.1?\r\n\r\nI can get this to work by changing the duktape code, though this is not the best thing since I do not know the code well enough.  But anyway, the change, in case it points out my mistake or reveals a bug, is to pass the DUK_ENUM_INCLUDE_NONENUMERABLE flag into the call to duk_proxy_ownkeys_postprocess made by duk_hobject_enumerator_create:\r\n\r\n\tduk_proxy_ownkeys_postprocess(ctx, h_proxy_target, enum_flags | DUK_ENUM_INCLUDE_NONENUMERABLE);\r\n\r\nWith that change, my virtual properties can be enumerated once again, but I wonder what other effects this change would have.\r\n\r\nAny clues about what I might be doing wrong in my own code, or new ways I should be creating proxy objects in 2.1?"},"comment":{"url":"https://api.github.com/repos/svaarala/duktape/issues/comments/308439274","html_url":"https://github.com/svaarala/duktape/issues/1563#issuecomment-308439274","issue_url":"https://api.github.com/repos/svaarala/duktape/issues/1563","id":308439274,"user":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars2.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"created_at":"2017-06-14T13:57:18Z","updated_at":"2017-06-14T13:57:18Z","body":"It might be the same issue as in #1543?"}}
{"actor":{"display_login":"svaarala"}}