PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/js/src/jit-test/tests/jaeger/testAddStringObject.js

http://github.com/zpao/v8monkey
JavaScript | 17 lines | 13 code | 4 blank | 0 comment | 0 complexity | 5eddb1000686eb63ec19fa6803a4e82b MD5 | raw file
 1String.prototype.m = function(s) {
 2    return this.indexOf('a');
 3};
 4
 5var g = function(s) {
 6    return (s + 'asdf').m();
 7};
 8
 9var h = function(s) {
10    return ('asdf' + s).m();
11};
12
13var ix = g(new String('abc'));
14assertEq(ix, 0);
15
16var ix = h(new String('abc'));
17assertEq(ix, 0);