summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/testAddStringObject.js
blob: 0ed0288e6cbb1212a90e7536d1309dcf4cccf6bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
String.prototype.m = function(s) {
    return this.indexOf('a');
};

var g = function(s) {
    return (s + 'asdf').m();
};

var h = function(s) {
    return ('asdf' + s).m();
};

var ix = g(new String('abc'));
assertEq(ix, 0);

var ix = h(new String('abc'));
assertEq(ix, 0);