Bug 969764: Properly carry the source's element attribute name through off-thread compilations. r=bhackett

This commit is contained in:
Jim Blandy 2014-02-09 11:00:03 -08:00
parent 72560b4770
commit 5cb4c2e154
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,24 @@
// Owning elements and attribute names are attached to scripts compiled
// off-thread.
var g = newGlobal();
var dbg = new Debugger;
var gDO = dbg.addDebuggee(g);
var elt = new g.Object;
var eltDO = gDO.makeDebuggeeValue(elt);
var log = '';
dbg.onDebuggerStatement = function (frame) {
log += 'd';
var source = frame.script.source;
assertEq(source.element, eltDO);
assertEq(source.elementAttributeName, 'mass');
};
g.offThreadCompileScript('debugger;',
{ element: elt,
elementAttributeName: 'mass' });
log += 'o';
g.runOffThreadScript();
assertEq(log, 'od');

View File

@ -4355,6 +4355,7 @@ JS::OwningCompileOptions::copy(JSContext *cx, const ReadOnlyCompileOptions &rhs)
setPrincipals(rhs.principals());
setOriginPrincipals(rhs.originPrincipals());
setElement(rhs.element());
setElementAttributeName(rhs.elementAttributeName());
return (setFileAndLine(cx, rhs.filename(), rhs.lineno) &&
setSourceMapURL(cx, rhs.sourceMapURL()) &&