escape

1 view
Skip to first unread message

Mike Stay

unread,
Feb 1, 2010, 9:49:32 PM2/1/10
to Google Caja Discuss
Cajita overrides the function escape, typically used to do url
escaping. Was that intentional?

--
Mike Stay - meta...@gmail.com
http://math.ucr.edu/~mike
http://reperiendi.wordpress.com

Mike Samuel

unread,
Feb 1, 2010, 9:57:36 PM2/1/10
to google-ca...@googlegroups.com
Use encodeURIComponent instead.


2010/2/2 Mike Stay <meta...@gmail.com>

Mark S. Miller

unread,
Feb 1, 2010, 10:44:28 PM2/1/10
to google-ca...@googlegroups.com
On Mon, Feb 1, 2010 at 6:49 PM, Mike Stay <meta...@gmail.com> wrote:
Cajita overrides the function escape, typically used to do url
escaping.  Was that intentional?


Just looked. This is a bug. The intension was to define a cajita.escape() that had nothing to do with the global escape. However, the code for capturing the global escape, if there is one, in sharedImports is

  sharedImports = {
    ...
    escape: escape ? markFuncFreeze(escape) : (void 0),
    ...
  };

Since this appears within the main body of cajita.js, it is accidentally capturing the internally defined escape function intended for use as cajita.escape(). We should simply rename cajita.escape(). To what? Please, no one suggest "cajita.callWithEscapeContinuation()" ;).



--
   Cheers,
   --MarkM

Mike Stay

unread,
Feb 1, 2010, 11:07:26 PM2/1/10
to google-ca...@googlegroups.com
On Tue, Feb 2, 2010 at 2:44 PM, Mark S. Miller <eri...@google.com> wrote:
> On Mon, Feb 1, 2010 at 6:49 PM, Mike Stay <meta...@gmail.com> wrote:
>>
>> Cajita overrides the function escape, typically used to do url
>> escaping.  Was that intentional?
>>
>
> Just looked. This is a bug. The intension was to define a cajita.escape()
> that had nothing to do with the global escape. However, the code for
> capturing the global escape, if there is one, in sharedImports is
>   sharedImports = {
>     ...
>     escape: escape ? markFuncFreeze(escape) : (void 0),
>     ...
>   };
> Since this appears within the main body of cajita.js, it is accidentally
> capturing the internally defined escape function intended for use as
> cajita.escape(). We should simply rename cajita.escape(). To what? Please,
> no one suggest "cajita.callWithEscapeContinuation()" ;).

Why rename cajita.escape? I think it's perfectly fine. Just use
global.escape in the section above, or replace it with
escapeURIComponent or don't include it at all.

Mark S. Miller

unread,
Feb 2, 2010, 12:29:37 AM2/2/10
to google-ca...@googlegroups.com
On Mon, Feb 1, 2010 at 8:07 PM, Mike Stay <meta...@gmail.com> wrote:
On Tue, Feb 2, 2010 at 2:44 PM, Mark S. Miller <eri...@google.com> wrote:
> On Mon, Feb 1, 2010 at 6:49 PM, Mike Stay <meta...@gmail.com> wrote:
>>
>> Cajita overrides the function escape, typically used to do url
>> escaping.  Was that intentional?
>>
>
> Just looked. This is a bug. The intension was to define a cajita.escape()
> that had nothing to do with the global escape. However, the code for
> capturing the global escape, if there is one, in sharedImports is
>   sharedImports = {
>     ...
>     escape: escape ? markFuncFreeze(escape) : (void 0),
>     ...
>   };
> Since this appears within the main body of cajita.js, it is accidentally
> capturing the internally defined escape function intended for use as
> cajita.escape(). We should simply rename cajita.escape(). To what? Please,
> no one suggest "cajita.callWithEscapeContinuation()" ;).

Why rename cajita.escape?

To avoid an unnecessary coincidence if another name that's as good could be found. But I haven't thought of anything.
 
 I think it's perfectly fine.  Just use
global.escape in the section above, or replace it with
escapeURIComponent or don't include it at all.

That would also be fine. 



--
   Cheers,
   --MarkM

Mike Samuel

unread,
Feb 2, 2010, 1:14:33 AM2/2/10
to google-ca...@googlegroups.com
Has a bug been filed?

2010/2/2 Mark S. Miller <eri...@google.com>

David-Sarah Hopwood

unread,
Feb 2, 2010, 3:00:05 PM2/2/10
to google-ca...@googlegroups.com
Mike Stay wrote:
> On Tue, Feb 2, 2010 at 2:44 PM, Mark S. Miller <eri...@google.com> wrote:
>> On Mon, Feb 1, 2010 at 6:49 PM, Mike Stay <meta...@gmail.com> wrote:
>>> Cajita overrides the function escape, typically used to do url
>>> escaping. Was that intentional?
>>>
>> Just looked. This is a bug. The intension was to define a cajita.escape()
>> that had nothing to do with the global escape. However, the code for
>> capturing the global escape, if there is one, in sharedImports is
>> sharedImports = {
>> ...
>> escape: escape ? markFuncFreeze(escape) : (void 0),
>> ...
>> };
>> Since this appears within the main body of cajita.js, it is accidentally
>> capturing the internally defined escape function intended for use as
>> cajita.escape(). We should simply rename cajita.escape(). To what? Please,
>> no one suggest "cajita.callWithEscapeContinuation()" ;).
>
> Why rename cajita.escape? I think it's perfectly fine.

I wouldn't have had any idea that cajita.escape had something to do with
escape continuations. I suggest cajita.callWithEscape.

--
David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com

signature.asc

Mark S. Miller

unread,
Feb 2, 2010, 3:34:11 PM2/2/10
to google-ca...@googlegroups.com
As a description of what it actually does, perhaps callWithEjector?
 
--
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com




--
   Cheers,
   --MarkM

David-Sarah Hopwood

unread,
Feb 2, 2010, 4:31:02 PM2/2/10
to google-ca...@googlegroups.com
Mark S. Miller wrote:
> David-Sarah Hopwood <david...@jacaranda.org> wrote:
>> Mike Stay wrote:
>>> On Tue, Feb 2, 2010 at 2:44 PM, Mark S. Miller <eri...@google.com>
>> wrote:
>>>> ... We should simply rename cajita.escape(). To what?

>>>> Please, no one suggest "cajita.callWithEscapeContinuation()" ;).
>>>
>>> Why rename cajita.escape? I think it's perfectly fine.
>>
>> I wouldn't have had any idea that cajita.escape had something to do with
>> escape continuations. I suggest cajita.callWithEscape.
>
> As a description of what it actually does, perhaps callWithEjector?

Yes, that's better.

signature.asc

Mark S. Miller

unread,
Feb 2, 2010, 5:19:33 PM2/2/10
to google-ca...@googlegroups.com
On Mon, Feb 1, 2010 at 10:14 PM, Mike Samuel <mikes...@gmail.com> wrote:
Has a bug been filed?




--
   Cheers,
   --MarkM
Reply all
Reply to author
Forward
0 new messages