Skip to content

Commit

Permalink
Remove code which was causing proxy crash (#4257)
Browse files Browse the repository at this point in the history
* Remove code which was causing proxy crash

Crash could be reproduced with e.g.:
```
people = realm.objects(Person);
peopleProxy = new Proxy(people, {get: () => {} });
Object.prototype.toString.call(peopleProxy);
```

* Update changelog

* Remove commented out code
  • Loading branch information
tomduncalf authored Jan 25, 2022
1 parent 0a9b599 commit f625b6a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ x.x.x Release notes (yyyy-MM-dd)

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
* None.
* Fixed a crash when using `Proxy` with a `Realm.Results` object ([#4257]https://github.com/realm/realm-js/pull/4257)

### Compatibility
* MongoDB Realm Cloud.
Expand Down
4 changes: 0 additions & 4 deletions src/node/node_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,10 +933,6 @@ Napi::Value WrappedObject<ClassType>::ProxyHandler::get_own_property_descriptor_
Napi::Env env = info.Env();
Napi::EscapableHandleScope scope(env);

// Napi::Object target = info[0].As<Napi::Object>();
Napi::String key = info[1].As<Napi::String>();
std::string text = key;

Napi::Object descriptor = Napi::Object::New(env);
descriptor.Set("enumerable", Napi::Boolean::New(env, true));
descriptor.Set("configurable", Napi::Boolean::New(env, true));
Expand Down

0 comments on commit f625b6a

Please sign in to comment.