Skip to content

Commit

Permalink
Remove code which was causing proxy crash
Browse files Browse the repository at this point in the history
Crash could be reproduced with e.g.:
```
people = realm.objects(Person);
peopleProxy = new Proxy(people, {get: () => {} });
Object.prototype.toString.call(peopleProxy);
```
  • Loading branch information
Tom Duncalf committed Jan 24, 2022
1 parent d342d50 commit 3480f64
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,22 @@
],
"cwd": "${workspaceFolder}/integration-tests/tests",
"preLaunchTask": "Build Node Tests"
}
},
{
"name": "(lldb) Node Debug",
"type": "lldb",
"request": "launch",
"program": "/Users/tom.duncalf/dev/node-v16.13.2/out/Debug/node",
"args": [
"--expose-internals",
// "test.js"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb"
}
],
"compounds": [
{
Expand Down
4 changes: 2 additions & 2 deletions src/node/node_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,8 @@ Napi::Value WrappedObject<ClassType>::ProxyHandler::get_own_property_descriptor_
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::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));
Expand Down

0 comments on commit 3480f64

Please sign in to comment.