Skip to content
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

Value declared with a {type: String} but no default value behave like they have a default value #772

Open
Intrepidd opened this issue May 30, 2024 · 0 comments

Comments

@Intrepidd
Copy link

Consider the following values :

static values = {
  foo: {type: String},
  bar: String
}

If both values are un-set, the following will happen

this.hasFooValue // true
this.hasBarValue // false

Looks like it comes from here :

return this.data.has(key) || definition.hasCustomDefaultValue

get hasCustomDefaultValue() {
return parseValueTypeDefault(typeDefinition) !== undefined
},

This is beyond my knowledge but it looks like there is a mixup about what is passed to parseValueTypeDefault

@Intrepidd Intrepidd changed the title Value declared with a {type: String} but not default value behave like they have a default value Value declared with a {type: String} but no default value behave like they have a default value May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant