Debian Codegraph @

js/src/jit-test/tests/cacheir/string-concat-null-undef.js

raw
1 function test() {
2 var nullUndefLhs = [
3 [null, "foo", "nullfoo"],
4 [null, "bar", "nullbar"],
5 [null, "123", "null123"],
6 [null, "", "null"],
7 [undefined, "abc", "undefinedabc"],
8 [undefined, "1", "undefined1"],
9 [undefined, "", "undefined"],
10 ["abc", "def", "abcdef"],
11 ];
12 for (var [lhs, rhs, expected] of nullUndefLhs) {
13 assertEq(lhs + rhs, expected);
14 }
15 var nullUndefRhs = [
16 ["foo", undefined, "fooundefined"],
17 ["bar", undefined, "barundefined"],
18 ["123", undefined, "123undefined"],
19 ["", undefined, "undefined"],
20 ["abc", null, "abcnull"],
21 ["1", null, "1null"],
22 ["", null, "null"],
23 ["abc", "def", "abcdef"],
24 ];
25 for (var [lhs, rhs, expected] of nullUndefRhs) {
26 assertEq(lhs + rhs, expected);
27 }
28 }
29 test();
30 test();
31 test();