Commit Graph

330 Commits

Author SHA1 Message Date
Ari Lazier 5d78670802 make ReactTests a subproject of RealmJS 2015-10-21 19:17:22 -07:00
Ari Lazier 290a595259 update to latest core 2015-10-21 19:12:36 -07:00
Scott Kyle 9cbc695fd7 Skip throwing an exception inside ResultsSetProperty 2015-10-21 15:59:11 -07:00
Scott Kyle bd2d1559d1 Error when assigning to Result index or length
Added some tests. Turns out our Chrome layer already did this too, so no changes were needed there.

Resolves #70
2015-10-21 15:25:53 -07:00
Scott Kyle d50e3ae68c Add Object.keys test for Results 2015-10-21 15:21:17 -07:00
Scott Kyle d55d42da8d Add ESLint config for JS test files
This helps the editor catch simple syntax issues before finding out about them when running a test.
2015-10-21 15:20:44 -07:00
Scott Kyle 8ba3a24eae Move RealmJSCoreTests.m to tests directory
Test failures were not pointing to the correct JS file path when it was in the src directory. This is where it belongs anyways.
2015-10-21 15:18:47 -07:00
Scott Kyle 36382ecb56 Add instanceof test for Results 2015-10-21 15:17:55 -07:00
Scott Kyle 2e592bc101 Sprinkle some const inside ES6 JS code
React Native 0.13.0 fixes the bug we experienced by using const.
2015-10-21 13:57:34 -07:00
Scott Kyle 13617400d4 Remove libc++.tbd references from ReactExample 2015-10-21 13:57:34 -07:00
Scott Kyle 725e9855fe Update RPC JS to use originalXMLHttpRequest
React Native now leaves the original object accessible when it "polyfills" objects. So we check for that, but still have the previous logic in place in case they change their minds.
2015-10-21 13:57:34 -07:00
Scott Kyle 2f9c6a0727 Update ReactExample to React Native 0.13.0-rc 2015-10-21 13:57:34 -07:00
Scott Kyle 7acd4d89c1 Update ReactTests project to React Native 0.13.0-rc 2015-10-21 13:57:34 -07:00
Scott Kyle 0055d0510c Make List objects work with Object.keys in Chrome
Rather than using Object.preventExtensions to throw exceptions when setting any out-of-bounds index, we must instead compromise by only throwing for the common cases, which are -1 and list.length. Having Object.keys() support is essential for List to work with React Native ListViewDataSource.

Resolves #80
2015-10-21 13:11:41 -07:00
Scott Kyle a8c1728502 Merge pull request #75 from realm/sk-session-id
Fix crash when reloading app during Chrome debugging
2015-10-20 16:53:29 -07:00
Ari Lazier f297a75057 Update README.md 2015-10-20 15:41:22 -07:00
Scott Kyle 34b84759c8 Fix crash when reloading app during Chrome debugging
Added a session ID, that actually tracks the Realm constructor in our RPC server's JS context. This conveniently let us remove the special casing for defaultPath as well as letting us call the Realm constructor with JSObjectCallAsConstructor.

Fixes #68
2015-10-20 15:10:52 -07:00
Scott Kyle b98e89db22 Merge pull request #63 from realm/sk-chrome-apis
Finish implementing APIs for Chrome
2015-10-20 01:23:40 -07:00
Scott Kyle 01dc3a85d9 Add comment about usage of preventExtensions 2015-10-20 00:52:38 -07:00
Scott Kyle f2c4e7882a Make RPC lists non-extensible
Assigning to non-existent index will throw an exception and all tests pass in Chrome!
2015-10-19 17:43:51 -07:00
Scott Kyle 85e2a26b42 Make RPC Results objects auto-resize 2015-10-19 17:28:20 -07:00
Scott Kyle 3439b4c455 Add getter/setter for defaultPath to RPC 2015-10-19 16:59:04 -07:00
Scott Kyle 03751c35b4 Handle passing dates through RPC 2015-10-19 16:46:56 -07:00
Scott Kyle b07aa72a55 Move all constants into a single JS file 2015-10-19 16:19:43 -07:00
Scott Kyle 57778ce878 Improve calling object methods through RPC 2015-10-19 16:15:38 -07:00
Scott Kyle d172b43535 Add path and schemaVersion getters to realm object 2015-10-19 15:46:28 -07:00
Scott Kyle 1b7653206a Generalize getting/setting properties through RPC 2015-10-19 15:46:00 -07:00
Ari Lazier 3b5c78d29f Merge pull request #66 from realm/al-per-realm
Store schema/defaults per Realm, Cleanup per Realm state and threads
2015-10-19 15:29:04 -07:00
Ari Lazier 5aa066e6fa newline 2015-10-19 14:56:59 -07:00
Ari Lazier 8fed61cb8a clean up per realm resources/threads 2015-10-19 14:25:35 -07:00
Ari Lazier 167c3e97b5 store schema and prototypes on the realm object 2015-10-19 13:39:21 -07:00
Scott Kyle 4c0cc578d5 Generalize calling methods through the RPC 2015-10-19 12:46:31 -07:00
Scott Kyle d482ea82e7 Error messages deserve good grammar 2015-10-19 12:18:16 -07:00
Scott Kyle 5f52d07154 Add support for Results methods in Chrome
Which only consists of sortByProperty
2015-10-19 12:18:09 -07:00
Scott Kyle 78ec67cd6c Hacky support for adding notifications in Chrome
Since notifications are called synchronously after a write, we fake it by calling them manually for now. The future plan will be more involved, so some of that is stubbed out.
2015-10-19 12:09:14 -07:00
Scott Kyle b985e1f0a6 Add realm.close() method to JS shim
That was easy!
2015-10-19 12:07:50 -07:00
Scott Kyle 44eea1e036 Minor syntax improvements to JS shim 2015-10-19 12:07:50 -07:00
Ari Lazier 8ee6e757ee Merge pull request #62 from realm/sk-test-suite
Run tests from ReactNative
2015-10-19 11:34:59 -07:00
Ari Lazier cfd618db32 flag to create jscontext 2015-10-19 11:28:50 -07:00
Ari Lazier f02fb05af4 add search paths for test path 2015-10-19 10:52:34 -07:00
Ari Lazier fae276816f newline 2015-10-19 10:33:59 -07:00
Ari Lazier 69ea13944f disable schema/defaults cleanup until we can ensure we are using the correct context 2015-10-19 10:25:25 -07:00
Ari Lazier 832e0c5e13 clean up ctx initiliazation/remove code duplication 2015-10-19 10:24:51 -07:00
Ari Lazier 7074d66c5f always use release version of core 2015-10-19 09:58:26 -07:00
Ari Lazier 430b2a29e5 Merge branch 'sk-test-suite' of https://github.com/realm/realm-js into sk-test-suite 2015-10-16 10:35:41 -07:00
Ari Lazier 7ae6fe4a03 make sure we have destructors for all objects 2015-10-16 10:35:26 -07:00
Ari Lazier 5edb205978 clean up prototype and defaults state 2015-10-15 20:56:12 -07:00
Scott Kyle 69bf42c4f4 Actually stop and dealloc RPC server 2015-10-15 20:52:11 -07:00
Ari Lazier 5ccc03eeb7 rename some methods for clarity - try to cleanup js objects 2015-10-15 18:48:13 -07:00
Ari Lazier 45a3c89605 remove hardcoded test paths 2015-10-15 17:28:51 -07:00