Home | History | Annotate | Download | only in clusterfuzz
      1 // Copyright 2016 the V8 project authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // This file is loaded before each correctness test case and after v8_mock.js.
      6 // You can temporarily change JS behavior here to silence known problems.
      7 // Please refer to a bug in a comment and remove the suppression once the
      8 // problem is fixed.
      9 
     10 // Suppress http://crbug.com/662429
     11 (function () {
     12   var oldMathPow = Math.pow
     13   Math.pow = function(a, b){
     14     if (b < 0) {
     15       return 0.000017;
     16     } else {
     17       return oldMathPow(a, b);
     18     }
     19   }
     20 })();
     21 
     22 // Suppress http://crbug.com/693426
     23 (function () {
     24   var oldMathPow = Math.pow
     25   Math.pow = function(a, b){
     26     var s = "" + oldMathPow(a, b)
     27     // Low tech precision mock. Limit digits in string representation.
     28     // The phrases Infinity and NaN don't match the split("e").
     29     s = s.split("e");
     30     s[0] = s[0].substr(0, 17);
     31     return parseFloat(s.join("e"));
     32   }
     33 })();
     34