Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(67)

Issue 31170043: Scanner: more information about function calls in program output. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by kpreid2
Modified:
12 years, 3 months ago
Reviewers:
felix8a
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

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 @r5638

Patch Set 1 #

Total comments: 4

Patch Set 2 : Scanner: more information about function calls in program output. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+158 lines, -58 lines) Patch
M tests/com/google/caja/plugin/test-scan-core.js View 1 16 chunks +110 lines, -42 lines 1 comment Download
M tests/com/google/caja/plugin/test-scan-guest.html View 1 chunk +3 lines, -5 lines 0 comments Download
M tests/com/google/caja/plugin/test-scan-guest.js View 1 6 chunks +45 lines, -11 lines 1 comment Download

Messages

Total messages: 5
kpreid2
12 years, 3 months ago (2013-11-22 22:36:26 UTC) #1
felix8a
https://codereview.appspot.com/31170043/diff/1/tests/com/google/caja/plugin/test-scan-core.js File tests/com/google/caja/plugin/test-scan-core.js (right): https://codereview.appspot.com/31170043/diff/1/tests/com/google/caja/plugin/test-scan-core.js#newcode421 tests/com/google/caja/plugin/test-scan-core.js:421: * will be the 'this' value if the expression ...
12 years, 3 months ago (2013-11-25 18:33:51 UTC) #2
kpreid2
When the scanner prints a problem it prints an expression which, ideally can be evaluated ...
12 years, 3 months ago (2013-11-25 18:49:07 UTC) #3
kpreid2
https://codereview.appspot.com/31170043/diff/1/tests/com/google/caja/plugin/test-scan-core.js File tests/com/google/caja/plugin/test-scan-core.js (right): https://codereview.appspot.com/31170043/diff/1/tests/com/google/caja/plugin/test-scan-core.js#newcode421 tests/com/google/caja/plugin/test-scan-core.js:421: * will be the 'this' value if the expression ...
12 years, 3 months ago (2013-11-25 18:51:26 UTC) #4
felix8a
12 years, 3 months ago (2013-11-25 20:21:17 UTC) #5
lgtm

https://codereview.appspot.com/31170043/diff/20001/tests/com/google/caja/plug...
File tests/com/google/caja/plugin/test-scan-core.js (right):

https://codereview.appspot.com/31170043/diff/20001/tests/com/google/caja/plug...
tests/com/google/caja/plugin/test-scan-core.js:428: function makeContext(object,
path, depth, getSelfC, getThisArgC,
the args to this function are starting to get suspiciously complicated, but this
seems ok for now.

https://codereview.appspot.com/31170043/diff/20001/tests/com/google/caja/plug...
File tests/com/google/caja/plugin/test-scan-guest.js (right):

https://codereview.appspot.com/31170043/diff/20001/tests/com/google/caja/plug...
tests/com/google/caja/plugin/test-scan-guest.js:1500: // TODO: Would be better
if there was an abstraction over performing the
TODO(kpreid)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b