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

Issue 96420043: Adds test for newly reported defineProperty bug with old repair. (Closed)

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

Description

https://code.google.com/p/chromium/issues/detail?id=374327 https://gist.github.com/getify/22ac00ba029e707f19f5 demonstrate that setting a function's prototype with defineProperty updates its descriptor but not its actual value.

Patch Set 1 #

Patch Set 2 : Adds test for newly reported defineProperty bug with old repair. #

Patch Set 3 : Adds test for newly reported defineProperty bug with old repair. #

Total comments: 10

Patch Set 4 : Adds test for newly reported defineProperty bug with old repair. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -3 lines) Patch
M src/com/google/caja/ses/repairES5.js View 1 2 3 5 chunks +47 lines, -3 lines 0 comments Download

Messages

Total messages: 6
MarkM
11 years, 9 months ago (2014-05-18 16:37:49 UTC) #1
MarkM
https://code.google.com/p/chromium/issues/detail?id=374327 https://gist.github.com/getify/22ac00ba029e707f19f5 demonstrate that setting a function's prototype with defineProperty updates its descriptor but not ...
11 years, 9 months ago (2014-05-18 16:37:56 UTC) #2
MarkM
https://code.google.com/p/chromium/issues/detail?id=374327 https://gist.github.com/getify/22ac00ba029e707f19f5 demonstrate that setting a function's prototype with defineProperty updates its descriptor but not ...
11 years, 9 months ago (2014-05-18 17:29:33 UTC) #3
kpreid_google
LGTM https://codereview.appspot.com/96420043/diff/40001/src/com/google/caja/ses/repairES5.js File src/com/google/caja/ses/repairES5.js (right): https://codereview.appspot.com/96420043/diff/40001/src/com/google/caja/ses/repairES5.js#newcode2716 src/com/google/caja/ses/repairES5.js:2716: function bar(){} space after ) https://codereview.appspot.com/96420043/diff/40001/src/com/google/caja/ses/repairES5.js#newcode2717 src/com/google/caja/ses/repairES5.js:2717: Object.defineProperty(bar,'prototype',{value:2,writable:false}); ...
11 years, 9 months ago (2014-05-19 16:40:59 UTC) #4
MarkM
https://code.google.com/p/chromium/issues/detail?id=374327 https://gist.github.com/getify/22ac00ba029e707f19f5 demonstrate that setting a function's prototype with defineProperty updates its descriptor but not ...
11 years, 9 months ago (2014-05-19 18:15:01 UTC) #5
MarkM
11 years, 9 months ago (2014-05-19 18:15:20 UTC) #6
https://codereview.appspot.com/96420043/diff/40001/src/com/google/caja/ses/re...
File src/com/google/caja/ses/repairES5.js (right):

https://codereview.appspot.com/96420043/diff/40001/src/com/google/caja/ses/re...
src/com/google/caja/ses/repairES5.js:2716: function bar(){}
On 2014/05/19 16:40:59, kpreid_google wrote:
> space after )

Done.

https://codereview.appspot.com/96420043/diff/40001/src/com/google/caja/ses/re...
src/com/google/caja/ses/repairES5.js:2717:
Object.defineProperty(bar,'prototype',{value:2,writable:false});
On 2014/05/19 16:40:59, kpreid_google wrote:
> space after , and :

Done.

https://codereview.appspot.com/96420043/diff/40001/src/com/google/caja/ses/re...
src/com/google/caja/ses/repairES5.js:2725: } else if (typeof bar.prototype ===
'object') {
On 2014/05/19 16:40:59, kpreid_google wrote:
> How about saving the original bar.prototype and comparing with it here? This
> makes a stricter new-symptom check and clarifies what the bug is.

Done.

https://codereview.appspot.com/96420043/diff/40001/src/com/google/caja/ses/re...
src/com/google/caja/ses/repairES5.js:2763: logger.warn('prototype fixup failed',
err);
On 2014/05/19 16:40:59, kpreid_google wrote:
> Curiosity: how is it safe for this to be nonfatal?

Done. I now rethrow the err.

https://codereview.appspot.com/96420043/diff/40001/src/com/google/caja/ses/re...
src/com/google/caja/ses/repairES5.js:4429: id:
'DEFINE_PROPERTY_CONFUSES_FUNC_PROTO',
On 2014/05/19 16:40:59, kpreid_google wrote:
> How about putting this problem next to the other ones that use
> repair_DEFINE_PROPERTY rather than at the end?

Done.
Sign in to reply to this message.

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