I'm trying to create an ObjectMap which supports both primitive and object keys across targets.
For the flash impl I'd like to use a Dictionary under the hood (like haxe.ds.ObjectMap does). My issue is that in my map.exists(key) method I want to check if the key is defined. In ActionScript I'd use strict equality.
dictionary[key] !== undefined;
But I'm not sure how I can write that in haxe, even if untyped or using __global__("undefined") trickery. i.e. dictionary[key] != __global__("undefined") will return false for null too, because:
undefined == null // true
undefined === null // false
I see that the haxe.ds.ObjectMap checks for null in this case, but that won't work when the value is null but the key exists.
Reflect.hasField and the native "Object.hasOwnProperty" both deal in strings so won't work in the case of object keys.
Any way around this?