Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 1366 by [email protected]: untame sometimes returns a
taming-frame object
http://code.google.com/p/google-caja/issues/detail?id=1366
If cajoled code constructs an object and passes it to a tamed function, the
feral version of the function gets an object that inherits from the
taming-frame's Object hierarchy rather than the feral-frame's Object
hierarchy.
This can confuse feral code in several ways:
- Feral code might use instanceof, such as (o instanceof Array), and get
false where normally you'd expect true.
- Feral code might augment its base object prototypes with convenience
methods and expect to be able to use those methods, which will fail because
these methods are not available on the taming-frame object.
Ihab says his motivation for using taming-frame objects is that functions
are a problem case, and it seemed reasonable to handle all types of objects
in the same way.
Mark Miller thinks it should be possible to have untame create functions in
the feral frame by having untame call a helper function defined in the
feral frame.