82 Commits

Author SHA1 Message Date
Harry Sarson
1aa8266207
replace Object.assign with mathjs util map function.
`Object.assign` is not supported in IE 11 and is used here to perform
a shallow clone on objects. The `map` function from `utils/object.js`
can be used instead for this cloning.
2018-05-21 17:06:25 +01:00
Harry Sarson
af417d8384
add use strict to the top of a bunch of files 2018-04-27 21:28:28 +01:00
jos
99ab11b234 Dropped constant uninitialized 2018-02-04 13:09:09 +01:00
jos
ece963bcdd Merge branch 'develop' into v4
# Conflicts:
#	lib/expression/node/ConstantNode.js
2018-01-31 11:28:14 +01:00
Max Bruckner
9126130794 toTex: Escape special characters in strings 2018-01-31 02:54:24 +01:00
jos
0b6c0c13f7 Merge branch 'v4' into v4_constant_node
# Conflicts:
#	HISTORY.md
2018-01-27 16:58:17 +01:00
jos
02d7d592e4 Merged util function types.type into math.typeof (see #1023) 2018-01-25 20:21:22 +01:00
jos
cec05b59f9 Changed options lower and upper in function math.format to lowerExp and upperExp, see #676 2018-01-24 15:57:38 +01:00
jos
879e00aecd Change default precision to undefined for BigNumber formatting too. See #676 2018-01-24 14:44:36 +01:00
jos
0406b93fc6 fixed notation in function math.format no longer rounds to zero digits when no precision is specified: it leaves the digits as is. See #676. 2018-01-24 14:27:38 +01:00
mocking
1df8620145 Update function.js 2017-08-29 11:54:30 +08:00
jos
fa01e993af Refactored x && x.isMatrix === true into type.isMatrix(x), same with isDenseMatrix and isSparseMatrix 2017-08-12 13:24:39 +02:00
jos
6d418b9b61 Refactored x && x.isFraction === true into type.isFraction(x) 2017-08-12 12:05:11 +02:00
jos
e10dd5bce5 Refactored x && x.isBigNumber === true into type.isBigNumber(x) 2017-08-12 11:54:53 +02:00
jos
8c2f10a865 Fixed #915: No access to property "name" 2017-08-07 20:09:12 +02:00
jos
05e80095dc Fixed #912: math.js didn't work on IE10 anymore 2017-08-06 12:59:40 +02:00
jos
9666c16378 Fixed #846: Issues in the functions map, forEach, and filter when used in the expression parser 2017-07-29 14:05:27 +02:00
Thomas Brierley
bdb9710dcd Remove ghosting condition from isSafeProperty 2017-07-14 13:09:51 +01:00
Thomas Brierley
425e927a5f Change isSafeProperty stop ghosting natives only 2017-07-12 16:31:06 +01:00
Jos de Jong
69f3e882d7 Merge pull request #888 from ThomasBrierley/prototyped-scopes
Prototyped Scopes
2017-07-05 22:01:29 +02:00
Thomas Brierley
e8ace81449 Use 'in' on root prototype checks
Because on NodeJS <= v0.10 hasOwnProperty returns false for __proto__ on
Object.prototype. Function.prototype and Object.prototype are roots so
it should be safe to use 'in' instead.
2017-07-04 19:43:01 +01:00
Thomas Brierley
cc8b7a2f6d Remove redundant conditions and comments 2017-06-29 15:07:38 +01:00
Thomas Brierley
7951ae221e Use isSafeProperty in set/getSafeProperty 2017-06-29 15:00:40 +01:00
Thomas Brierley
955c72bebf Update isSafeProperty interface 2017-06-29 14:56:47 +01:00
Thomas Brierley
c4951c2143 Refactor isSafe checks to restore inheritance
To safely restore inherited properties and methods on plain objects e.g
with Object.create, some overly broad conditions need to be removed and
others added to more explicitly exclude unsafe properties.

isSafeMethod() has been modified as bellow, roughly the same conditions
are also now used in isSafeProperty() for get/setSafeProperty() which
previously restricted all inherited properties.

- Require __proto__ to have own-method
	Intended to prevent ghosting of class methods, but also prevents
	access to properties from further up the chain.

+ Require any own-method to not be in __proto__
	Explicitly prevents ghosting but not inheritance. Possible to
	defeat only if proto chaining through Object.create is allowed.

- Require object to not be function
	Intended to prevent unsafe function methods like 'bind', but
	also restricts function own-properties.

+ Require method not be in Function.prototype
	Explicitly prevents unsafe function methods like 'bind',
	without restricting function own properties.

Other conditions should be equivalent. The overall affect should be
that inherited properties and methods that are safe and not ghosted
should be allowed.
2017-06-29 14:53:46 +01:00
jos
0557e7ae1f Back to compareNatural WIP (see #837) 2017-06-25 21:02:59 +02:00
Jos de Jong
e98a810aef Merge pull request #869 from Nekomajin42/setopsv4
setops v4
2017-06-18 14:53:04 +02:00
Nekomajin42
9678d1a067 Change escape-goat to native escape function 2017-06-06 12:06:58 +02:00
Nekomajin42
fc9018457f setops v4
- using sort() again
- update the tests with unsorted input
2017-06-06 11:50:50 +02:00
jos
ed5f2cebaf Security fixes in isSafeMethod and some others 2017-05-27 19:51:12 +02:00
jos
5fbc8edce6 Released v3.13.2 2017-05-26 20:28:59 +02:00
jos
959b010242 Simplified isSafeMethod 2017-05-26 16:43:03 +02:00
jos
11eda850da Fixed security vulnerabilities 2017-05-12 09:01:31 +02:00
jos
73b774a51b Use safe map, forEach, join 2017-05-05 12:32:21 +02:00
jos
f1e2c2e391 Released v3.12.1 2017-04-24 21:45:53 +02:00
jos
4f9fd81fbd Merge branch 'develop' into security 2017-04-24 21:36:05 +02:00
jos
19faeac16c Escape function names and properties 2017-04-24 21:36:00 +02:00
jos
8e8e02bec9 Don't clone config itself, only it's childs 2017-04-22 20:14:52 +02:00
jos
b9c3b334e1 Refactored customs.js into a regular js file instead of factory 2017-04-22 13:04:29 +02:00
jos
bb99a83d4a Removed redundant variable assignment 2017-04-20 19:50:48 +02:00
jos
ee6efa3768 Only allow accessing/assigning properties on plain objects. Only allow calling known methods. 2017-04-08 15:32:10 +02:00
jos
42012688cb Released v3.11.4 2017-04-03 21:09:05 +02:00
jos
25db18caec Fixed a security vulnerability 2017-04-03 20:43:52 +02:00
jos
1092489440 Some refactoring 2017-04-03 01:32:15 +02:00
jos
5c4b105c7e Fixed a security vulnerability in the expression parser 2017-04-03 01:29:13 +02:00
jos
fbe6e62faf Fixed more security vulnerabilities 2017-04-02 19:51:11 +02:00
jos
ebb3c9bd0e Fixed #821, #822: security vulnerabilities in the expression parser 2017-04-02 14:57:21 +02:00
Pat Grasso
8e01076ec9 Merge branch 'matrix.reshape' into develop 2017-02-24 10:12:20 -05:00
Pat Grasso
df83968ec7 Add spec for reshape() in test/function/matrix
This spec tests `reshape()` with more cases than the one in
test/utils/array.test.js, including various types.

Also, in `_reshape()`, throw a brand new `DimensionError` instead of
modifying the caught one (the error message does not change when other
attributes are modified, as it is computed when the error is created).
2017-02-24 10:05:42 -05:00
jos
03b93c508d Fixed math.round not accepting inputs NaN, Infinity, -Infinity 2017-02-20 21:35:27 +01:00