On 12/19/13 3:21 AM, Andreas Schlegel wrote:
> Hello Jason,
>
> for comparing "transparent" proxies I have to change some things for
> WeakMap Map and Set.
>
> I should compare the key from a transparent Proxy with its object, e.g.
> for getting the value .
>
> I found the lookup is in the HashTable.h in the Folder JS/public may I
> change something there, or are this includes from somewhere?
>
(adding the list)
Don't change js/public/HashTable.h.
For Map and Set, you have to change hash() and match() methods in
builtin/MapObject.h and .cpp.
For WeakMap, I think you need to modify js/src/vm/WeakMapObject.h. You
need to add a struct that is a hash policy (as defined in comments in
js/public/HashTable.h) and implements hash() and match() correctly for
your purpose. Then change this line:
typedef WeakMap<EncapsulatedPtrObject, RelocatableValue> ObjectValueMap;
to pass your new hash policy as the third parameter. (The default
HashPolicy has hash() and match() methods based on pointer equality. You
must provide an explicit hash policy to override that.)
-j
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals