On Tue, Jul 2, 2013 at 8:47 PM, Doug Koellmer <[email protected]> wrote:
> I have a guest API function (inside a GWT JSNI method) whose body is this:
>
> var point = {x:10, y:10, z:10};
> $wnd.caja.markReadOnlyRecord(point);
> var point_tamed = $wnd.caja.tame(point);
> return point_tamed;
>
> I'm basing this off of the guide here:
> https://developers.google.com/caja/docs/allowingcooperation/. This guide
> is taming objects that are sent back as arguments to a callback, so maybe
> it doesn't apply, but when I call my function from guest code, I get this
> error:
>
> Uncaught script error: Tame object found on feral side of taming membrane:
> [object Object]. The membrane has previously been compromised. in source:
> "unknown" at line: 0
>
This is a known documentation bug:
https://code.google.com/p/google-caja/issues/detail?id=1711
It is usually the taming membrane's job to tame() and untame() things. When
you provide a tamed API function, it is automatically wrapped to untame its
arguments and tame its return value, so tame() again is redundant. This
used to be silently accepted, but that had other hazards so we stopped
supporting it in r5305.
If you're not doing something clever, the one and only place you should
ever use tame() is when providing the objects in .api({...}). We
tentatively plan to replace .api() with something which does not need that:
https://code.google.com/p/google-caja/issues/detail?id=1693
--
---
You received this message because you are subscribed to the Google Groups
"Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.