jsprime
jsprime copied to clipboard
asignFunctionReturnValue in engine.js is not working
I am trying to run the JSPrime for static analysis of javascript but asignFunctionReturnValue() is not working properly. Hello Nishant can u provide a solution for it, the analyze() is not working properly and when i debugged the JSPrime i found that it is not coming out of the method asignFunctionReturnValue() in engine.js and also the analyzeArrays requires formal parameters.kindly provide a solution.
I'm getting the same issue. Seems to be line 149 of engine.js
:
/jsprime/jsprime-node/engine.js:149
convertedFunction.push(newFunction2);
^
ReferenceError: convertedFunction is not defined
at Object.asignFunctionReturnValue (/jsprime/jsprime-node/engine.js:149:13)
at IncomingMessage.<anonymous> (/jsprime/jsprime-node/server.js:71:18)
at IncomingMessage.EventEmitter.emit (events.js:92:17)
at _stream_readable.js:919:16
at process._tickCallback (node.js:419:13)
Add exports.convertedFunction=convertedFunction; in analyzer.js
Add exports.convertedFunction=convertedFunction; in analyzer.js
@TejaswiniU can u specify where should this block of code be added? Is it a method on some object? I'm trying to make it work but with no luck.
@marcyss
Can you check this
@TejaswiniU thanks, I've added the lines, but the app seems to break when analyzing some code.
When I paste TEST CASE 06 from the readme file, which is:
function go(){ if (document.location.hash.split("#")[1]){ document.location.replace(document.location.hash.split("#")[1]); }}
it works fine, but when I paste code from TEST CASE 05, which is:
function timedMsg(abc,callback){ if(callback){ var t=setTimeout(eval('callback'),3000); return 0; }} function fire(){ var call = location.hash.split("#")[1]; var check=timedMsg; check("123",call); }
it breaks with the same error:
convertedFunction.push(newFunction2); ^
ReferenceError: convertedFunction is not defined at Object.asignFunctionReturnValue (/jsprime-node/engine.js:149:13) at IncomingMessage.
(/jsprime-node/server.js:71:18) at emitNone (events.js:106:13) at IncomingMessage.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1064:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9)
did anyone notice similar behavior?