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

Issue 4701044: Adds object proxies. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 4 months ago by metaweta
Modified:
15 years, 3 months ago
CC:
google-caja-discuss_googlegroups.com, tvcutsem_vub.ac.be
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Adds object proxies.

Patch Set 1 #

Total comments: 14

Patch Set 2 : Adds object proxies. #

Total comments: 9

Patch Set 3 : Adds object proxies. #

Total comments: 2

Patch Set 4 : Adds object proxies. #

Total comments: 10

Patch Set 5 : Adds object proxies. #

Total comments: 1

Patch Set 6 : Adds object proxies. #

Patch Set 7 : Adds object proxies. #

Patch Set 8 : Adds object proxies. #

Total comments: 14

Patch Set 9 : Adds object proxies. #

Total comments: 1

Patch Set 10 : Adds object proxies. #

Patch Set 11 : Adds object proxies. #

Patch Set 12 : Adds object proxies. #

Patch Set 13 : Adds object proxies. #

Patch Set 14 : Adds object proxies. #

Patch Set 15 : Adds object proxies. #

Total comments: 5

Patch Set 16 : Adds object proxies. #

Total comments: 5

Patch Set 17 : Adds object proxies. #

Total comments: 5

Patch Set 18 : Adds object proxies. #

Patch Set 19 : Adds object proxies. #

Patch Set 20 : Adds object proxies. #

Patch Set 21 : Adds object proxies. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+698 lines, -121 lines) Patch
M src/com/google/caja/es53.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 29 chunks +586 lines, -120 lines 2 comments Download
M tests/com/google/caja/parser/quasiliteral/ES53RewriterTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +112 lines, -1 line 0 comments Download

Messages

Total messages: 30
metaweta
15 years, 4 months ago (2011-07-13 18:14:44 UTC) #1
Mark S. Miller
Talk to me about fixing proxies. http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js#newcode134 src/com/google/caja/es53.js:134: * Per-object properties: ...
15 years, 4 months ago (2011-07-13 23:06:18 UTC) #2
Mark S. Miller
http://codereview.appspot.com/4701044/diff/3001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/3001/src/com/google/caja/es53.js#newcode4694 src/com/google/caja/es53.js:4694: return !!(dis.getPropertyDescriptor_m___ === dis ? The fastpath test for ...
15 years, 4 months ago (2011-07-14 05:01:01 UTC) #3
metaweta
http://codereview.appspot.com/4701044/diff/3001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/3001/src/com/google/caja/es53.js#newcode4694 src/com/google/caja/es53.js:4694: return !!(dis.getPropertyDescriptor_m___ === dis ? On 2011/07/14 05:01:01, Mark ...
15 years, 4 months ago (2011-07-14 22:56:31 UTC) #4
Mark S. Miller
http://codereview.appspot.com/4701044/diff/8001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/8001/src/com/google/caja/es53.js#newcode2757 src/com/google/caja/es53.js:2757: if (!O[P + '_v___']) { This looks like an ...
15 years, 4 months ago (2011-07-14 22:59:09 UTC) #5
Mark S. Miller
http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js#newcode2757 src/com/google/caja/es53.js:2757: if (O.hasOwnProperty(P + '_v___')) { Did you drop a ...
15 years, 4 months ago (2011-07-15 04:03:02 UTC) #6
Mark S. Miller
http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js#newcode4788 src/com/google/caja/es53.js:4788: names.filter(filter) : Is filter virtualized? http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js#newcode4840 src/com/google/caja/es53.js:4840: validateHandler(handler); Is ...
15 years, 4 months ago (2011-07-15 04:59:13 UTC) #7
metaweta
http://codereview.appspot.com/4701044/diff/8001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/8001/src/com/google/caja/es53.js#newcode2757 src/com/google/caja/es53.js:2757: if (!O[P + '_v___']) { On 2011/07/14 22:59:09, Mark ...
15 years, 4 months ago (2011-07-15 16:45:40 UTC) #8
Mark S. Miller
http://codereview.appspot.com/4701044/diff/18001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/18001/src/com/google/caja/es53.js#newcode2755 src/com/google/caja/es53.js:2755: // Inline HasOwnProperty___. Works with proxies because GetOwnProperty___ The ...
15 years, 4 months ago (2011-07-15 17:33:23 UTC) #9
metaweta
http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js#newcode4788 src/com/google/caja/es53.js:4788: names.filter(filter) : On 2011/07/15 04:59:13, Mark S. Miller wrote: ...
15 years, 4 months ago (2011-07-15 18:18:51 UTC) #10
metaweta
Fixed up a bunch of the semantics, adding guards etc.
15 years, 4 months ago (2011-07-16 00:21:46 UTC) #11
metaweta
What should we do about asFirstClass? I don't think there's a value we can compare ...
15 years, 4 months ago (2011-07-16 00:34:05 UTC) #12
Mark S. Miller
http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js#newcode3563 src/com/google/caja/es53.js:3563: var keys = ownKeys(O), len = keys.length; I think ...
15 years, 4 months ago (2011-07-19 23:11:39 UTC) #13
Mark S. Miller
http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js#newcode4711 src/com/google/caja/es53.js:4711: return desc.get.f___(safeDis(proxy), []); Since desc is untrusted (it came ...
15 years, 4 months ago (2011-07-20 00:12:02 UTC) #14
Mark S. Miller
http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js#newcode4804 src/com/google/caja/es53.js:4804: var desc = dis.getPropertyDescriptor_m___ ? Not that it will ...
15 years, 4 months ago (2011-07-20 00:25:23 UTC) #15
Mark S. Miller
http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js#newcode4711 src/com/google/caja/es53.js:4711: return desc.get.f___(safeDis(proxy), []); On 2011/07/20 00:12:02, Mark S. Miller ...
15 years, 4 months ago (2011-07-20 00:37:53 UTC) #16
Mark S. Miller
http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js#newcode4827 src/com/google/caja/es53.js:4827: if (!h || typeof h !== 'object') { Can ...
15 years, 4 months ago (2011-07-20 00:54:42 UTC) #17
metaweta
http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js#newcode3563 src/com/google/caja/es53.js:3563: var keys = ownKeys(O), len = keys.length; On 2011/07/19 ...
15 years, 4 months ago (2011-07-20 21:02:06 UTC) #18
Mark S. Miller
http://codereview.appspot.com/4701044/diff/37001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/37001/src/com/google/caja/es53.js#newcode4852 src/com/google/caja/es53.js:4852: if (!proto.ne___) { This ensures only that *any* the ...
15 years, 4 months ago (2011-07-21 21:11:12 UTC) #19
Mark S. Miller
http://codereview.appspot.com/4701044/diff/44001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/44001/src/com/google/caja/es53.js#newcode4849 src/com/google/caja/es53.js:4849: if (isIn('get', handler)) { Can't do 'in' test to ...
15 years, 4 months ago (2011-07-22 17:45:24 UTC) #20
metaweta
http://codereview.appspot.com/4701044/diff/44001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/44001/src/com/google/caja/es53.js#newcode4849 src/com/google/caja/es53.js:4849: if (isIn('get', handler)) { On 2011/07/22 17:45:24, Mark S. ...
15 years, 4 months ago (2011-07-22 19:05:24 UTC) #21
Mark S. Miller
Mike, when you fix a problem, please fix all occurrences of the problem. http://codereview.appspot.com/4701044/diff/45004/src/com/google/caja/es53.js File ...
15 years, 4 months ago (2011-07-22 19:14:44 UTC) #22
metaweta
http://codereview.appspot.com/4701044/diff/44001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/44001/src/com/google/caja/es53.js#newcode4849 src/com/google/caja/es53.js:4849: if (isIn('get', handler)) { On 2011/07/22 17:45:24, Mark S. ...
15 years, 4 months ago (2011-07-22 19:17:15 UTC) #23
metaweta
On Fri, Jul 22, 2011 at 12:14 PM, <erights@google.com> wrote: > Mike, when you fix ...
15 years, 4 months ago (2011-07-22 19:18:41 UTC) #24
Mark S. Miller
On 2011/07/22 19:14:44, Mark S. Miller wrote: > Mike, when you fix a problem, please ...
15 years, 4 months ago (2011-07-22 19:18:45 UTC) #25
metaweta
Snapshotted with a fix to the ne___ bug (I fixed it in the function proxy ...
15 years, 4 months ago (2011-07-22 19:36:20 UTC) #26
Mark S. Miller
Except for the issue below, especially the things that trigger a fix trap, LGTM. I'll ...
15 years, 4 months ago (2011-07-22 19:38:11 UTC) #27
Mark S. Miller
On Fri, Jul 22, 2011 at 12:38 PM, <erights@google.com> wrote: > Except for the issue ...
15 years, 4 months ago (2011-07-22 20:15:28 UTC) #28
Mark S. Miller
Modulo the names[i] problem below, LGTM. http://codereview.appspot.com/4701044/diff/49002/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/49002/src/com/google/caja/es53.js#newcode4924 src/com/google/caja/es53.js:4924: assertValidPropertyName(names[i]); This still ...
15 years, 4 months ago (2011-07-23 00:06:30 UTC) #29
tomvc.be
15 years, 3 months ago (2011-08-11 13:19:36 UTC) #30
http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js
File src/com/google/caja/es53.js (right):

http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js#...
src/com/google/caja/es53.js:4711: return desc.get.f___(safeDis(proxy), []);
On 2011/07/20 00:37:53, Mark S. Miller wrote:
> On 2011/07/20 00:12:02, Mark S. Miller wrote:
> > Since desc is untrusted (it came from cajoled code), desc.get could be an
> > accessor, or desc itself may be a proxy. In either case, the expression
above
> > for obtaining the value of desc.get is correct, but the obtained value
should
> be
> > used here (e.g. "getter.f___(...") rather than asking the same question
twice
> > and assuming stable answers.
> > 
> > Likewise perhaps at other places below; I haven't checked.
> 
> I was surprised to find that the proxies default handlers page actually
> specified that desc.get and desc.set each be obtained twice, which seems wrong
> for the above reasons. At
> http://wiki.ecmascript.org/doku.php?id=harmony:proxies&rev=1310650763&do=diff
I
> revised it to ask each of these once.
> 
> Tom, does this change seem right to you? Was there a reason other than brevity
> why the previous code asked each question twice? I notice that this code is
> prefaced with a disclaimer that it is normative. Where is the normative
> expression of these default trap behaviors? Does it ask these once or twice?

The way the non-normative default traps are expressed on the wiki page, your
change is correct. If |proxy| were added as an optional last argument to all
traps, and the fundamental trap were invoked through |proxy| rather than via a
self-send through |this|, then the change would not have been necessary as the
descriptor would have been normalized. The default traps on the proxies wiki
page are non-normative precisely because of issues like this.

That said, the normative behavior (specified on the proxies_semantics wiki page)
falls back on the [[Get]] behavior for Object (ES5 8.12.3), which only asks the
question once (and only on a normalized property descriptor object).
Sign in to reply to this message.

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