Closed SrinivasGourarum closed 8 years ago
isConstructCall should indicate whether the 'new' operator is used. We're investigating this issue. Thanks!
It turns out that the marshaling was wrong for isConstructCall in JavaScriptNativeFunction. If you change the type of isConstructCall from bool to [MarshalAs(UnmanagedType.U1)] bool, it would behave as expected (see the fix commit).
Sorry about the issue and thanks for finding it :+1:.
Thank you for the timely fix. It is working as expected :)
How to differentiate between an object that is created using "new" and the one without it? I have defined a host object and in the callback (JavaScriptNativeFunction ) for this object's creation, the value for the argument "bool isConstructCall" is always coming as "true" irrespective of the object being created with new or without it.
I want the object to be created only when it is created using the new operator.