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

Unified Diff: tests/com/google/caja/plugin/templates/template-compiler-golden1-static.js

Issue 61041: Cajole to HTML (Closed) Base URL: http://google-caja.googlecode.com/svn/trunk/
Patch Set: Cajole to HTML Created 14 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/com/google/caja/plugin/templates/template-compiler-golden1-static.js
===================================================================
--- tests/com/google/caja/plugin/templates/template-compiler-golden1-static.js (revision 0)
+++ tests/com/google/caja/plugin/templates/template-compiler-golden1-static.js (revision 0)
@@ -0,0 +1,48 @@
+{
+ // Define handlers
+ IMPORTS___.c_1___ = function (event, thisNode___) {
+ wasClicked(thisNode___);
+ };
+ // Set up local variables required for HTML support.
+ var el___;
+ var emitter___ = IMPORTS___.htmlEmitter___;
+ el___ = emitter___.byId('id_2___');
+ // Remove the bits the first script shouldn't see.
+ emitter___.attach('id_2___');
+ // Attach the onclick handler.
+ emitter___.setAttr(el___, 'onclick',
+ 'return plugin_dispatchEvent___(this, event, '
+ + ___.getId(IMPORTS___) + ', \'c_1___\');');
+ // Remove the manufactured ID
+ el___.removeAttribute('id');
+}
+// The first script.
+try {
+ { a(); }
+} catch (ex___) {
+ ___.getNewModuleHandler().handleUncaughtException(
+ ex___, onerror, 'testSafeHtmlWithStaticModuleId', '2');
+}
+{
+ //Attach the tail, taking the text out of the manufactured SPAN.
+ emitter___.unwrap(emitter___.attach('id_3___'));
+}
+// The second script.
+try {
+ { b(); }
+} catch (ex___) {
+ ___.getNewModuleHandler().handleUncaughtException(
+ ex___, onerror, 'testSafeHtmlWithStaticModuleId', '4');
+}
+{
+ // Since the two handlers have the same text, they should share the
+ // same handler function.
+ el___ = emitter___.byId('id_4___');
+ emitter___.setAttr(
+ el___, 'onclick',
+ 'return plugin_dispatchEvent___(this, event, '
+ + ___.getId(IMPORTS___)
+ + ', \'c_1___\');');
+ el___.removeAttribute('id');
+ el___ = emitter___.finish();
+}
Property changes on: tests/com/google/caja/plugin/templates/template-compiler-golden1-static.js
___________________________________________________________________
Added: svn:mime-type
+ text/javascript;charset=UTF-8

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