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

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

Comments

Projects
None yet
1 participant
@arantius
Collaborator

arantius commented Aug 22, 2011

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

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Aug 22, 2011

Collaborator

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

Collaborator

arantius commented Aug 22, 2011

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

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Aug 30, 2011

Collaborator

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

Promising, but currently failing bad in Firefox 3.

Collaborator

arantius commented Aug 30, 2011

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

Promising, but currently failing bad in Firefox 3.

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Aug 30, 2011

Collaborator

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.

Collaborator

arantius commented Aug 30, 2011

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

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Sep 26, 2011

Collaborator

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

Collaborator

arantius commented Sep 26, 2011

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

@arantius arantius closed this in a2e5f15 Jul 16, 2012

arantius added a commit to arantius/greasemonkey that referenced this issue Jul 16, 2012

Fix anonymous wrapping injection.
Broke with the previous error reporting tweak.

Refs #1404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment