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

Issue 136053: Remove Cajita/Valija flag as an input to all cajoling services (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 6 months ago by ihab.awad
Modified:
16 years, 5 months ago
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Remove Cajita/Valija flag as an input to all cajoling services. Rely only on the source itself to tell us whether it is Valija (the default) or Cajita (via a "use cajita" pragma). Cajole all files to a consistent output filename (*.out.js). These changes allow the (Cajita-level) module loader to predictably load a module regardless of whether it is Valija or Cajita. Because we build our Valija module loader on top of Cajita, the Cajita loader did not have the information of whether a module to be loaded is Cajita or Valija; as far as it was concerned, everything is Cajita. Which is as it should be -- Valija is just Cajita with a funky calling convention. This fixes http://code.google.com/p/google-caja/issues/detail?id=1111.

Patch Set 1 #

Total comments: 98

Patch Set 2 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 3 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 4 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 5 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 6 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 7 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 8 : Remove Cajita/Valija flag as an input to all cajoling services #

Total comments: 2

Patch Set 9 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 10 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 11 : Remove Cajita/Valija flag as an input to all cajoling services #

Total comments: 20

Patch Set 12 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 13 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 14 : Remove Cajita/Valija flag as an input to all cajoling services #

Total comments: 9

Patch Set 15 : Remove Cajita/Valija flag as an input to all cajoling services #

Patch Set 16 : Remove Cajita/Valija flag as an input to all cajoling services #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1552 lines, -1477 lines) Patch
M build.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 13 chunks +87 lines, -62 lines 0 comments Download
M src/com/google/caja/ancillary/linter/VariableLiveness.java View 7 8 9 10 11 12 13 14 3 chunks +11 lines, -0 lines 0 comments Download
M src/com/google/caja/cajita.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -4 lines 0 comments Download
M src/com/google/caja/cajita-module.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 11 chunks +90 lines, -42 lines 0 comments Download
M src/com/google/caja/commonjs-sandbox.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +14 lines, -0 lines 0 comments Download
M src/com/google/caja/demos/applet/CajaApplet.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +0 lines, -3 lines 0 comments Download
M src/com/google/caja/demos/applet/testbed.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/demos/calendar/demo-cajoled.html View 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download
M src/com/google/caja/demos/lolcat-search/katTranzlator.js View 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M src/com/google/caja/demos/lolcat-search/kittens.js View 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M src/com/google/caja/demos/lolcat-search/search.html View 9 10 11 12 13 14 3 chunks +55 lines, -82 lines 0 comments Download
M src/com/google/caja/demos/lolcat-search/searchbox.js View 9 10 11 12 13 14 2 chunks +8 lines, -0 lines 0 comments Download
M src/com/google/caja/demos/lolcat-search/slides.html View 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/demos/slides/index.html View 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +95 lines, -143 lines 0 comments Download
M src/com/google/caja/opensocial/DefaultGadgetRewriter.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +0 lines, -9 lines 0 comments Download
M src/com/google/caja/opensocial/GadgetRewriterMain.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -1 line 0 comments Download
A + src/com/google/caja/parser/js/Directive.java View 6 7 8 9 10 11 12 13 14 2 chunks +54 lines, -13 lines 0 comments Download
A + src/com/google/caja/parser/js/DirectivePrologue.java View 6 7 8 9 10 11 12 13 14 15 4 chunks +40 lines, -76 lines 0 comments Download
M src/com/google/caja/parser/js/Parser.java View 6 7 8 9 10 11 12 13 14 3 chunks +60 lines, -28 lines 0 comments Download
D src/com/google/caja/parser/js/UseSubset.java View 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -74 lines 0 comments Download
D src/com/google/caja/parser/js/UseSubsetDirective.java View 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -147 lines 0 comments Download
M src/com/google/caja/parser/quasiliteral/CajitaRewriter.java View 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download
M src/com/google/caja/parser/quasiliteral/DefaultValijaRewriter.java View 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +1 line, -7 lines 0 comments Download
A + src/com/google/caja/parser/quasiliteral/DirectivePrologueQuasiNode.java View 4 chunks +18 lines, -17 lines 0 comments Download
M src/com/google/caja/parser/quasiliteral/QuasiBuilder.java View 6 7 8 9 10 11 12 13 14 3 chunks +5 lines, -5 lines 0 comments Download
D src/com/google/caja/parser/quasiliteral/UseSubsetQuasiNode.java View 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -68 lines 0 comments Download
M src/com/google/caja/plugin/BuildServiceImplementation.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +5 lines, -9 lines 0 comments Download
M src/com/google/caja/plugin/ExpressionSanitizerCaja.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -11 lines 0 comments Download
M src/com/google/caja/plugin/PluginCompilerMain.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -1 line 0 comments Download
M src/com/google/caja/plugin/PluginMeta.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +0 lines, -9 lines 0 comments Download
M src/com/google/caja/plugin/bridal.js View 5 6 7 8 9 10 11 12 13 14 3 chunks +24 lines, -2 lines 0 comments Download
M src/com/google/caja/plugin/stages/ValidateJavascriptStage.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/reporting/MessageType.java View 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -2 lines 0 comments Download
M src/com/google/caja/service/CajolingService.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -2 lines 0 comments Download
M src/com/google/caja/service/HtmlHandler.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +1 line, -3 lines 0 comments Download
M src/com/google/caja/service/JsHandler.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +5 lines, -9 lines 0 comments Download
M src/com/google/caja/tools/TransformAntTask.java View 9 10 11 12 13 14 2 chunks +5 lines, -1 line 0 comments Download
M src/com/google/caja/valija-cajita.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +12 lines, -1 line 0 comments Download
M tests/com/google/caja/a.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -1 line 0 comments Download
M tests/com/google/caja/c.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -1 line 0 comments Download
M tests/com/google/caja/commonJsRecursion.js View 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M tests/com/google/caja/demos/applet/CajaAppletTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -11 lines 0 comments Download
D tests/com/google/caja/demos/applet/caja-applet-cajita-golden.js View 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -31 lines 0 comments Download
M tests/com/google/caja/demos/benchmarks/BenchmarkRunner.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -3 lines 0 comments Download
M tests/com/google/caja/demos/benchmarks/BenchmarkSize.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -3 lines 0 comments Download
A tests/com/google/caja/demos/benchmarks/BenchmarkUtils.java View 5 1 chunk +44 lines, -0 lines 0 comments Download
M tests/com/google/caja/foo/b.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -1 line 0 comments Download
M tests/com/google/caja/foo/f.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -1 line 0 comments Download
M tests/com/google/caja/foo/inc.js View 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M tests/com/google/caja/opensocial/DefaultGadgetRewriterTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -6 lines 0 comments Download
M tests/com/google/caja/opensocial/example-rewritten.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +61 lines, -27 lines 0 comments Download
M tests/com/google/caja/parser/js/ParserTest.java View 6 7 8 9 10 11 12 13 14 4 chunks +74 lines, -41 lines 0 comments Download
M tests/com/google/caja/parser/js/parsergolden10.txt View 6 7 8 9 10 11 12 13 14 3 chunks +46 lines, -41 lines 0 comments Download
M tests/com/google/caja/parser/js/parsertest10.js View 6 7 8 9 10 11 12 13 14 2 chunks +24 lines, -19 lines 0 comments Download
M tests/com/google/caja/parser/js/parsertest6.js View 14 1 chunk +4 lines, -0 lines 0 comments Download
M tests/com/google/caja/parser/js/rendergolden6.txt View 14 1 chunk +1 line, -0 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/MatchTest.java View 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -3 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/ModuleFormatTest.java View 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M tests/com/google/caja/parser/quasiliteral/c.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/foo/b.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/foo/testPrimordials.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/taming_test.html View 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
D tests/com/google/caja/parser/quasiliteral/testModule.co.js View 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -34 lines 0 comments Download
A + tests/com/google/caja/parser/quasiliteral/testModule.out.js View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/valija_module_loading.html View 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +7 lines, -4 lines 0 comments Download
M tests/com/google/caja/plugin/DomitaTest.java View 6 7 8 9 10 11 12 13 14 4 chunks +22 lines, -3 lines 0 comments Download
M tests/com/google/caja/plugin/ExpressionSanitizerTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +6 lines, -4 lines 0 comments Download
M tests/com/google/caja/plugin/HtmlCompiledPluginTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 11 chunks +41 lines, -28 lines 0 comments Download
M tests/com/google/caja/plugin/domita_test.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +88 lines, -80 lines 0 comments Download
M tests/com/google/caja/plugin/domita_test_untrusted.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 28 chunks +226 lines, -169 lines 0 comments Download
M tests/com/google/caja/plugin/jsunit.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +83 lines, -20 lines 0 comments Download
M tests/com/google/caja/plugin/stages/DebuggingSymbolsStageTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +95 lines, -63 lines 0 comments Download
M tests/com/google/caja/recursion.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -1 line 0 comments Download
M tests/com/google/caja/service/GadgetHandlerTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +22 lines, -8 lines 0 comments Download
M tests/com/google/caja/service/JsHandlerTest.java View 7 8 9 10 11 12 13 14 3 chunks +3 lines, -3 lines 0 comments Download
M tests/com/google/caja/util/RhinoTestBed.java View 6 7 8 9 10 11 12 13 14 7 chunks +36 lines, -24 lines 0 comments Download
M yuitest/yahoo_dom_host.html View 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 16
ihab.awad
16 years, 6 months ago (2009-10-22 00:26:14 UTC) #1
MikeSamuel
http://codereview.appspot.com/136053/diff/1/19 File tests/com/google/caja/demos/applet/CajaAppletTest.java (left): http://codereview.appspot.com/136053/diff/1/19#oldcode62 Line 62: TestUtil.readResource(getClass(), "caja-applet-cajita-golden.js"), Rather than throwing out a useful ...
16 years, 6 months ago (2009-10-22 00:50:28 UTC) #2
DavidSarah
http://codereview.appspot.com/136053/diff/1/38 File build.xml (right): http://codereview.appspot.com/136053/diff/1/38#newcode777 Line 777: language="cajita"/> language="caja" http://codereview.appspot.com/136053/diff/1/38#newcode783 Line 783: <output file="${www}/lolcat-search/kittens.co.html" language="cajita"/> ...
16 years, 6 months ago (2009-10-22 01:48:51 UTC) #3
ihab.awad
16 years, 5 months ago (2009-10-30 06:17:22 UTC) #4
ihab.awad
Snapshotted. http://codereview.appspot.com/136053/diff/1/38 File build.xml (right): http://codereview.appspot.com/136053/diff/1/38#newcode777 Line 777: language="cajita"/> On 2009/10/22 01:48:51, DavidSarah wrote: > ...
16 years, 5 months ago (2009-10-30 06:17:42 UTC) #5
DavidSarah
http://codereview.appspot.com/136053/diff/6098/5216 File build.xml (right): http://codereview.appspot.com/136053/diff/6098/5216#newcode870 Line 870: <output file="${www}/lolcat-search/searchbox.co.html" Is this convention still .co.html, or ...
16 years, 5 months ago (2009-10-30 08:41:27 UTC) #6
ihab.awad
16 years, 5 months ago (2009-11-02 05:53:00 UTC) #7
ihab.awad
New snapshot. http://codereview.appspot.com/136053/diff/6098/5216 File build.xml (right): http://codereview.appspot.com/136053/diff/6098/5216#newcode870 Line 870: <output file="${www}/lolcat-search/searchbox.co.html" On 2009/10/30 08:41:27, DavidSarah ...
16 years, 5 months ago (2009-11-02 05:53:47 UTC) #8
ihab.awad
Mike Samuel, could you please look at the Domita parts of this? Mike Stay agreed ...
16 years, 5 months ago (2009-11-10 18:05:34 UTC) #9
metaweta
LGTM. Please follow up with a message to the list that the API has changed, ...
16 years, 5 months ago (2009-11-11 20:25:25 UTC) #10
MikeSamuel
http://codereview.appspot.com/136053/diff/1/12 File tests/com/google/caja/plugin/domita_test.html (right): http://codereview.appspot.com/136053/diff/1/12#newcode211 tests/com/google/caja/plugin/domita_test.html:211: loadScript('valija.co.js'); On 2009/10/30 06:17:42, ihab.awad wrote: > On 2009/10/22 ...
16 years, 5 months ago (2009-11-11 22:46:34 UTC) #11
ihab.awad
Snapshotted. See replies below. http://codereview.appspot.com/136053/diff/7001/7039 File src/com/google/caja/cajita-module.js (right): http://codereview.appspot.com/136053/diff/7001/7039#newcode270 src/com/google/caja/cajita-module.js:270: // this should not happen ...
16 years, 5 months ago (2009-11-12 01:28:50 UTC) #12
MikeSamuel
I reviewed all the parts that Mike Stay didn't. Those parts LGTM
16 years, 5 months ago (2009-11-12 03:29:04 UTC) #13
MikeSamuel
LGTM http://codereview.appspot.com/136053/diff/9157/9203 File src/com/google/caja/parser/js/Directive.java (right): http://codereview.appspot.com/136053/diff/9157/9203#newcode103 src/com/google/caja/parser/js/Directive.java:103: // Escaping has modified the directive. Render nothing. ...
16 years, 5 months ago (2009-11-13 20:52:30 UTC) #14
ihab.awad
@3846
16 years, 5 months ago (2009-11-13 21:47:37 UTC) #15
DavidSarah
16 years, 5 months ago (2009-11-14 02:13:08 UTC) #16
http://codereview.appspot.com/136053/diff/9157/9203
File src/com/google/caja/parser/js/Directive.java (right):

http://codereview.appspot.com/136053/diff/9157/9203#newcode102
src/com/google/caja/parser/js/Directive.java:102: if
(!escaped.toString().contains(directiveString)) {
.contains is wrong, I think. Suppose directiveString is a single backslash
character; it will be escaped to something that contains a backslash.

Use !escaped.substring(1, escaped.length()-1).equals(directiveString).

(StringBuilder implements substring.)

http://codereview.appspot.com/136053/diff/9157/9206
File src/com/google/caja/parser/js/DirectivePrologue.java (right):

http://codereview.appspot.com/136053/diff/9157/9206#newcode50
src/com/google/caja/parser/js/DirectivePrologue.java:50: * <a
href="http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&cache=cache&media=es3.1:es5-tc392008-040.pdf">the
ES5 spec</a>.
That isn't the final version. Just refer to
http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft

http://codereview.appspot.com/136053/diff/9157/9204
File src/com/google/caja/parser/js/Parser.java (right):

http://codereview.appspot.com/136053/diff/9157/9204#newcode338
src/com/google/caja/parser/js/Parser.java:338: case KEYWORD:
What about infix keywords such as 'in' or 'instanceof'?
For example, '"use strict" in {}'.

http://codereview.appspot.com/136053/diff/9157/9204#newcode340
src/com/google/caja/parser/js/Parser.java:340: isDirective = true;
Nope.
For example, '"use strict" /*foo*/ + ""'.

http://codereview.appspot.com/136053/diff/9157/9204#newcode349
src/com/google/caja/parser/js/Parser.java:349: } else if
(tq.lookaheadToken(Punctuation.RCURLY)) {
'}' is not the only punctuation that will cause semicolon insertion here.

http://codereview.appspot.com/136053/diff/9157/9204#newcode357
src/com/google/caja/parser/js/Parser.java:357: break;
Line continuations prevent a string from being a directive, even if followed by
another string, so looping is wrong.

Stopped looking for more problems; I think duplicating the semicolon insertion
logic here is probably not a good approach.
Sign in to reply to this message.

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