Skip to content

binding option data with customized _value/_text function cause exception #13

@xzer

Description

@xzer

At form-option.js,

var retrieveTargetPropMetaRoot=function(meta){
  var checkKeys = Object.keys(meta);
  if (checkKeys.length == 0) {
    return meta;
  }else if(checkKeys.length == 1){
    if(checkKeys[0] === "_duplicator"){
      return meta;
    }else if(checkKeys[0] === "_item"){
      return meta;
    }else{
      return retrieveTargetPropMetaRoot(meta[checkKeys[0]]);
    }
  }else if(checkKeys.length == 2){
    if(checkKeys.indexOf("_duplicator") && checkKeys.indexOf("_item")){
      return meta;
    }else{
      throwMalformedOptionMeta(meta);
    }
  }else{
    throwMalformedOptionMeta(meta);
  }
}

The following if statement is always false since the indexOf will return 0 for any of them.

    if(checkKeys.indexOf("_duplicator") && checkKeys.indexOf("_item")){

we need fix the judgment as ">= 0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions