js/src/jit-test/tests/basic/bug686396.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/basic/bug686396.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,16 @@
     1.4 +
     1.5 +(function () { 
     1.6 +  assertEquals = function assertEquals(expected, found, name_opt) {  };
     1.7 +})();
     1.8 +function testOne(receiver, key, result) {
     1.9 +  for(var i = 0; i != 10; i++ ) {
    1.10 +    assertEquals(result, receiver[key]());
    1.11 +  }
    1.12 +}
    1.13 +function TypeOfThis() { return typeof this; }
    1.14 +Number.prototype.type = TypeOfThis;
    1.15 +String.prototype.type = TypeOfThis;
    1.16 +Boolean.prototype.type = TypeOfThis;
    1.17 +testOne(2.3, 'type', 'object');
    1.18 +testOne('x', 'type', 'object');
    1.19 +testOne(true, 'type', 'object');

mercurial