Improve isAssociation() in vm.primitives.js
We have a Global in the special objects array, so we can be rather more specific in isAssociation(). This bit me when marshaling a complex object for use with the JS bridge.
Alternatively, we could iterate through the array and make sure every entry is a 2-pointer object and the first of these 2 is a bytes object (ByteSymbol / ByteString).
Hm, I still would have been bitten. Perhaps we could check both the old and new special objects array cases, and answer true if either of them is a match?
Okay. We could try to find (and maybe cache) LookupKey class by following the superclass chain from the Processor global to the class that has only 1 instance variable:
(Smalltalk specialObjectsArray at: 4) class withAllSuperclasses collect: [:c | c -> c instSize]
Global->2 Binding->1 LookupKey->1 Magnitude->0 Object->0 ProtoObject->0
Association->2 LookupKey->1 Magnitude->0 Object->0
So maybe something like
LookupKey= starting at schedAssoc.sqClass, go up superclass chain until we find a class satisfyingcls.pointers[0].classInstSize() === 0- Object in question is an
Associationif its superclass isLookupKeyand it has 2 inst vars.