BUG for call from Number.prototype.anyMethod

Expect to use Decimal.prototype.toFixed replace the original method
```javascript
(function() {
	var originalToFixed = Number.prototype.toFixed;
	Number.prototype.toFixed = function(decimal) {
		if (window.Decimal && Decimal.prototype.toFixed) { 
			return new Decimal(this).toFixed(decimal);
		} else {
			return originalToFixed(this, decimal);
		}
	};
)();
```
TestCode
(2).toFixed(2); 
will be run to line 4340 thrown error '[DecimalError] Invalid argument: 2'
because line 4290 test typeof v returned 'object'
pull/146/head
zhaohuihua 4 years ago committed by GitHub
parent 5a6e1384d8
commit 07b8ae1437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4289,7 +4289,7 @@
t = typeof v;
if (t === 'number') {
if (t === 'number' || v instanceof Number) {
if (v === 0) {
x.s = 1 / v < 0 ? -1 : 1;
x.e = 0;

Loading…
Cancel
Save