mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 739694 - Fix script filename saving in exception traces (r=luke)
This commit is contained in:
parent
fc115012d7
commit
ee49c9a7eb
12
js/src/jit-test/tests/basic/bug739694-1.js
Normal file
12
js/src/jit-test/tests/basic/bug739694-1.js
Normal file
@ -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);\
|
||||
");
|
8
js/src/jit-test/tests/basic/bug739694-2.js
Normal file
8
js/src/jit-test/tests/basic/bug739694-2.js
Normal file
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user