Backed out changeset 0a308311d9a7 (bug 1056409) for wrong commit message on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2014-10-01 17:16:42 +02:00
Родитель b4f9648437
Коммит d78e27f881
8 изменённых файлов: 44 добавлений и 42 удалений

Просмотреть файл

@ -46,7 +46,7 @@ window.onload = function () {
});
ok(scripts.length > 0, "Should be able to find script");
is(scripts[0].source.sourceMapURL, "foo.js.map");
is(scripts[0].sourceMapURL, "foo.js.map");
SimpleTest.finish();
}

Просмотреть файл

@ -115,6 +115,17 @@ from its prototype:
: This is `true` if this script's code is ECMAScript strict mode code, and
`false` otherwise.
`sourceMapURL`
: If this script was produced by a minimizer or translated from some other
language, and we know the URL of a <b>source map</b> document relating
the source positions in this script to the corresponding source
positions in the original source, then this property's value is that
URL. Otherwise, this is `null`.
(On the web, the translator may provide the source map URL in a
specially formatted comment in the JavaScript source code, or via a
header in the HTTP reply that carried the generated JavaScript.)
## Function Properties of the Debugger.Script Prototype Object
The functions described below may only be called with a `this` value

Просмотреть файл

@ -74,17 +74,6 @@ from its prototype:
`url` accessor on `Debugger.Source` instances for such sources should
return `undefined`.)
`sourceMapURL`
: If this source was produced by a minimizer or translated from some other
language, and we know the URL of a <b>source map</b> document relating
the source positions in this source to the corresponding source
positions in the original source, then this property's value is that
URL. Otherwise, this is `null`.
(On the web, the translator may provide the source map URL in a
specially formatted comment in the JavaScript source code, or via a
header in the HTTP reply that carried the generated JavaScript.)
`element`
: The [`Debugger.Object`][object] instance referring to the DOM element to which
this source code belongs, if any, or `undefined` if it belongs to no DOM

Просмотреть файл

@ -1,4 +1,4 @@
// Source.prototype.sourceMapURL can be a string or null.
// Script.prototype.sourceMapURL can be a string or null.
let g = newGlobal();
let dbg = new Debugger;
@ -6,7 +6,7 @@ let gw = dbg.addDebuggee(g);
function getSourceMapURL() {
let fw = gw.makeDebuggeeValue(g.f);
return fw.script.source.sourceMapURL;
return fw.script.sourceMapURL;
}
// Without a source map
@ -21,7 +21,7 @@ assertEq(getSourceMapURL(), 'file:///var/foo.js.map');
let fired = false;
dbg.onDebuggerStatement = function (frame) {
fired = true;
assertEq(frame.script.source.sourceMapURL, 'file:///var/bar.js.map');
assertEq(frame.script.sourceMapURL, 'file:///var/bar.js.map');
};
g.evaluate('(function () { (function () { debugger; })(); })();',
{sourceMapURL: 'file:///var/bar.js.map'});

Просмотреть файл

@ -1,4 +1,4 @@
// Source.prototype.sourceMapURL can be a string or null.
// Script.prototype.sourceMapURL can be a string or null.
let g = newGlobal();
let dbg = new Debugger;
@ -6,7 +6,7 @@ let gw = dbg.addDebuggee(g);
function getSourceMapURL() {
let fw = gw.makeDebuggeeValue(g.f);
return fw.script.source.sourceMapURL;
return fw.script.sourceMapURL;
}
// Without a source map
@ -21,7 +21,7 @@ assertEq(getSourceMapURL(), 'file:///var/foo.js.map');
let fired = false;
dbg.onDebuggerStatement = function (frame) {
fired = true;
assertEq(frame.script.source.sourceMapURL, 'file:///var/bar.js.map');
assertEq(frame.script.sourceMapURL, 'file:///var/bar.js.map');
};
g.evaluate('(function () { (function () { debugger; })(); })();',
{sourceMapURL: 'file:///var/bar.js.map'});

Просмотреть файл

@ -78,7 +78,7 @@ var capturedSourceMapURL;
dbg.onNewScript = function (script) {
capturedScript = script;
capturedDisplayURL = script.source.displayURL;
capturedSourceMapURL = script.source.sourceMapURL;
capturedSourceMapURL = script.sourceMapURL;
dbg.onNewScript = undefined;
};
var fun = gw.makeDebuggeeValue(g.Function('//# sourceURL=munge.js\n//# sourceMappingURL=grunge.map\n'));
@ -87,5 +87,5 @@ assertEq(capturedScript, fun.script);
assertEq(capturedDisplayURL, fun.script.source.displayURL);
assertEq(capturedDisplayURL, 'munge.js');
assertEq(capturedSourceMapURL, fun.script.source.sourceMapURL);
assertEq(capturedSourceMapURL, fun.script.sourceMapURL);
assertEq(capturedSourceMapURL, 'grunge.map');

Просмотреть файл

@ -3204,6 +3204,26 @@ DebuggerScript_getStaticLevel(JSContext *cx, unsigned argc, Value *vp)
return true;
}
static bool
DebuggerScript_getSourceMapUrl(JSContext *cx, unsigned argc, Value *vp)
{
THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get sourceMapURL)", args, obj, script);
ScriptSource *source = script->scriptSource();
JS_ASSERT(source);
if (source->hasSourceMapURL()) {
JSString *str = JS_NewUCStringCopyZ(cx, source->sourceMapURL());
if (!str)
return false;
args.rval().setString(str);
} else {
args.rval().setNull();
}
return true;
}
static bool
DebuggerScript_getGlobal(JSContext *cx, unsigned argc, Value *vp)
{
@ -3934,6 +3954,7 @@ static const JSPropertySpec DebuggerScript_properties[] = {
JS_PSG("sourceStart", DebuggerScript_getSourceStart, 0),
JS_PSG("sourceLength", DebuggerScript_getSourceLength, 0),
JS_PSG("staticLevel", DebuggerScript_getStaticLevel, 0),
JS_PSG("sourceMapURL", DebuggerScript_getSourceMapUrl, 0),
JS_PSG("global", DebuggerScript_getGlobal, 0),
JS_PS_END
};
@ -4201,24 +4222,6 @@ DebuggerSource_getIntroductionType(JSContext *cx, unsigned argc, Value *vp)
return true;
}
static bool
DebuggerSource_getSourceMapUrl(JSContext *cx, unsigned argc, Value *vp)
{
THIS_DEBUGSOURCE_REFERENT(cx, argc, vp, "(get sourceMapURL)", args, obj, sourceObject);
ScriptSource *ss = sourceObject->source();
if (ss->hasSourceMapURL()) {
JSString *str = JS_NewUCStringCopyZ(cx, ss->sourceMapURL());
if (!str)
return false;
args.rval().setString(str);
} else {
args.rval().setNull();
}
return true;
}
static const JSPropertySpec DebuggerSource_properties[] = {
JS_PSG("text", DebuggerSource_getText, 0),
JS_PSG("url", DebuggerSource_getUrl, 0),
@ -4228,7 +4231,6 @@ static const JSPropertySpec DebuggerSource_properties[] = {
JS_PSG("introductionOffset", DebuggerSource_getIntroductionOffset, 0),
JS_PSG("introductionType", DebuggerSource_getIntroductionType, 0),
JS_PSG("elementAttributeName", DebuggerSource_getElementProperty, 0),
JS_PSG("sourceMapURL", DebuggerSource_getSourceMapUrl, 0),
JS_PS_END
};

Просмотреть файл

@ -4977,7 +4977,7 @@ ThreadSources.prototype = {
* of an array of source actors for those.
*/
sourcesForScript: function (aScript) {
if (!this._useSourceMaps || !aScript.source.sourceMapURL) {
if (!this._useSourceMaps || !aScript.sourceMapURL) {
return resolve([this._sourceForScript(aScript)].filter(isNotNull));
}
@ -5004,8 +5004,8 @@ ThreadSources.prototype = {
* |aScript| must have a non-null sourceMapURL.
*/
sourceMap: function (aScript) {
dbg_assert(aScript.source.sourceMapURL, "Script should have a sourceMapURL");
let sourceMapURL = this._normalize(aScript.source.sourceMapURL, aScript.url);
dbg_assert(aScript.sourceMapURL, "Script should have a sourceMapURL");
let sourceMapURL = this._normalize(aScript.sourceMapURL, aScript.url);
let map = this._fetchSourceMap(sourceMapURL, aScript.url)
.then(aSourceMap => this.saveSourceMap(aSourceMap, aScript.url));
this._sourceMapsByGeneratedSource[aScript.url] = map;