Bug 772113: Expose source map URLs via Debugger.Script r=jimb
This commit is contained in:
@@ -34,6 +34,16 @@ CheckLength(JSContext *cx, size_t length)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
SetSourceMap(JSContext *cx, TokenStream &tokenStream, ScriptSource *ss, JSScript *script)
|
||||
{
|
||||
if (tokenStream.hasSourceMap()) {
|
||||
if (!ss->setSourceMap(cx, tokenStream.releaseSourceMap(), script->filename))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
JSScript *
|
||||
frontend::CompileScript(JSContext *cx, HandleObject scopeChain, StackFrame *callerFrame,
|
||||
const CompileOptions &options,
|
||||
@@ -195,8 +205,8 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain, StackFrame *call
|
||||
parser.freeTree(pn);
|
||||
}
|
||||
|
||||
if (tokenStream.hasSourceMap())
|
||||
ss->setSourceMap(tokenStream.releaseSourceMap());
|
||||
if (!SetSourceMap(cx, tokenStream, ss, script))
|
||||
return NULL;
|
||||
|
||||
#if JS_HAS_XML_SUPPORT
|
||||
/*
|
||||
@@ -332,8 +342,8 @@ frontend::CompileFunctionBody(JSContext *cx, HandleFunction fun, CompileOptions
|
||||
pn = fn->pn_body;
|
||||
}
|
||||
|
||||
if (parser.tokenStream.hasSourceMap())
|
||||
ss->setSourceMap(parser.tokenStream.releaseSourceMap());
|
||||
if (!SetSourceMap(cx, parser.tokenStream, ss, script))
|
||||
return false;
|
||||
|
||||
if (!EmitFunctionScript(cx, &funbce, pn))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user