Skip to content

bug: Set undefined, get null #264

@oldbig

Description

@oldbig

When set set("hello", undefined), get("hello") return null.
Reason as follow:
if value.v? part will be compile to :

     _unwrap(value, asClone = true) {
        if (!this.options.useClones) {
          asClone = false;
        }
        //***** when value.v is undefined, will not go in to the if body, return null directly
        if (value.v != null) { 
          if (asClone) {
            return clone(value.v);
          } else {
            return value.v;
          }
        }
        return null;
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions