ladybird/Userland/Libraries/LibJS/Tests/eval-basic.js

11 lines
201 B
JavaScript
Raw Normal View History

test("basic eval() functionality", () => {
expect(eval("1 + 2")).toBe(3);
function foo(a) {
var x = 5;
eval("x += a");
return x;
}
expect(foo(7)).toBe(12);
});