mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-11-08 17:21:02 +00:00
14 lines
345 B
JavaScript
14 lines
345 B
JavaScript
|
|
test("basic that non-strict direct eval() prevents non-local access caching", () => {
|
||
|
|
function foo(do_eval) {
|
||
|
|
var c = 1;
|
||
|
|
function bar(do_eval) {
|
||
|
|
if (do_eval) eval("var c = 2;");
|
||
|
|
return c;
|
||
|
|
}
|
||
|
|
return bar(do_eval);
|
||
|
|
}
|
||
|
|
|
||
|
|
expect(foo(false)).toBe(1);
|
||
|
|
expect(foo(true)).toBe(2);
|
||
|
|
});
|