jint: "No matching indexer found" w/ .net object assigned to prototype field

code:

private void Start()
{
    var engine = new Engine(cfg => cfg.AllowClr(typeof(UnityEngine.GameObject).Assembly));
    engine.Execute(@"
var UnityEngine = importNamespace(""UnityEngine"");
var Vector3 = UnityEngine.Vector3;
var Color = UnityEngine.Color;

function BaseZone() { };
BaseZone.prototype.name = ""John"";
BaseZone.prototype.age = 42;
BaseZone.prototype.position = Vector3.zero;

var myZone = new BaseZone();

// works
UnityEngine.Debug.Log(myZone.position);

// works
myZone.position = Vector3.one;
UnityEngine.Debug.Log(myZone.position);

// errors
myZone.position = Vector3.one * 2;

// errors
UnityEngine.Debug.Log(""position:"" + myZone.position);

");
}

output: error

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@ViceIce thanks for the clarification, I’ve updated the PR to also handle ICollection and IEnumerable.