| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Currently:
```
var value = new WrappedValue('') // passing empty string
console.log(WrappedValue.unwrap(value) === '' ) // prints "false"
```
Now:
```
var value = new WrappedValue('') // passing empty string
console.log(WrappedValue.unwrap(value) === '' ) // prints "true"
```
|
@speigg there are failing unit tests with this change: JS: Test: --- [XML-DECLARATION.test_TabViewHasCorrectParentChain] FAILED: Cannot use 'in' operator to search for 'wrapped' in true, Stack: TypeError: Cannot use 'in' operator to search for 'wrapped' in true You can run the unit tests locally like this: cd tests
tns run android |
Sorry, something went wrong.
There was a problem hiding this comment.
As @manoldonev pointed out - the proposed solution fails when unwrap is given a boolean value.
Lets just make an instanceof check:
return (value instanceof WrappedValue) ? value.wrapped : value;
Also, can you add some unit-tests about this case. You can check this guide on how to do that.
Sorry, something went wrong.
|
The cla-bot has been summoned, and re-checked this pull request! |
Sorry, something went wrong.
|
@manoldonev thanks for taking care of this, I haven't had time to work on this myself |
Sorry, something went wrong.
|
test |
Sorry, something went wrong.
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Currently:
var value = new WrappedValue('') // passing empty string console.log(WrappedValue.unwrap(value) === '' ) // prints "false"Now:
var value = new WrappedValue('') // passing empty string console.log(WrappedValue.unwrap(value) === '' ) // prints "true"PR Checklist
What is the current behavior?
What is the new behavior?
Fixes/Implements/Closes #[Issue Number].