{"action":"closed","issue":{"url":"https://api.github.com/repos/iojs/io.js/issues/1353","labels_url":"https://api.github.com/repos/iojs/io.js/issues/1353/labels{/name}","comments_url":"https://api.github.com/repos/iojs/io.js/issues/1353/comments","events_url":"https://api.github.com/repos/iojs/io.js/issues/1353/events","html_url":"https://github.com/iojs/io.js/issues/1353","id":66525058,"number":1353,"title":"node-webgl failing with iojs","user":{"login":"jhludwig","id":1697592,"avatar_url":"https://avatars.githubusercontent.com/u/1697592?v=3","gravatar_id":"","url":"https://api.github.com/users/jhludwig","html_url":"https://github.com/jhludwig","followers_url":"https://api.github.com/users/jhludwig/followers","following_url":"https://api.github.com/users/jhludwig/following{/other_user}","gists_url":"https://api.github.com/users/jhludwig/gists{/gist_id}","starred_url":"https://api.github.com/users/jhludwig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhludwig/subscriptions","organizations_url":"https://api.github.com/users/jhludwig/orgs","repos_url":"https://api.github.com/users/jhludwig/repos","events_url":"https://api.github.com/users/jhludwig/events{/privacy}","received_events_url":"https://api.github.com/users/jhludwig/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/iojs/io.js/labels/c++","name":"c++","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-06T04:47:04Z","updated_at":"2015-04-07T03:45:12Z","closed_at":"2015-04-07T03:45:12Z","body":"(this is also posted at https://github.com/mikeseven/node-webgl/issues/36)\r\n\r\nnode-webgl fails on iojs when passing objects with array members as uniforms.  For example, https://github.com/mikeseven/node-webgl/blob/master/test/lesson08.js.\r\n\r\non both node v0.12.x and io.js 1.6.2, examples fail with the following error:\r\n\r\n```\r\n/home/john/ws/var/release/install/bin/hostjs/node_modules/node-webgl/lib/webgl.js:1004\r\n  return _uniformMatrix4fv(location ? location._ : 0, transpose, value);\r\n         ^\r\nError: Not enough data for UniformMatrix4fv\r\n    at Error (native)\r\n    at Object.uniformMatrix4fv (/home/john/ws/var/release/install/bin/hostjs/node_modules/node-webgl/lib/webgl.js:1004:10)\r\n    at loadUniformsGeneric (/home/john/ws/var/release/install/bin/hostjs/node_modules/three/three.js:22802:10)\r\n    at setProgram (/home/john/ws/var/release/install/bin/hostjs/node_modules/three/three.js:22248:4)\r\n    at renderBufferDirect (/home/john/ws/var/release/install/bin/hostjs/node_modules/three/three.js:20158:17)\r\n    at renderObjects (/home/john/ws/var/release/install/bin/hostjs/node_modules/three/three.js:21197:11)\r\n    at render (/home/john/ws/var/release/install/bin/hostjs/node_modules/three/three.js:21070:4)\r\n    at render (/home/john/ws/var/release/install/bin/hostjs/example3/example-cube.js:29:11)\r\n    at Object.<anonymous> (/home/john/ws/var/release/install/bin/hostjs/example3/example-cube.js:32:1)\r\n```\r\n\r\nthis error is originating from webgl.cc in the NAN_METHOD UniformMatrix4fv, line 377: \r\n```\r\nNAN_METHOD(UniformMatrix4fv) {\r\n  NanScope();\r\n\r\n  GLint location = args[0]->Int32Value();\r\n  GLboolean transpose = args[1]->BooleanValue();\r\n  GLsizei count=0;\r\n  GLfloat* data=getArrayData<GLfloat>(args[2],&count);\r\n\r\n  if (count < 16) {\r\n    NanThrowError(\"Not enough data for UniformMatrix4fv\");\r\n  }\r\n```\r\nit occurs because the uniform matrix does not appear to have enough data.  on the javascript side, it is easy to use node-debug to inspect and see that the javascript array does indeed have the requisite 16 elements, but for some reason webgl.cc is not seeing.\r\n\r\nthe count variable comes from line 374, which is expanded inline by lines 72-89.  arg is an object in this case, so num and data are extracted in lines 84/85:\r\n```\r\n    else if(arg->IsObject()) {\r\n      if(num) *num = arg->ToObject()->GetIndexedPropertiesExternalArrayDataLength();\r\n      data = reinterpret_cast<Type*>(arg->ToObject()->GetIndexedPropertiesExternalArrayData());\r\n    }\r\n```\r\n\r\ni understand some interfaces have changed for external arrays from node 0.10.x to iojs, welcome any advice on how to address.\r\n"}}