4118 Commits

Author SHA1 Message Date
Thomas Brierley
bdb9710dcd Remove ghosting condition from isSafeProperty 2017-07-14 13:09:51 +01:00
Jos de Jong
b70ba60850 Merge pull request #899 from ThomasBrierley/prototyped-scopes
Update isSafeProperty ghosting
2017-07-13 21:29:28 +02:00
Thomas Brierley
ac002370bd Add test for ghosting custom properties 2017-07-12 16:36:06 +01:00
Thomas Brierley
fe0b993e72 Fix security test, fails on length first 2017-07-12 16:33:31 +01:00
Thomas Brierley
425e927a5f Change isSafeProperty stop ghosting natives only 2017-07-12 16:31:06 +01:00
jos
469e6bf3cf Fixed #895: added support for the dollar character $ in symbol names 2017-07-10 20:29:30 +02:00
Eric Mansfield
58919e5b14 Merge pull request #3 from josdejong/develop
Develop
2017-07-06 20:40:49 -06:00
Jos de Jong
69f3e882d7 Merge pull request #888 from ThomasBrierley/prototyped-scopes
Prototyped Scopes
2017-07-05 22:01:29 +02:00
jos
c8c4bd9b90 Released v3.14.2 v3.14.2 2017-07-05 21:45:42 +02:00
jos
b8b76cd5b7 Fixed #891: using BigNumbers not working in browser environments 2017-07-05 21:42:37 +02:00
Thomas Brierley
1dd67cd591 Fix undefined isSafeProperty test + comment 2017-07-04 20:03:06 +01:00
Thomas Brierley
7d6c583629 Add isSafeProperty unit tests 2017-07-04 19:43:05 +01: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
jos
94b813e168 Revert to webpack 2.6 for now (need to drop support for node 0.10) 2017-07-02 14:24:44 +02:00
jos
dedd2a1ed8 Upgraded to webpack 3 2017-07-02 14:04:40 +02:00
jos
4110d69463 Upgraded to fraction.js@4.0.2 2017-06-30 16:45:18 +02:00
jos
8bf16778f0 Released v3.14.1 v3.14.1 2017-06-30 15:12:16 +02:00
jos
7706d41377 Reverted to fraction.js@4.0.0, there is an issue with 4.0.1 2017-06-30 15:05:24 +02:00
jos
c68bb116a2 Fixed indentation in example 2017-06-30 14:42:08 +02:00
jos
e1e24d65b4 Released v3.14.0 v3.14.0 2017-06-30 14:34:15 +02:00
jos
485cb88866 Use getSafeProperty in help 2017-06-30 14:27:28 +02:00
jos
142e200992 Added docs for set functions to the expression parser 2017-06-30 12:04:47 +02:00
jos
9572413f44 Merge remote-tracking branch 'origin/develop' into develop 2017-06-30 11:46:28 +02:00
jos
d62f433912 Upgraded to decimal.js@7.2.3 2017-06-30 11:46:19 +02:00
Jos de Jong
000b748108 Merge pull request #889 from HarrySarson/single-quotes
Syntax error includes hint if single quotes are used for a string
2017-06-30 11:38:47 +02:00
jos
5b49cf8b0a Fixed broken gulp script 2017-06-30 11:36:21 +02:00
jos
6bbff5f54f Improved natural sorting for numeric types, matrix types, and objects 2017-06-30 11:16:42 +02:00
jos
96674094d6 Compare numeric types first by value, then by type 2017-06-30 10:02:26 +02:00
Harry Sarson
43ae05bbc5 remove " from end of error message 2017-06-29 23:55:44 +01:00
Harry Sarson
291b96d83e Syntax error includes hint if single quotes are used for a string 2017-06-29 23:49:16 +01:00
Thomas Brierley
badc6efc1a Update tests for isSafe changes
+ Fix "calling Function via Object.assign" test. Now fails on accesing
"bind" first because new implementation is a bit more restrictive.

+ Fix "extend the class instance". Custom methods on instances are now
allowed and ghosting (overridding) is explicitly not.

+ Add ghosting tests for class instances and plain objects.
2017-06-29 15:53:49 +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
aaa609d046 Fixed wrong function name of map.transform.js 2017-06-26 19:12:53 +02:00
jos
0557e7ae1f Back to compareNatural WIP (see #837) 2017-06-25 21:02:59 +02:00
jos
08695ef1c7 Use strict unequal in xor 2017-06-24 20:38:25 +02:00
jos
3545d9000e Fixed undefined Unit in SymbolNode 2017-06-24 15:14:01 +02:00
jos
af58fd2294 Decouple SymbolNode from Unit 2017-06-24 14:55:12 +02:00
jos
16b0d620a1 Removed redundant dependency on math 2017-06-24 13:43:21 +02:00
jos
ae7728a1d4 Renamed compareNatural to deepStrictCompare 2017-06-23 13:50:27 +02:00
jos
033735c5e2 Implemented support for all types in compareNatural 2017-06-23 13:40:38 +02:00
jos
d68dc503c9 Reverted versions of webpack and uglify-js (breaks build, requires some adjustment in the build script) 2017-06-20 20:55:07 +02:00
jos
d85f54cf77 Reverted ordering of complex numbers in relational functions. Use natural sort in set functions (See #837) 2017-06-18 21:42:55 +02:00
jos
151bc655d6 Implemented a first version of math.compareNatural 2017-06-18 21:13:31 +02:00
Jos de Jong
ac2a5423f3 Merge pull request #878 from HarrySarson/document-global
Clarify name of global variable in docs
2017-06-18 20:10:07 +02:00
Harry Sarson
d4afee3474 clarify name of global variable in docs 2017-06-18 18:45:23 +01:00
jos
b5f8c952fd Reverted to tar@2.2.1 to keep compatibility with node 0.10 2017-06-18 18:17:39 +02:00
jos
3445c9aae2 Upgraded dependencies 2017-06-18 16:09:14 +02:00