From 06be39f3ec3dbeb9a410840ae84918eba6dd6695 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Wed, 13 Mar 2013 13:22:14 -0400 Subject: [PATCH] Backed out changeset e44bc308642a (bug 813901) and changeset 19f154ee6f54 (bug 850000) for bustage on a CLOSED TREE. --- js/src/jsproxy.h | 7 +------ js/xpconnect/tests/unit/test_bug813901.js | 25 ----------------------- js/xpconnect/tests/unit/xpcshell.ini | 1 - 3 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 js/xpconnect/tests/unit/test_bug813901.js diff --git a/js/src/jsproxy.h b/js/src/jsproxy.h index 731d607c125f..f213f417d5f7 100644 --- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -357,12 +357,7 @@ class JS_FRIEND_API(AutoEnterPolicy) allow = handler->hasPolicy() ? handler->enter(cx, wrapper, id, act, &rv) : true; recordEnter(cx, wrapper, id); - // We want to throw an exception if all of the following are true: - // * The policy disallowed access. - // * The policy set rv to false, indicating that we should throw. - // * The caller did not instruct us to ignore exceptions. - // * The policy did not throw itself. - if (!allow && !rv && mayThrow && !cx->isExceptionPending()) + if (!allow && !rv && mayThrow) reportError(cx, id); } diff --git a/js/xpconnect/tests/unit/test_bug813901.js b/js/xpconnect/tests/unit/test_bug813901.js deleted file mode 100644 index 42f981581b51..000000000000 --- a/js/xpconnect/tests/unit/test_bug813901.js +++ /dev/null @@ -1,25 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* See https://bugzilla.mozilla.org/show_bug.cgi?id=813901 */ - -const Cu = Components.utils; - -// Make sure that we can't inject __exposedProps__ via the proto of a COW-ed object. - -function checkThrows(expression, sb, regexp) { - var result = Cu.evalInSandbox('(function() { try { ' + expression + '; return "allowed"; } catch (e) { return e.toString(); }})();', sb); - dump('result: ' + result + '\n\n\n'); - do_check_true(!!regexp.exec(result)); -} - -function run_test() { - - var sb = new Cu.Sandbox('http://www.example.org'); - sb.obj = {foo: 2}; - checkThrows('obj.foo = 3;', sb, /denied/); - Cu.evalInSandbox("var p = {__exposedProps__: {foo: 'rw'}};", sb); - sb.obj.__proto__ = sb.p; - checkThrows('obj.foo = 4;', sb, /__exposedProps__/); -} diff --git a/js/xpconnect/tests/unit/xpcshell.ini b/js/xpconnect/tests/unit/xpcshell.ini index 4a79dc53951d..9be45117a9a9 100644 --- a/js/xpconnect/tests/unit/xpcshell.ini +++ b/js/xpconnect/tests/unit/xpcshell.ini @@ -15,7 +15,6 @@ tail = [test_bug780370.js] [test_bug805807.js] [test_bug809652.js] -[test_bug813901.js] [test_bug845201.js] [test_bug_442086.js] [test_file.js]