71 Commits

Author SHA1 Message Date
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
patgrasso
431d58ac4e Fix issue with thrown exceptions on edge cases
Return DimensionError when `sizes = []` and a TypeError if either type
presented is incorrect.
2016-10-15 21:28:00 -04:00
patgrasso
014e0e3ec0 Introduce reshape() to utils.array
`reshape()` takes an n-d array and a list of sizes for each dimension,
and fits the data into the specified shape. If the product of the sizes
of the new dimensions does not match that of the old, a DimensionError
is thrown.
2016-10-15 20:36:23 -04:00
jos
b016385fe0 Fixed #665: functions map, forEach, and filter now invoke callbacks which are a typed-function with the correct number of arguments 2016-05-18 22:10:34 +02:00
jos
e9eda030ee Fixed matrix.subset mutating the replacement matrix when unsqueezing it 2016-04-26 09:11:59 +02:00
jos
b60fa54d43 Fixed #645: Added documentation about engineering notation of function math.format 2016-04-11 20:28:47 +02:00
jos
bbfa7d51df Fixed #484, #555: inaccuracy of math.sinh. Also using ES6 Math functions when available 2016-04-03 13:47:57 +02:00
jos
b3c1d63133 Throw an error when functions min, max, mean, or median are invoked with multiple matrices as arguments (see #598) 2016-03-24 21:22:33 +01:00
jos
41949b2253 Fixed IndexError not always providing a max property 2016-02-29 20:41:52 +01:00
jos
a1d91e0f84 Implemented nearly equal comparison for relational functions (equal, larger, smaller, etc.) when using BigNumbers 2016-02-28 14:03:40 +01:00
jos
fb141fb885 Merge branch 'decimal_v5' into develop
Conflicts:
	HISTORY.md
	test/function/trigonometry/cot.test.js
2016-02-27 11:39:56 +01:00
jos
e0c82f1b01 Removed a few redundant clone operations 2016-02-26 21:08:37 +01:00