jsprime icon indicating copy to clipboard operation
jsprime copied to clipboard

asignFunctionReturnValue in engine.js is not working

Open sriabhijeet opened this issue 11 years ago • 5 comments

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.

sriabhijeet avatar Jan 21 '14 09:01 sriabhijeet

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)

ben-eb avatar Jun 30 '14 11:06 ben-eb

Add exports.convertedFunction=convertedFunction; in analyzer.js

TejaswiniU avatar Dec 28 '18 06:12 TejaswiniU

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.

mari0x00 avatar Mar 06 '19 14:03 mari0x00

@marcyss screen shot 2019-03-07 at 3 22 21 pm Can you check this

TejaswiniU avatar Mar 07 '19 09:03 TejaswiniU

@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?

mari0x00 avatar Mar 07 '19 10:03 mari0x00