http://codereview.appspot.com/96177/diff/1028/26
File src/com/google/caja/cajita.js (right):

http://codereview.appspot.com/96177/diff/1028/26#newcode3172
Line 3172: /*
On 2009/08/03 18:24:09, ihab.awad wrote:
The promise implementation and the definition of Q can be moved to a
different
file, right? You can have the file contain something like:

   var Q;
   (function() {
     /* encapsulated definitions ... */
     Q = /* something */;
   })();

Then cajita.js can check if Q is available, and do:

   if (Q) { /* freeze Q */ }
   cajita = { Q: Q, /* ... */ };

People who want to provide Q to their Cajita would then be sure to
include the
necessary file before "cajita.js". And we would modify our build
scripts to
always bundle that file in by default.

The advantage of this approach is it makes it possible to diff
directly with
Tyler's implementation and move towards a more common Q.

The file should contain a comment based on Tyler's original, giving
credit etc.

Done.

http://codereview.appspot.com/96177/diff/1028/26#newcode3176
Line 3176: * Mostly taken from the web_send implementation by Tyler
Close
On 2009/08/03 18:24:09, ihab.awad wrote:
I think you meant ref_send.js? (ref_send is a component of web_send.)

Done.

http://codereview.appspot.com/96177/diff/1028/26#newcode3576
Line 3576:
On 2009/08/03 18:24:09, ihab.awad wrote:
Extra leading spaces added to this line.

Done.

http://codereview.appspot.com/96177/diff/1028/26#newcode3756
Line 3756: xhrModuleLoaderMaker = function(urlRewriter) {
On 2009/08/03 18:24:09, ihab.awad wrote:
You know what? I was thinking and maybe it's easiest to just make the
xhrModuleLoader a *singleton* in the page in which it lives. If I want
to
provide an attenuated loader, I just do:

   var theLoader = ___.primFreeze({
     load: ___.markFuncFreeze(function(name) {
       return xhrModuleLoader.load(
           'http://cajoler.org/' + name + '.js');
     })
   });

or whatever. Would that be easier and simpler and more easily
explainable to the
universe than having to deal with the "URL rewriter chain" in the
loaders?

Done.

http://codereview.appspot.com/96177/diff/1028/26#newcode3763
Line 3763: if (xhr.status  === 200) {
On 2009/08/03 18:24:09, ihab.awad wrote:
Extra space before "===".

Done.

http://codereview.appspot.com/96177/diff/1028/26#newcode3767
Line 3767: r.resolve(theModule);
On 2009/08/03 18:24:09, ihab.awad wrote:
Can eliminate local variable 'theModule' -> simpler?

Done.

http://codereview.appspot.com/96177/diff/1028/18
File tests/com/google/caja/a.js (right):

http://codereview.appspot.com/96177/diff/1028/18#newcode1
Line 1: ({
On 2009/08/03 18:24:09, ihab.awad wrote:
Why do you need to create explicit cajoled modules in the test source
directory?
You can instead use the build file to cajole some things into the
ant-lib
directory, similarly to how (say) domita_test_untrusted.html is
cajoled at build
time.

Done.

http://codereview.appspot.com/96177/diff/1028/22
File tests/com/google/caja/plugin/domita_test.html (right):

http://codereview.appspot.com/96177/diff/1028/22#newcode408
Line 408: function (src) {return '/tests/com/google/caja/' + src;});
On 2009/08/03 18:24:09, ihab.awad wrote:
How does that work without the "http://localhost:8000/..."; stuff added
to the
front? :)

"http://localhost:8000"; is implicit because the page is on
localhost:8000. I did not include that because using xhr loader
implicitly requires the module to be retrieved from the same domain.

http://codereview.appspot.com/96177/diff/1028/23
File tests/com/google/caja/plugin/domita_test_untrusted.html (right):

http://codereview.appspot.com/96177/diff/1028/23#newcode2508
Line 2508: function testXhrModuleLoader() {
On 2009/08/03 18:24:09, ihab.awad wrote:
Indentation.

Done.

http://codereview.appspot.com/96177/diff/1028/23#newcode2519
Line 2519: var r = Q.when(m, f1, f2);
On 2009/08/03 18:24:09, ihab.awad wrote:
Variable 'r' unused.

Done.

http://codereview.appspot.com/96177/diff/1028/23#newcode2555
Line 2555: function testScriptModuleLoader() {
On 2009/08/03 18:24:09, ihab.awad wrote:
Indentation.

Done.

http://codereview.appspot.com/96177

Reply via email to