summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/latin1/function.js
blob: 07a76733a35a9c4738cc3445db1f58c372eefcdf (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.toSource().includes("arg1\u1200,arg2"), true);

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