~ubuntu-branches/ubuntu/saucy/mozjs17/saucy

« back to all changes in this revision

Viewing changes to js/src/jit-test/tests/basic/typeMonitorCall.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* Make sure we are checking argument types when going through unknown but monomorphic call sites. */
 
3
 
 
4
function foo(x) {
 
5
  return x + 10;
 
6
}
 
7
 
 
8
var array = [1,2,3,4,5,6,7,"eight"];
 
9
 
 
10
/* Jump through hoops to make 'f' unknown. */
 
11
var f = this[eval("'foo'")];
 
12
 
 
13
for (var i = 0; i < array.length; i++) {
 
14
  var res = f(array[i]);
 
15
  if (i != 7)
 
16
    assertEq(res, i + 11);
 
17
  else
 
18
    assertEq(res, "eight10");
 
19
}