summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/latin1/function.js
blob: 37c74fefbcd1547879712fbe6959d7ecc6265692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function test() {
    var arg1TwoByte = "arg1\u1200";
    var arg2Latin1 = "arg2";

    var bodyLatin1 = "return arg2 * 3";

    var f = Function(arg1TwoByte, arg2Latin1, bodyLatin1);
    assertEq(f(10, 20), 60);
    assertEq(f.toString().includes("arg1\u1200,arg2"), true);

    var bodyTwoByte = "return arg1\u1200 + arg2;";
    f = Function(arg1TwoByte, arg2Latin1, bodyTwoByte);
    assertEq(f(30, 40), 70);
    assertEq(f.toString().includes("arg1\u1200,arg2"), true);
}
test();