From c94d4e694c7db3bb4083d71bffbe06d2f340010f Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Wed, 30 Jul 2014 12:23:02 -0700 Subject: [PATCH] Bug 965898 - All properties from cross-origin objects are "configurable", non-enumerable, and non-writable. r=gabor --- js/xpconnect/wrappers/FilteringWrapper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/xpconnect/wrappers/FilteringWrapper.cpp b/js/xpconnect/wrappers/FilteringWrapper.cpp index 2e589810583..6baf08c4335 100644 --- a/js/xpconnect/wrappers/FilteringWrapper.cpp +++ b/js/xpconnect/wrappers/FilteringWrapper.cpp @@ -189,6 +189,13 @@ CrossOriginXrayWrapper::getPropertyDescriptor(JSContext *cx, if (desc.object()) { // All properties on cross-origin DOM objects are |own|. desc.object().set(wrapper); + + // All properties on cross-origin DOM objects are non-enumerable and + // "configurable". Any value attributes are read-only. + desc.attributesRef() &= ~JSPROP_ENUMERATE; + desc.attributesRef() &= ~JSPROP_PERMANENT; + if (!desc.getter() && !desc.setter()) + desc.attributesRef() |= JSPROP_READONLY; } return true; }