1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 13:37:10 +09:00
ladybird/Libraries/LibJS/Tests/permanently-screwed-by-eval.js

13 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);
});