Skip to content
File

Blob: src/workerd/api/tests/experimental-eval-test.js

javascript16 lines
1// Copyright (c) 2025 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4import { strictEqual } from 'node:assert';
5 
6strictEqual(eval('1 + 1'), 2);
7 
8export const evalTest = {
9 test(_ctrl, env) {
10 strictEqual(eval('1 + 1'), 2);
11 
12 const fn = new Function('a', 'b', 'return a + b;');
13 strictEqual(fn(2, 3), 5);
14 },
15};