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:
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (9 by maintainers)
Commits related to this issue
- Added test case for #500. — committed to viceice/jint by viceice 5 years ago
- Don't throw when CLR indexer not found Fixes #500 — committed to sebastienros/jint by sebastienros 4 years ago
- Don't throw when CLR indexer not found (#718) Fixes #500 — committed to sebastienros/jint by sebastienros 4 years ago
@ViceIce thanks for the clarification, I’ve updated the PR to also handle ICollection and IEnumerable.