Default WrapFactory doesn't properly handle the isJavaPrimitiveWrap() flag #992
Labels
bug
Issues considered a bug
Java Interop
Issues related to the interaction between Java and JavaScript
Potentially Breaking Change
Issues that could break backwards compatibility
According to the JavaDoc on WrapFactory.isJavaPrimitiveWrap() the purpose of this falg is to expose Java primitives as native JavaScript primitives in JS land.
However, the code here first checks if !isJavaPrimitivateWrap() to return the object as is, but if isJavaPrimitivateWrap() == true continues onwards to call wrapAsJavaObject, which returns a NativeJavaObject.
So, IMHO, the isJavaPrimitiveWrap() is basically never properly used to wrap Java primitives as Native JavaScript objects.
Now, this you can fix by implementing your own WrapFactory, but I feel this is a bug that we should fix at some point. Is probably a breaking change that we should then slate for v2.0.0
Code below an example of not properly wrapping Java primitives > JavaScript primities
The text was updated successfully, but these errors were encountered: