Skip to content
This repository

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

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

1 participant

arantius
arantius
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
Collaborator

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

arantius
Collaborator

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

Promising, but currently failing bad in Firefox 3.

arantius
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.

arantius
Collaborator

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

arantius arantius closed this issue from a commit July 16, 2012
arantius Report errors correctly.
Pass file name and line number to evalInSandbox, just catch and fix in-line errors.

Fixes #1404
a2e5f15
arantius arantius closed this in a2e5f15 July 16, 2012
arantius arantius referenced this issue from a commit in arantius/greasemonkey July 16, 2012
arantius Fix anonymous wrapping injection.
Broke with the previous error reporting tweak.

Refs #1404
986f500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.