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

Issue 12694044: Better DOMException taming. (Closed)

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

Description

On Firefox and Safari, but not Chrome, DOMException is not instanceof Error. Furthermore, on Safari the prototype of DOMException does not have an overridden .constructor property. This meant that the taming membrane would consider it to be a plain record and tame it as such. With these changes, the taming membrane now tames a DOMException as an Error. (It cannot be copied as a DOMException for two reasons: the DOMException ctor is inert, and DOMException is a funky host object in some ways, such that whitelisting it is possibly inadvisable.) * Taming membrane's copyBuiltin tames DOMException as Error. * Taming membrane tries copyBuiltin before failing if directConstructor returns undefined. * Both implementations of directConstructor will return undefined instead of BASE_OBJECT_CONSTRUCTOR in the case where the object inherits .constructor == Object.prototype from a distant ancestor rather than its direct prototype. * Added test for taming of DOMException. * Removed workarounds in es53-test-scan-guest.js for this problem (which hid it on Firefox but not on Safari). Incidental changes: * ES5/3 directConstructor will now use Object.getPrototypeOf if available rather than resorting to (ES3-compatible) temporary deletion of properties. * Remove nonfunctional and unnecessary "makeCallable" from the definition of the "directAccess" object. @r5559

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -48 lines) Patch
M src/com/google/caja/es53.js View 2 chunks +14 lines, -3 lines 0 comments Download
M src/com/google/caja/plugin/ses-frame-group.js View 2 chunks +16 lines, -2 lines 0 comments Download
M src/com/google/caja/plugin/taming-membrane.js View 3 chunks +9 lines, -4 lines 0 comments Download
M tests/com/google/caja/plugin/browser-test-case.js View 1 chunk +0 lines, -14 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-scan-guest.js View 1 chunk +0 lines, -4 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-taming-tamed.js View 1 chunk +14 lines, -0 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-taming-tamed-guest.html View 2 chunks +27 lines, -21 lines 0 comments Download

Messages

Total messages: 3
kpreid2
12 years, 7 months ago (2013-08-09 18:16:43 UTC) #1
kpreid2
ping
12 years, 7 months ago (2013-08-13 21:24:22 UTC) #2
ihab.awad
12 years, 7 months ago (2013-08-14 03:19:17 UTC) #3
lgtm
Sign in to reply to this message.

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