diff --git a/test/object/object.cc b/test/object/object.cc index 2a2bd2e51..320cd67b7 100644 --- a/test/object/object.cc +++ b/test/object/object.cc @@ -69,6 +69,10 @@ Value TestFunctionWithUserData(const CallbackInfo& info) { return Number::New(info.Env(), holder->value); } +Value GetEmptyConstructor(const CallbackInfo& /*info*/) { + return Object(); +} + Array GetPropertyNames(const CallbackInfo& info) { Object obj = info[0].As(); Array arr = obj.GetPropertyNames(); @@ -237,6 +241,8 @@ Value InstanceOf(const CallbackInfo& info) { Object InitObject(Env env) { Object exports = Object::New(env); + exports["getEmptyConstructor"] = Function::New(env, GetEmptyConstructor); + exports["GetPropertyNames"] = Function::New(env, GetPropertyNames); exports["defineProperties"] = Function::New(env, DefineProperties); exports["defineValueProperty"] = Function::New(env, DefineValueProperty); diff --git a/test/object/object.js b/test/object/object.js index 52646cb8c..0b734027e 100644 --- a/test/object/object.js +++ b/test/object/object.js @@ -102,6 +102,12 @@ function test(binding) { testDefineProperties('string'); testDefineProperties('value'); + { + const expected = undefined; + const actual = binding.object.getEmptyConstructor(); + assert.strictEqual(actual, expected); + } + { const obj = {}; const testSym = Symbol();