mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 981987 - Set displayURL before invoking Debugger.onNewScript hook. r=jimb
This commit is contained in:
parent
6ee4111bff
commit
ef1343ad6b
@ -614,6 +614,12 @@ CompileFunctionBody(JSContext *cx, MutableHandleFunction fun, const ReadOnlyComp
|
||||
if (!NameFunctions(cx, fn))
|
||||
return false;
|
||||
|
||||
if (!SetDisplayURL(cx, parser.tokenStream, ss))
|
||||
return false;
|
||||
|
||||
if (!SetSourceMap(cx, parser.tokenStream, ss))
|
||||
return false;
|
||||
|
||||
if (fn->pn_funbox->function()->isInterpreted()) {
|
||||
JS_ASSERT(fun == fn->pn_funbox->function());
|
||||
|
||||
@ -647,12 +653,6 @@ CompileFunctionBody(JSContext *cx, MutableHandleFunction fun, const ReadOnlyComp
|
||||
JS_ASSERT(IsAsmJSModuleNative(fun->native()));
|
||||
}
|
||||
|
||||
if (!SetDisplayURL(cx, parser.tokenStream, ss))
|
||||
return false;
|
||||
|
||||
if (!SetSourceMap(cx, parser.tokenStream, ss))
|
||||
return false;
|
||||
|
||||
if (!sct.complete())
|
||||
return false;
|
||||
|
||||
|
@ -69,3 +69,23 @@ g.evaluate('function f() {}\n' +
|
||||
{displayURL: 'http://example.com/bar.js'});
|
||||
assertEq(getDisplayURL(), 'http://example.com/foo.js');
|
||||
|
||||
|
||||
// Bug 981987 reported that we hadn't set sourceURL yet when firing onNewScript
|
||||
// from the Function constructor.
|
||||
var capturedScript;
|
||||
var capturedDisplayURL;
|
||||
var capturedSourceMapURL;
|
||||
dbg.onNewScript = function (script) {
|
||||
capturedScript = script;
|
||||
capturedDisplayURL = script.source.displayURL;
|
||||
capturedSourceMapURL = script.sourceMapURL;
|
||||
dbg.onNewScript = undefined;
|
||||
};
|
||||
var fun = gw.makeDebuggeeValue(g.Function('//# sourceURL=munge.js\n//# sourceMappingURL=grunge.map\n'));
|
||||
assertEq(capturedScript, fun.script);
|
||||
|
||||
assertEq(capturedDisplayURL, fun.script.source.displayURL);
|
||||
assertEq(capturedDisplayURL, 'munge.js');
|
||||
|
||||
assertEq(capturedSourceMapURL, fun.script.sourceMapURL);
|
||||
assertEq(capturedSourceMapURL, 'grunge.map');
|
||||
|
Loading…
Reference in New Issue
Block a user