File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ Value TestFunctionWithUserData(const CallbackInfo& info) {
6969 return Number::New (info.Env (), holder->value );
7070}
7171
72+ Value GetEmptyConstructor (const CallbackInfo& /* info*/ ) {
73+ return Object ();
74+ }
75+
7276Array GetPropertyNames (const CallbackInfo& info) {
7377 Object obj = info[0 ].As <Object>();
7478 Array arr = obj.GetPropertyNames ();
@@ -237,6 +241,8 @@ Value InstanceOf(const CallbackInfo& info) {
237241Object InitObject (Env env) {
238242 Object exports = Object::New (env);
239243
244+ exports[" getEmptyConstructor" ] = Function::New (env, GetEmptyConstructor);
245+
240246 exports[" GetPropertyNames" ] = Function::New (env, GetPropertyNames);
241247 exports[" defineProperties" ] = Function::New (env, DefineProperties);
242248 exports[" defineValueProperty" ] = Function::New (env, DefineValueProperty);
Original file line number Diff line number Diff line change @@ -102,6 +102,12 @@ function test(binding) {
102102 testDefineProperties ( 'string' ) ;
103103 testDefineProperties ( 'value' ) ;
104104
105+ {
106+ const expected = undefined ;
107+ const actual = binding . object . getEmptyConstructor ( ) ;
108+ assert . strictEqual ( actual , expected ) ;
109+ }
110+
105111 {
106112 const obj = { } ;
107113 const testSym = Symbol ( ) ;
You can’t perform that action at this time.
0 commit comments