Bug 779233 - Put a script's filename on the ScriptSource. r=billm
This commit is contained in:
@@ -41,7 +41,7 @@ static bool
|
||||
SetSourceMap(JSContext *cx, TokenStream &tokenStream, ScriptSource *ss, RawScript script)
|
||||
{
|
||||
if (tokenStream.hasSourceMap()) {
|
||||
if (!ss->setSourceMap(cx, tokenStream.releaseSourceMap(), script->filename))
|
||||
if (!ss->setSourceMap(cx, tokenStream.releaseSourceMap(), script->filename()))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -105,6 +105,8 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain,
|
||||
ScriptSource *ss = cx->new_<ScriptSource>();
|
||||
if (!ss)
|
||||
return NULL;
|
||||
if (options.filename && !ss->setFilename(cx, options.filename))
|
||||
return NULL;
|
||||
ScriptSourceHolder ssh(ss);
|
||||
SourceCompressionToken mysct(cx);
|
||||
SourceCompressionToken *sct = (extraSct) ? extraSct : &mysct;
|
||||
@@ -324,6 +326,8 @@ frontend::CompileFunctionBody(JSContext *cx, HandleFunction fun, CompileOptions
|
||||
ScriptSource *ss = cx->new_<ScriptSource>();
|
||||
if (!ss)
|
||||
return false;
|
||||
if (options.filename && !ss->setFilename(cx, options.filename))
|
||||
return false;
|
||||
ScriptSourceHolder ssh(ss);
|
||||
SourceCompressionToken sct(cx);
|
||||
JS_ASSERT(options.sourcePolicy != CompileOptions::LAZY_SOURCE);
|
||||
|
||||
Reference in New Issue
Block a user