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

Issue 8612048: Work around WeakMap not accepting some object keys. (Closed)

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

Description

* If the browser (particularly Firefox 20 & 21) provides a WeakMap which does not accept certain objects as keys (particularly events), then define a dual-implementation WeakMap constructor which uses the browser's WeakMap unless it rejects the key, then falls back to our WeakMap emulation. * Domado contained code for working around being able to see the emulated WeakMap's magic property lookups using Proxy handlers, which had gotten out of date since it was never exercised as we have had no browsers which have Proxy but not WeakMap; update it to use results from actual proxies to obtain the magic property name. * Domado's ProxyHandler.prototype now has a .constructor property so that tamperProof knows its properties should be overridable. @r5353

Patch Set 1 #

Total comments: 14

Patch Set 2 : Work around WeakMap not accepting some object keys. #

Patch Set 3 : Work around WeakMap not accepting some object keys. #

Patch Set 4 : Work around WeakMap not accepting some object keys. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+292 lines, -53 lines) Patch
M src/com/google/caja/es53.js View 2 chunks +80 lines, -36 lines 0 comments Download
M src/com/google/caja/parser/quasiliteral/ReservedNames.java View 1 chunk +1 line, -0 lines 0 comments Download
M src/com/google/caja/plugin/domado.js View 1 2 3 9 chunks +56 lines, -10 lines 0 comments Download
M src/com/google/caja/ses/WeakMap.js View 1 6 chunks +68 lines, -7 lines 4 comments Download
M tests/com/google/caja/plugin/es53-test-language-guest.html View 1 1 chunk +87 lines, -0 lines 0 comments Download

Messages

Total messages: 15
kpreid2
12 years, 11 months ago (2013-04-15 18:25:45 UTC) #1
MarkM
Looks good enough for now. For this, if urgent, a detailed review can be post-commit.
12 years, 11 months ago (2013-04-15 18:36:05 UTC) #2
MarkM
Please also add another reviewer for more eyeballs and more eyeballing time.
12 years, 11 months ago (2013-04-15 18:37:50 UTC) #3
kpreid2
On 2013/04/15 18:37:50, MarkM wrote: > Please also add another reviewer for more eyeballs and ...
12 years, 11 months ago (2013-04-15 18:39:20 UTC) #4
ihab.awad
I'm on it. :) On Mon, Apr 15, 2013 at 11:39 AM, <kpreid.switchb.org@gmail.com> wrote: > ...
12 years, 11 months ago (2013-04-15 18:39:40 UTC) #5
MarkM
All but domado.js reviewed for real. On domado.js, I just don't have enough context (or ...
12 years, 11 months ago (2013-04-15 19:46:12 UTC) #6
ihab.awad
lgtm++ https://codereview.appspot.com/8612048/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/8612048/diff/1/src/com/google/caja/plugin/domado.js#newcode571 src/com/google/caja/plugin/domado.js:571: */ I guess one thing that concerns me ...
12 years, 11 months ago (2013-04-15 20:36:53 UTC) #7
kpreid2
* If the browser (particularly Firefox 20 & 21) provides a WeakMap which does not ...
12 years, 11 months ago (2013-04-15 21:06:26 UTC) #8
kpreid2
* If the browser (particularly Firefox 20 & 21) provides a WeakMap which does not ...
12 years, 11 months ago (2013-04-15 21:08:51 UTC) #9
kpreid2
New snapshot. https://codereview.appspot.com/8612048/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/8612048/diff/1/src/com/google/caja/plugin/domado.js#newcode574 src/com/google/caja/plugin/domado.js:574: var ProxyHandler = domitaModules.ProxyHandler; On 2013/04/15 19:46:12, ...
12 years, 11 months ago (2013-04-15 21:09:40 UTC) #10
ihab.awad
https://codereview.appspot.com/8612048/diff/16001/src/com/google/caja/ses/WeakMap.js File src/com/google/caja/ses/WeakMap.js (right): https://codereview.appspot.com/8612048/diff/16001/src/com/google/caja/ses/WeakMap.js#newcode462 src/com/google/caja/ses/WeakMap.js:462: if (typeof HostWeakMap === 'function') (function() { Still with ...
12 years, 11 months ago (2013-04-15 21:17:34 UTC) #11
kpreid2
https://codereview.appspot.com/8612048/diff/16001/src/com/google/caja/ses/WeakMap.js File src/com/google/caja/ses/WeakMap.js (right): https://codereview.appspot.com/8612048/diff/16001/src/com/google/caja/ses/WeakMap.js#newcode462 src/com/google/caja/ses/WeakMap.js:462: if (typeof HostWeakMap === 'function') (function() { On 2013/04/15 ...
12 years, 11 months ago (2013-04-15 21:19:55 UTC) #12
MarkM
Non-domado parts LGTM. I leave the domado parts to Ihab. https://codereview.appspot.com/8612048/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/8612048/diff/1/src/com/google/caja/plugin/domado.js#newcode581 ...
12 years, 11 months ago (2013-04-15 21:33:29 UTC) #13
kpreid2
https://codereview.appspot.com/8612048/diff/16001/src/com/google/caja/ses/WeakMap.js File src/com/google/caja/ses/WeakMap.js (right): https://codereview.appspot.com/8612048/diff/16001/src/com/google/caja/ses/WeakMap.js#newcode462 src/com/google/caja/ses/WeakMap.js:462: if (typeof HostWeakMap === 'function') (function() { On 2013/04/15 ...
12 years, 11 months ago (2013-04-15 21:35:49 UTC) #14
MarkM
12 years, 11 months ago (2013-04-15 21:40:34 UTC) #15
Please consider a CL just adding these curlies to already be LGTMed, so
commit when ready without need for further feedback.


On Mon, Apr 15, 2013 at 2:35 PM, <kpreid.switchb.org@gmail.com> wrote:

>
> https://codereview.appspot.**com/8612048/diff/16001/src/**
>
com/google/caja/ses/WeakMap.js<https://codereview.appspot.com/8612048/diff/16001/src/com/google/caja/ses/WeakMap.js>
> File src/com/google/caja/ses/**WeakMap.js (right):
>
> https://codereview.appspot.**com/8612048/diff/16001/src/**
>
com/google/caja/ses/WeakMap.**js#newcode462<https://codereview.appspot.com/8612048/diff/16001/src/com/google/caja/ses/WeakMap.js#newcode462>
> src/com/google/caja/ses/**WeakMap.js:462: if (typeof HostWeakMap ===
> 'function') (function() {
> On 2013/04/15 21:33:30, MarkM wrote:
>
>> On 2013/04/15 21:19:55, kpreid2 wrote:
>> > OK, OK, changed.
>>
>
>  I don't see the curlies. Did you forget to snapshot?
>>
>
> Yup, and I just blew away my local copy after committing (Ihab said
> lgtm++), so I can't.
>
>
https://codereview.appspot.**com/8612048/<https://codereview.appspot.com/8612...
>



-- 
Text by me above is hereby placed in the public domain

  Cheers,
  --MarkM
Sign in to reply to this message.

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