Reviewers: ihab.awad,

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.

Please review this at https://codereview.appspot.com/12694044/

Affected files:
  M     src/com/google/caja/es53.js
  M     src/com/google/caja/plugin/ses-frame-group.js
  M     src/com/google/caja/plugin/taming-membrane.js
  M     tests/com/google/caja/plugin/browser-test-case.js
  M     tests/com/google/caja/plugin/es53-test-scan-guest.js
  M     tests/com/google/caja/plugin/es53-test-taming-tamed-guest.html
  M     tests/com/google/caja/plugin/es53-test-taming-tamed.js


--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to