Commit Graph

27 Commits

Author SHA1 Message Date
Kenneth Geisshirt 28f9e027b5
Fixing unit tests (discovered on Android). (#1523)
* Fixing unit tests (discovered on Android).
2017-12-01 13:00:02 +01:00
Thomas Goyne 643c19ea75 Add support for aggregates on arrays of primitives (#1401)
* Fix an unused variable warning in js_sync.hpp
* Add support for aggregates on arrays of primitives
* Update documentation and typescript declarations
* Update collection.js
2017-10-11 14:54:52 +02:00
Kenneth Geisshirt e109e32ac4 Merge branch 'master' of github.com:realm/realm-js into kneth/master-to-2.0.x 2017-09-30 09:55:14 +02:00
Ashwin Phatak 199210eb68 Add support for aggregates on collections (#807) (#1350) 2017-09-29 16:53:37 +05:30
Thomas Goyne fbf5da388b Make an error message test less specific to accomodate platform differences 2017-09-26 13:43:01 -07:00
Thomas Goyne 9a31febc4c Add support for lists of things other than objects
And add a shorthand syntax for schema definitions.
2017-09-26 11:40:22 -07:00
Thomas Goyne 086f31c07f Use the objectstore keypath sorting functionality
Adds support for sorting on values over links, reduces the amount of code in
the binding, and is required for sorting non-object lists.
2017-09-21 10:41:19 -07:00
astigsen db4e184524 Added method to find index of object in collections (#1094)
* Added method to find index of object in collections

* rework as the indexOf method
2017-06-26 13:43:49 +02:00
Nabil Hachicha 43dabf5cbd Nh/symbol iterator android (#732)
* Fix Symbol.iterator on Android
2016-12-20 18:56:51 +00:00
Scott Kyle af70bb3c63 Fix all linting issues inside JS tests 2016-05-26 15:47:30 -07:00
Scott Kyle 48394d9c19 Automatically handle deleting test Realms
No longer leave this up to the test. All testing passes through the runTest() function, so we use that spot to delete the Realms. It also now deletes them beforehand too since a crash in a previous run could leave a Realm in place.
2016-05-26 15:47:30 -07:00
Scott Kyle e14e922c39 Fix crash and other errors with Results snapshots
When deleteAll() is called on a Realm, it calls clear() on all of its Tables, which seems to not update TableViews unless they are synced. The is_row_attached(row_ndx) method still returns true otherwise. A workaround is here until that is fixed.

Fixes #434
2016-05-20 13:42:17 -07:00
Ari Lazier fd25afe214 add isValid methods to results and list 2016-05-16 16:01:14 -07:00
Scott Kyle 7a26d192ba Merge pull request #427 from realm/sk-object-inheritance
Fix ES6 class inheritance of Realm.Object with Babel
2016-05-16 11:17:45 -07:00
Scott Kyle 4300e865c7 Abstracted check for Node v6 2016-05-10 11:34:33 -07:00
Scott Kyle 26d2c169a9 Support ES6 class inheritance from Realm.Object
Unfortunately, this was broken because our native Realm.Object constructor was not presenting itself as a function in JS. This fixes that and adds tests.
2016-05-09 16:49:05 -07:00
Scott Kyle 4a5ac413cc Skip test in Node v6 due to v8 regression 2016-05-04 02:15:17 -07:00
Scott Kyle 8c66bab8aa Make collection iterators actually iterable
The ES6 spec calls for this so these iterators are usable in for-of loops, with spread operators, etc.
2016-03-20 11:51:16 -07:00
Scott Kyle b5ce02c0ce Make List and Results inherit from Collection
This will allow for easier type checking, documentation, etc.
2016-03-20 11:51:16 -07:00
Scott Kyle 9ba477762a Update splice tests to test added behavior 2016-03-17 14:53:42 -07:00
Scott Kyle 37b2c35169 Add Symbol.iterator method to List and Results
Resolves #235
2016-03-02 23:00:53 -08:00
Scott Kyle 1cba02c34d Fix broken iterator methods on Android
Turns out the JSC included with React Native on Android includes a buggy implementation of ArrayIterator that is missing an exposed next() method, so we implement it ourselves instead.
2016-03-02 22:57:36 -08:00
Scott Kyle 72bf66e57e Check for some iterator methods before testing them
Some JS engines (like Chrome) are skipping over values() due to a web compatibility reason for right now.
2016-03-01 00:14:18 -08:00
Scott Kyle 4ea2e729b4 Support many Array methods on List and Results
Resolves #18
2016-02-29 03:24:58 -08:00
Scott Kyle 236d0a5eed Ensure List and Results constructors throw exception
This was already done from native code, but needed to happen for the browser shim and be tested.
2016-02-29 03:24:58 -08:00
Scott Kyle 44a29d8dd4 Expose List and Results constructors into JS 2016-02-29 03:24:58 -08:00
Scott Kyle a5ec799a7c Copy whole lib module into JS test bundle
This meant we needed to rename tests/lib to tests/js so they folder names would not conflict.
2016-02-29 03:24:58 -08:00