Skip to content

Commit

Permalink
Merge branch 'kneth/client-reset' of github.com:realm/realm-js into k…
Browse files Browse the repository at this point in the history
…neth/client-reset
  • Loading branch information
kneth committed Oct 27, 2023
2 parents 5c0a0e5 + 21b1312 commit ee98d42
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Fixed
* The `onBefore`, `onAfter`, and `onFallback` client reset callbacks were not called. ([#6201](https://github.com/realm/realm-js/issues/6201), since v12.0.0)
* `Symbol.unscopables` has been implemented on the base class of `Realm.Results`, `Realm.List`, and `Realm.Set`. ([#6215](https://github.com/realm/realm-js/pull/6215))

### Compatibility
* React Native >= v0.71.4
Expand Down
3 changes: 2 additions & 1 deletion contrib/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,13 @@ export PATH=<ccache location>/libexec:$PATH

## Cloning the repository

To clone the RealmJS repository and install git submodules:
To clone the RealmJS repository and install git submodules and dependencies.

```sh
git clone https://github.com/realm/realm-js.git
cd realm-js
git submodule update --init --recursive
npm install
```

In order to improve the accuracy of `git blame` locally by ignoring commits in which the code was reformatted by an automated tool, run: `git config blame.ignoreRevsFile .gitignore-revs` from inside the repository.
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"lint": "wireit",
"lint:fix": "wireit",
"lint:cpp": "find src packages/realm/bindgen/src -name '*.cpp' -or -name '*.h' -or -name '*.hpp' | xargs clang-format --dry-run --Werror",
"lint:cpp:fix": "find src packages/realm/bindgen/src -name '*.cpp' -or -name '*.h' -or -name '*.hpp' | xargs clang-format -i",
"postinstall": "git submodule update --init --recursive"
"lint:cpp:fix": "find src packages/realm/bindgen/src -name '*.cpp' -or -name '*.h' -or -name '*.hpp' | xargs clang-format -i"
},
"wireit": {
"build": {
Expand Down
12 changes: 12 additions & 0 deletions packages/realm/src/OrderedCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ export abstract class OrderedCollection<T = unknown, EntryType extends [unknown,
writable: false,
value: mixedToBinding.bind(undefined, realm.internal),
});
// See https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype-@@unscopables
Object.defineProperty(this, Symbol.unscopables, {
enumerable: false,
configurable: true,
writable: false,
});
return proxied;
}

Expand Down Expand Up @@ -626,6 +632,12 @@ export abstract class OrderedCollection<T = unknown, EntryType extends [unknown,
return this.values();
}

/**
* An Object whose truthy properties are properties that are excluded from the 'with'
* environment bindings of the associated objects.
*/
readonly [Symbol.unscopables] = Array.prototype[Symbol.unscopables];

// Other methods

// TODO: Implement this method
Expand Down

0 comments on commit ee98d42

Please sign in to comment.