http://codereview.appspot.com/4211045/diff/25001/src/com/google/caja/plugin/caja.js
File src/com/google/caja/plugin/caja.js (right):

http://codereview.appspot.com/4211045/diff/25001/src/com/google/caja/plugin/caja.js#newcode295
src/com/google/caja/plugin/caja.js:295: Builder.prototype = {
On 2011/03/23 18:35:24, ihab.awad wrote:
So fwiw -- given that we've implemented this, it looks to me like
there is no
need for a Builder _per se_ since there is no use case for a fluent
interface
(aBuilder.withFoo().andBar().butBaz().exceptBoo()...). The calls are
always only
one deep. So maybe cajoledAtUrl(), cajoled(), and friends should just
be
functions on the frame. The could return a run()-able, or they could
incorporate
the parameters of run() in their own interface -- whichever. Does this
make
sense?

Totally, although I can imagine we might want to do something in the
future like "don't allow this thing network access even if it tries to
dynamically cajole stuff that isn't in the cache".  This API seems
somewhat friendlier to future extension.

http://codereview.appspot.com/4211045/diff/25001/src/com/google/caja/plugin/caja.js#newcode305
src/com/google/caja/plugin/caja.js:305: cajoled: function(src,
cajoledJs, opt_staticHtml) {
On 2011/03/23 18:35:24, ihab.awad wrote:
What is 'src' for?

Ostensibly for setting the base URL, but I'm not sure how to pass that
to the module.

http://codereview.appspot.com/4211045/diff/25001/src/com/google/caja/plugin/caja.js#newcode330
src/com/google/caja/plugin/caja.js:330: raw: function(src, html) {
On 2011/03/23 18:35:24, ihab.awad wrote:
What is 'src' for?

Again, the base URL.

http://codereview.appspot.com/4211045/diff/25001/src/com/google/caja/plugin/caja.js#newcode382
src/com/google/caja/plugin/caja.js:382: } else if ('cajoledAtUrl' ===
this.case___){
On 2011/03/23 18:35:24, ihab.awad wrote:
Isn't this the 'rawAtUrl' case? loader.async(url) will go fetch the
(raw)
content via a cajoling service *and cajole* it.

Done.

http://codereview.appspot.com/4211045/diff/25001/src/com/google/caja/plugin/caja.js#newcode396
src/com/google/caja/plugin/caja.js:396: return new Builder();
On 2011/03/23 18:35:24, ihab.awad wrote:
What happens if a client calls builder() twice, diddles with both of
them, then
calls run() on one builder, then calls run() on the second? By my
interpretation, since the variable 'run___' is state in the builder,
not in the
frame itself, caja.js would attempt to run two modules in the same
frame.

Fixed.

http://codereview.appspot.com/4211045/diff/25001/tests/com/google/caja/plugin/default-test-driver.js
File tests/com/google/caja/plugin/default-test-driver.js (right):

http://codereview.appspot.com/4211045/diff/25001/tests/com/google/caja/plugin/default-test-driver.js#newcode27
tests/com/google/caja/plugin/default-test-driver.js:27:
.cajoledAtUrl(testCase)
On 2011/03/23 18:35:24, ihab.awad wrote:
Happiness prevaileth.

Except now, cajoledAtUrl is unimplemented.  Can you point me at a code
snippet using the module loader API for that case?

http://codereview.appspot.com/4211045/

Reply via email to