Backed out changeset e44bc308642a (bug 813901) and changeset 19f154ee6f54 (bug 850000) for bustage on a CLOSED TREE.

This commit is contained in:
Ryan VanderMeulen 2013-03-13 13:22:14 -04:00
parent 3c74b8ac6d
commit 06be39f3ec
3 changed files with 1 additions and 32 deletions

View File

@ -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);
}

View File

@ -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__/);
}

View File

@ -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]