DescriptionWhen 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
@r5638
Patch Set 1 #
Total comments: 4
Patch Set 2 : Scanner: more information about function calls in program output. #
Total comments: 2
MessagesTotal messages: 5
|
|||||||||||||||||||||||||||||||||||||