Skip to content

Commit f07b32d

Browse files
committed
add test for indirect eval
1 parent 70214f0 commit f07b32d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
6+
*/
7+
/*
8+
* Test otherwise untested indirect eval.
9+
*/
10+
11+
load('../assert.js');
12+
13+
var indirecteval = eval;
14+
assertSame(42, indirecteval(42));
15+
assertSame(42n, indirecteval(42n));
16+
assertSame(42, indirecteval(Debug.createSafeInteger(42)));
17+
assertSame(42.5, indirecteval(42.5));
18+
assertSame(true, indirecteval(true));
19+
20+
var symbol = Symbol('test');
21+
assertSame(symbol, indirecteval(symbol));
22+
23+
var obj = {foo:'bar'};
24+
assertSame(obj, indirecteval(obj));
25+
26+
true;

0 commit comments

Comments
 (0)