зеркало из https://github.com/mozilla/pjs.git
Bug 739694 - Fix script filename saving in exception traces (r=luke)
This commit is contained in:
Родитель
c91a1cdbe5
Коммит
6555e95d2e
|
@ -0,0 +1,12 @@
|
|||
function newFunc(x) { new Function(x)(); }; try { newFunc("\
|
||||
var g = newGlobal('new-compartment');\
|
||||
g.h = function () {\
|
||||
names = foo.blaaaaaaaaaaaaah().environment.names();\
|
||||
};\
|
||||
g.eval('var obj = {a: 1};' + \"with ({a: 1, '0xcafe': 2, ' ': 3, '': 4, '0': 5}) h();\");\
|
||||
");
|
||||
} catch(exc1) {}
|
||||
function newFunc(x) { new Function(x)(); }; newFunc("\
|
||||
gczeal(2);\
|
||||
a=b=c=d=0; this.__defineGetter__('g', gc); for each (y in this);\
|
||||
");
|
|
@ -0,0 +1,8 @@
|
|||
try {
|
||||
({
|
||||
f: evalcx("evalcx(\"e\",newGlobal('new-compartment'))",
|
||||
newGlobal('new-compartment'))
|
||||
})
|
||||
} catch (e) {}
|
||||
gc()
|
||||
gc()
|
|
@ -374,7 +374,9 @@ InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message,
|
|||
frame.argc = 0;
|
||||
}
|
||||
if (fp->isScriptFrame()) {
|
||||
frame.filename = fp->script()->filename;
|
||||
frame.filename = SaveScriptFilename(cx, fp->script()->filename);
|
||||
if (!frame.filename)
|
||||
return false;
|
||||
frame.ulineno = PCToLineNumber(fp->script(), i.pc());
|
||||
} else {
|
||||
frame.ulineno = 0;
|
||||
|
|
|
@ -389,9 +389,6 @@ XDRScriptConst(XDRState<mode> *xdr, HeapValue *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
static const char *
|
||||
SaveScriptFilename(JSContext *cx, const char *filename);
|
||||
|
||||
template<XDRMode mode>
|
||||
bool
|
||||
js::XDRScript(XDRState<mode> *xdr, JSScript **scriptp, JSScript *parentScript)
|
||||
|
@ -836,8 +833,8 @@ JSScript::destroyCounts(JSContext *cx)
|
|||
* Shared script filename management.
|
||||
*/
|
||||
|
||||
static const char *
|
||||
SaveScriptFilename(JSContext *cx, const char *filename)
|
||||
const char *
|
||||
js::SaveScriptFilename(JSContext *cx, const char *filename)
|
||||
{
|
||||
JSCompartment *comp = cx->compartment;
|
||||
|
||||
|
|
|
@ -801,6 +801,9 @@ js_CallDestroyScriptHook(JSContext *cx, JSScript *script);
|
|||
|
||||
namespace js {
|
||||
|
||||
extern const char *
|
||||
SaveScriptFilename(JSContext *cx, const char *filename);
|
||||
|
||||
extern void
|
||||
MarkScriptFilename(const char *filename);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче