-
Notifications
You must be signed in to change notification settings - Fork 49
Embedded delegates are no longer linked with the Function
prototype.
#68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello, Tomáš! This error also occurs in the MSIE, V8 and Vroom modules. In ChakraCore and MSIE modules, it is caused by the implementation of garbage collection mechanism for embedded objects (see the source code). In general, an embedded delegate does not have to be a function, it just has to work as a function. I will certainly see what can be done, but I will not change the existing garbage collection mechanism. In any case, this unit test will not pass in the V8 and Vroom modules. |
If you just use this expression to check whether an embedded object is a function: Object.getPrototypeOf(embeddedFunc) === Function.prototype It is better to use the following code (does not work only in the MSIE module): typeof embeddedFunc === 'function' If you pass an embedded delegate to some library, where this check is performed, you can simply wrap the delegate to function: function wrappedFunc() {
return embeddedFunc();
} |
…legates are no longer linked with the `Function` prototype”
Hello, Tomáš! This error is fixed in version 3.0.7. |
See failing test for ChakraCore in #67. The test was passing in v3.0.1 but now fails (v3.0.5).
The text was updated successfully, but these errors were encountered: