From 3480f64964b8b889bee6e76e8621edbeca160b69 Mon Sep 17 00:00:00 2001 From: Tom Duncalf Date: Mon, 24 Jan 2022 17:06:39 +0000 Subject: [PATCH] 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); ``` --- .vscode/launch.json | 17 ++++++++++++++++- src/node/node_class.hpp | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 83b9370aa20..46e881614e5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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": [ { diff --git a/src/node/node_class.hpp b/src/node/node_class.hpp index 5e3e39caa3b..4258219a0e5 100644 --- a/src/node/node_class.hpp +++ b/src/node/node_class.hpp @@ -934,8 +934,8 @@ Napi::Value WrappedObject::ProxyHandler::get_own_property_descriptor_ Napi::EscapableHandleScope scope(env); // Napi::Object target = info[0].As(); - Napi::String key = info[1].As(); - std::string text = key; + // Napi::String key = info[1].As(); + // std::string text = key; Napi::Object descriptor = Napi::Object::New(env); descriptor.Set("enumerable", Napi::Boolean::New(env, true));