Closed iamstolis closed 8 years ago
Casting sounds wrong indeed. Is there a way to see this problem happening with a normal node build?
I am sorry, I don't know how to reproduce this issue using a non-debug build. I tried to produce some test-case but I was not successful. On the other hand, I hope that you understand that this issue is worth fixing even without such a test-case.
I understand. I will check the API docu tomorrow just to make sure, but will this pull in then.
Did you find any problem while checking the API docs? Is there anything I can help with?
@not-a-robot r+
:pushpin: Commit 360c948 has been approved by badboy
Note that Reader::createString() may not return String, it may return a Buffer (when return_buffers is set to true). So, the variable 'v' may not hold String. Moreover, 'v.As()' doesn't convert the value to String, it works more like a cast. Of course, it is incorrect to cast Buffer to String. Unfortunately, the non-debug version of Node.js has various checks turned off. So, you cannot see this issue normally, but when you execute tests on the debug version of Node.js, i.e., run node_g test/reader.js then you can see the following crash caused by the incorrect cast of 'v'.