Commit 00c581d6 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[foozzie] Suppress Math.pow precision

BUG=chromium:693426
NOTRY=true
TBR=mstarzinger@chromium.org,jarin@chromium.org

Change-Id: If9e5611566660455543044ddff60acda1ee153ba
Reviewed-on: https://chromium-review.googlesource.com/446347Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43441}
parent 67255619
......@@ -9,12 +9,25 @@
// Suppress http://crbug.com/662429
(function () {
var __real_Math_pow = Math.pow
var oldMathPow = Math.pow
Math.pow = function(a, b){
if (b < 0) {
return 0.000017;
} else {
return __real_Math_pow(a, b);
return oldMathPow(a, b);
}
}
})();
// Suppress http://crbug.com/693426
(function () {
var oldMathPow = Math.pow
Math.pow = function(a, b){
var s = "" + oldMathPow(a, b)
// Low tech precision mock. Limit digits in string representation.
// The phrases Infinity and NaN don't match the split("e").
s = s.split("e");
s[0] = s[0].substr(0, 17);
return parseFloat(s.join("e"));
}
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment