Reviewers: felix8a,

Description:
When the scanner prints a problem it prints an expression which, ideally
can be evaluated to obtain the problematic object. These expressions had
omitted function argument and 'this' values; now they are present,
though not yet always evaluatable (primitives are supported, but not
objects and functions). Also, try/catch blocks are emitted instead of
the hypothetical "throws" function.

In order to handle 'this' cleanly, each expression generator now also
returns what the this-value would be if the expression were called.
This is used to decide whether .call() is needed.

Future work will be to arrange for more objects to be printed usefully.
One thing that comes to mind is to have a 'global' WeakMap which maps
references that came from e.g. obtainInstance to appropriate
expressions -- rather than adding Contexts to each argument/this.

This is a partial fix for issue 1753,
https://code.google.com/p/google-caja/issues/detail?id=1753

Please review this at https://codereview.appspot.com/31170043/

Affected files (+154, -58 lines):
  M     tests/com/google/caja/plugin/test-scan-core.js
  M     tests/com/google/caja/plugin/test-scan-guest.html
  M     tests/com/google/caja/plugin/test-scan-guest.js


--

--- 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.

Reply via email to