{"action":"created","issue":{"url":"https://api.github.com/repos/NeilFraser/JS-Interpreter/issues/132","repository_url":"https://api.github.com/repos/NeilFraser/JS-Interpreter","labels_url":"https://api.github.com/repos/NeilFraser/JS-Interpreter/issues/132/labels{/name}","comments_url":"https://api.github.com/repos/NeilFraser/JS-Interpreter/issues/132/comments","events_url":"https://api.github.com/repos/NeilFraser/JS-Interpreter/issues/132/events","html_url":"https://github.com/NeilFraser/JS-Interpreter/issues/132","id":308061768,"number":132,"title":"createNativeFunction calls back with pseudo array.","user":{"login":"NAllred91","id":8683908,"avatar_url":"https://avatars0.githubusercontent.com/u/8683908?v=4","gravatar_id":"","url":"https://api.github.com/users/NAllred91","html_url":"https://github.com/NAllred91","followers_url":"https://api.github.com/users/NAllred91/followers","following_url":"https://api.github.com/users/NAllred91/following{/other_user}","gists_url":"https://api.github.com/users/NAllred91/gists{/gist_id}","starred_url":"https://api.github.com/users/NAllred91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NAllred91/subscriptions","organizations_url":"https://api.github.com/users/NAllred91/orgs","repos_url":"https://api.github.com/users/NAllred91/repos","events_url":"https://api.github.com/users/NAllred91/events{/privacy}","received_events_url":"https://api.github.com/users/NAllred91/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-23T14:56:13Z","updated_at":"2018-03-30T17:58:22Z","closed_at":"2018-03-29T22:33:47Z","author_association":"NONE","body":"```\r\ninterpreter.setProperty(internalConsole, 'log', interpreter.createNativeFunction((message) => {\r\n     // If message is an array, at this point it is an interpreter psuedo array and needs to be converted to a native array.\r\n     message = interpreter.pseudoToNative(message)\r\n})\r\n```\r\n\r\nWhen I call my native log function with an array, the callback gets called with a psuedo array.  I can get around it by calling `interpreter.pseudoToNative`, but this destroys error objects.\r\n\r\nI'm not sure if this is expected behavior, or if the callback should be called with a native array?"},"comment":{"url":"https://api.github.com/repos/NeilFraser/JS-Interpreter/issues/comments/377583339","html_url":"https://github.com/NeilFraser/JS-Interpreter/issues/132#issuecomment-377583339","issue_url":"https://api.github.com/repos/NeilFraser/JS-Interpreter/issues/132","id":377583339,"user":{"login":"NAllred91","id":8683908,"avatar_url":"https://avatars0.githubusercontent.com/u/8683908?v=4","gravatar_id":"","url":"https://api.github.com/users/NAllred91","html_url":"https://github.com/NAllred91","followers_url":"https://api.github.com/users/NAllred91/followers","following_url":"https://api.github.com/users/NAllred91/following{/other_user}","gists_url":"https://api.github.com/users/NAllred91/gists{/gist_id}","starred_url":"https://api.github.com/users/NAllred91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NAllred91/subscriptions","organizations_url":"https://api.github.com/users/NAllred91/orgs","repos_url":"https://api.github.com/users/NAllred91/repos","events_url":"https://api.github.com/users/NAllred91/events{/privacy}","received_events_url":"https://api.github.com/users/NAllred91/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T17:58:21Z","updated_at":"2018-03-30T17:58:21Z","author_association":"NONE","body":"Thanks,\r\n\r\nIs there a risk to handling this all in the JS and not in the interpreter?  Using `interpreter.pseudoToNative` on all of the parameters coming out of the interpreter seems to be working fine, and I just use a `type of` check to deal with error objects.\r\n\r\nI don't see any issues doing this, and its more straightforward than serializing inside the interpreter.  I just want to make sure there isn't some risk associated with this that I'm not aware of."}}
{"actor":{"display_login":"NAllred91"}}