Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to deal with the problem of "document is not defined". #139

Open
meixufen opened this issue Aug 7, 2017 · 2 comments
Open

how to deal with the problem of "document is not defined". #139

meixufen opened this issue Aug 7, 2017 · 2 comments

Comments

@meixufen
Copy link

meixufen commented Aug 7, 2017

When I instrumented and analysed the js file use this command:
T:\github_jalangi2\experiments> node ..\src\js\commands\jalangi.js --inlineIID --inlineSource --analysis .\getbyid.js .\getid.js,
I met this problem:
ReferenceError: document is not defined
at T:\github_jalangi2\experiments\getbyid.js:5:32
at Object. (T:\github_jalangi2\experiments\getbyid.js:30:3)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at T:\github_jalangi2\src\js\commands\jalangi.js:90:9

In my getid.js, I used the statement: var element = document.getElementById('show_file_org');
how can I deal with this problem, thanks.

@zcl0203
Copy link

zcl0203 commented Sep 4, 2017

Maybe you can create a html file and execute the getid.js file in it ,the use the offline instrumentation on the whole project and this error message won't appear in the browser console.

@ZAhmaad
Copy link

ZAhmaad commented May 3, 2021

@zcl0203 Hi, I used to run my js file in html and then used the offline instrumentation on whole project by using the following command:

node src/js/commands/instrument.js --inlineIID --inlineSource -i --inlineJalangi --analysis src/js/commands/conditoncheck.js --outputDir /tmp test2/test3

The analysis works in terminal without showing any error. when i open the html file by giving the following command, It just gives the output of html file in console but not output of analysis on that file.

file:///tmp/test2/test3/new.html

Any solution in that case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants