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

Use the fileName / lineNumber parameters to evalInSandbox() #1404

Closed
arantius opened this issue Aug 22, 2011 · 4 comments
Closed

Use the fileName / lineNumber parameters to evalInSandbox() #1404

arantius opened this issue Aug 22, 2011 · 4 comments
Milestone

Comments

@arantius
Copy link
Collaborator

From: #1396
See: #1396 (comment)

Couldn't we use the last two arguments for Components.utils.evalInSandbox detailed here?

So the call in modules/runScript.js would look something like:

Components.utils.evalInSandbox(code, sandbox, maxJSVersion, filename, 1);

We could loop through all the @requires and eval each one individually, that way those filenames and line numbers are preserved as well. Then finally we would eval the script. Is there some reason this wouldn't work?

@arantius
Copy link
Collaborator Author

This would probably involve un-doing the "first line eval" module I added in #1396, because it would be obsolete.

@arantius
Copy link
Collaborator Author

First attempt:
arantius/greasemonkey@master...eval-file-lines-1404

Promising, but currently failing bad in Firefox 3.

@arantius
Copy link
Collaborator Author

Also: https://gist.github.com/1154205

A test script that just triggers a variety of error conditions. Feedback please if you know of other failure modes, especially ones that are handled poorly by current error reporting logic. In Firefox 4+ my existing branch seems to handle all these cases. Including (quite surprisingly) the old "var sidebar;" thing that made us keep wrapper functions last time.

@arantius
Copy link
Collaborator Author

This may be obsoleted by webby execution mode (see 1.0 milestone).

arantius added a commit to arantius/greasemonkey that referenced this issue Jul 16, 2012
Broke with the previous error reporting tweak.

Refs greasemonkey#1404
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

1 participant