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

Issue 95051: Securable modules implementation II (Closed)

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

Description

Now it includes the module only once when the module is referenced multiple times.

Patch Set 1 #

Patch Set 2 : using prepareModule #

Total comments: 37

Patch Set 3 : a revised version #

Patch Set 4 : a revised version #

Total comments: 33

Patch Set 5 : a revised version #

Unified diffs Side-by-side diffs Delta from patch set Stats (+408 lines, -104 lines) Patch
M src/com/google/caja/cajita.js View 2 2 chunks +18 lines, -0 lines 0 comments Download
A src/com/google/caja/parser/js/CajoledModuleExpression.java View 1 2 3 4 1 chunk +69 lines, -0 lines 0 comments Download
A src/com/google/caja/parser/quasiliteral/CajitaModuleRewriter.java View 3 4 1 chunk +136 lines, -0 lines 0 comments Download
M src/com/google/caja/parser/quasiliteral/CajitaRewriter.java View 1 2 9 chunks +15 lines, -97 lines 0 comments Download
A src/com/google/caja/parser/quasiliteral/ModuleManager.java View 1 2 3 4 1 chunk +144 lines, -0 lines 0 comments Download
M src/com/google/caja/plugin/ExpressionSanitizerCaja.java View 1 chunk +1 line, -2 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/CajitaRewriterTest.java View 1 2 2 chunks +25 lines, -5 lines 0 comments Download

Messages

Total messages: 9
maoziqing
16 years, 10 months ago (2009-07-16 00:21:33 UTC) #1
maoziqing
16 years, 10 months ago (2009-07-16 18:40:23 UTC) #2
ihab.awad
http://codereview.appspot.com/95051/diff/1001/1007 File src/com/google/caja/cajita.js (right): http://codereview.appspot.com/95051/diff/1001/1007#newcode2628 Line 2628: setStatic(theModule, 'cajoledDate', module.cajoledDate); It should be possible to ...
16 years, 10 months ago (2009-07-16 22:52:21 UTC) #3
maoziqing
16 years, 10 months ago (2009-07-17 21:08:31 UTC) #4
maoziqing
16 years, 10 months ago (2009-07-17 21:10:13 UTC) #5
maoziqing
Thank you for the review. http://codereview.appspot.com/95051/diff/1001/1007 File src/com/google/caja/cajita.js (right): http://codereview.appspot.com/95051/diff/1001/1007#newcode2628 Line 2628: setStatic(theModule, 'cajoledDate', module.cajoledDate); ...
16 years, 10 months ago (2009-07-17 21:10:48 UTC) #6
maoziqing
16 years, 10 months ago (2009-07-17 21:39:37 UTC) #7
ihab.awad
LGTM++ http://codereview.appspot.com/95051/diff/35/1018 File src/com/google/caja/cajita.js (right): http://codereview.appspot.com/95051/diff/35/1018#newcode2623 Line 2623: return module.instantiate(___, imports); Code style: Too much ...
16 years, 10 months ago (2009-07-17 22:01:44 UTC) #8
maoziqing
16 years, 10 months ago (2009-07-18 00:55:39 UTC) #9
Committed revision 3595.

http://codereview.appspot.com/95051/diff/35/1018
File src/com/google/caja/cajita.js (right):

http://codereview.appspot.com/95051/diff/35/1018#newcode2623
Line 2623: return module.instantiate(___, imports);
On 2009/07/17 22:01:44, ihab.awad wrote:
> Code style: Too much indentation (indent 2 spaces out)

Done.

http://codereview.appspot.com/95051/diff/35/1018#newcode2629
Line 2629: setStatic(theModule, k, v);
On 2009/07/17 22:01:44, ihab.awad wrote:
> Code style: Too much indentation (indent 4 spaces out)

Done.

http://codereview.appspot.com/95051/diff/35/1016
File src/com/google/caja/parser/js/CajoledModuleExpression.java (right):

http://codereview.appspot.com/95051/diff/35/1016#newcode67
Line 67: new ExpressionStmt(FilePosition.UNKNOWN, e).render(r);
On 2009/07/17 22:01:44, ihab.awad wrote:
> Don't have to wrap in ExpressionStmt - just render 'e'

Done.

http://codereview.appspot.com/95051/diff/35/1015
File src/com/google/caja/parser/quasiliteral/CajitaModuleRewriter.java (right):

http://codereview.appspot.com/95051/diff/35/1015#newcode1
Line 1: // Copyright (C) 2007 Google Inc.
On 2009/07/17 22:01:44, ihab.awad wrote:
> 2009, this is a new file

Done.

http://codereview.appspot.com/95051/diff/35/1015#newcode36
Line 36: * Add a top-level module envelop
On 2009/07/17 22:01:44, ihab.awad wrote:
> envelope

Done.

http://codereview.appspot.com/95051/diff/35/1015#newcode37
Line 37: * Call the CajoleRewriter to do the actual rewriting
On 2009/07/17 22:01:44, ihab.awad wrote:
> CajitaRewriter

Done.

http://codereview.appspot.com/95051/diff/35/1015#newcode39
Line 39: * @author ihab.awad@gmail.com (Ihab Awad)
On 2009/07/17 22:01:44, ihab.awad wrote:
> mailto:maoziqing@gmail.com :)

Done.

http://codereview.appspot.com/95051/diff/35/1015#newcode74
Line 74: /*       TODO(ihab.awad): manifest */
On 2009/07/17 22:01:44, ihab.awad wrote:
> Actually, for an "envelope" module, these 4 fields don't really make sense ...
I
> think we can just delete them for good and not worry about them.

Done.

http://codereview.appspot.com/95051/diff/35/1015#newcode120
Line 120: * Creates a Cajita rewriter
On 2009/07/17 22:01:44, ihab.awad wrote:
> CajitaModuleRewriter

Done.

http://codereview.appspot.com/95051/diff/35/1014
File src/com/google/caja/parser/quasiliteral/CajitaRewriter.java (right):

http://codereview.appspot.com/95051/diff/35/1014#newcode446
Line 446: throw new RuntimeException("Failed to get the module manager");
On 2009/07/17 22:01:44, ihab.awad wrote:
> Can turn this into an assertion in the constructor -- assert(moduleManager !=
> null) -- thus catching the problem earlier *and* simplifying this code.

Done.

http://codereview.appspot.com/95051/diff/35/1014#newcode449
Line 449: int index = moduleManager.getModule((StringLiteral)arg);
On 2009/07/17 22:01:44, ihab.awad wrote:
> Code style: space after type cast: "(StringLiteral) arg"

Done.

http://codereview.appspot.com/95051/diff/35/1013
File src/com/google/caja/parser/quasiliteral/ModuleManager.java (right):

http://codereview.appspot.com/95051/diff/35/1013#newcode70
Line 70: (UncajoledModule)uncajoledModule.clone();
On 2009/07/17 22:01:44, ihab.awad wrote:
> Don't bother to clone :)

Done.

http://codereview.appspot.com/95051/diff/35/1013#newcode73
Line 73: (CajoledModule)dcr.expand(clonedUncajoledModule, mq);
On 2009/07/17 22:01:44, ihab.awad wrote:
> Code style: Continuation indent is 4 spaces, and add space between typecast
> operator and its value "(CajoledModule) dcr...."

Done.

http://codereview.appspot.com/95051/diff/35/1013#newcode105
Line 105: this.pluginEnv.loadExternalResource(er, "text/javascript");
On 2009/07/17 22:01:44, ihab.awad wrote:
> Code style: Continuation indent = 4 spaces. And a bunch of other places in
this
> file.

Done.

http://codereview.appspot.com/95051/diff/35/1012
File tests/com/google/caja/parser/quasiliteral/CajitaRewriterTest.java (right):

http://codereview.appspot.com/95051/diff/35/1012#newcode2297
Line 2297: */
On 2009/07/17 22:01:44, ihab.awad wrote:
> Remove commented material

Done.

http://codereview.appspot.com/95051/diff/35/1012#newcode2298
Line 2298: CajitaModuleRewriter moduleRewriter = new CajitaModuleRewriter(
On 2009/07/17 22:01:44, ihab.awad wrote:
> Please add a TODO to refactor the test classes somehow so that this local
change
> -- setRewriter(moduleRewriter) and changing the kind of node passed to
> checkAddsMessage -- is not necessary.

Done.
Sign in to reply to this message.

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