Temporarily mimic shift/unshift methods to workaround Safari/Webkit bug #122
As we know from https://bugs.webkit.org/show_bug.cgi?id=170264
It seems to be in limbo when and if this is going to be resolved soon by Apple.
As we know this greatly affects bignumber.js in current iOS and Safari browsers.
Most notably affected is the infinite loop in the division function, #120.
Reading your comment #120 (comment)
As a temporary workaround to help libraries downstream, could we mimic the
This would ensure we don't encounter any unexpected results due to the webkit bug.
Splice seems to behave normally in buggy webkit and produces the same result as a shift.
var arr = [0, 2147483648]; arr.splice(0, 1); arr = 1; // This will evaluate true in Safari and is expected expect(arr).toEqual([2147483648, 1])
The test suites seem to pass ok locally
While the changes fixed the infinite loop, I noticed the browser test files when run locally on Safari failed.
This indicated other areas of this library had been affected and compromised by the WebKit bug.
I isolated this to the