mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 979094 - Fix ending location of variable declaration. r=jimb
This commit is contained in:
parent
bc8ad13bd6
commit
19e44cb300
@ -3925,6 +3925,8 @@ Parser<ParseHandler>::variables(ParseNodeKind kind, bool* psimple,
|
||||
if (!data.binder(&data, name, this))
|
||||
return null();
|
||||
}
|
||||
|
||||
handler.setEndPosition(pn, pn2);
|
||||
} while (false);
|
||||
|
||||
bool matched;
|
||||
|
@ -18,4 +18,4 @@ global.eval("function f(n){var w0,x1=3,y2=4,z3=9} debugger;");
|
||||
global.f(3);
|
||||
|
||||
// Should have hit each variable declared.
|
||||
assertEq(global.log, "18 21 26 31 33 ");
|
||||
assertEq(global.log, "18 21 26 31 35 ");
|
||||
|
@ -17,4 +17,4 @@ global.log = '';
|
||||
global.eval("function f(n){var o={a:1,b:2,c:3}} debugger;");
|
||||
global.f(3);
|
||||
// Should hit each property in the object.
|
||||
assertEq(global.log, "18 21 25 29 19 ");
|
||||
assertEq(global.log, "18 21 25 29 33 ");
|
||||
|
@ -17,4 +17,4 @@ global.log = '';
|
||||
global.eval("function f(n){var a=[1,2,n]} debugger;");
|
||||
global.f(3);
|
||||
// Should hit each item in the array.
|
||||
assertEq(global.log, "18 21 23 25 19 ");
|
||||
assertEq(global.log, "18 21 23 25 27 ");
|
||||
|
23
js/src/jit-test/tests/debug/Script-lineCount.js
Normal file
23
js/src/jit-test/tests/debug/Script-lineCount.js
Normal file
@ -0,0 +1,23 @@
|
||||
// Test Script.lineCount.
|
||||
|
||||
var g = newGlobal();
|
||||
var dbg = Debugger(g);
|
||||
|
||||
function test(scriptText, expectedLineCount) {
|
||||
let found = false;
|
||||
|
||||
dbg.onNewScript = function(script, global) {
|
||||
assertEq(script.lineCount, expectedLineCount);
|
||||
found = true;
|
||||
};
|
||||
|
||||
g.evaluate(scriptText);
|
||||
assertEq(found, true);
|
||||
}
|
||||
|
||||
src = 'var a = (function(){\n' + // 0
|
||||
'var b = 9;\n' + // 1
|
||||
'console.log("x", b);\n'+ // 2
|
||||
'return b;\n' + // 3
|
||||
'})();\n'; // 4
|
||||
test(src, 5);
|
Loading…
Reference in New Issue
Block a user