Skip to content

nullish operator ?? doesnt work on JS-view context varaibles #564

Closed
@Cube707

Description

@Cube707

this is not really a bug and more of a documentation / discussion.

Describe the Issue

all undefined variables will be initialized with the empty string when filling context of a JS-view field.

context[variable.contextName] = variable.metadataSignal.get() ?? '';

Steps to Reproduce

The following JS-view doesn't behave as expected. instead of returning empty for undefined properties, it will return the empty string.

~~~meta-bind-js-view
{fuzz} as var
---
return context.bound.var ?? "empty"
~~~

Further context

Not sure how this behavior guards against other issues I cant think of right now. In that case it should be better documented to avoid confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behavior caused by this plugin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions