Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Cross origin wrappers #16501

Closed
wants to merge 13 commits into from

added in cross origin type checks. assert_throws isn't working yet

  • Loading branch information
avadacatavra committed May 15, 2017
commit 0316a0def67a21110c9f1666e6f8e368c6775605
@@ -77,6 +77,9 @@ enum WrapperType {
Opaque,
}

/* this is duplicate code. there's some in C in jsglue.cpp.
* TODO decide what to do about this
*/
#[derive(Debug, PartialEq)]
enum CrossOriginObjectType {
CrossOriginWindow,
@@ -60,27 +60,27 @@
//assert_equals(C.parent, window, "window.parent works cross-origin");
assert_equals(B.location.pathname, path, "location.href works same-origin");
//TODO do document.write and console.log have same behavior?
/*try {
try {
console.log("C.location.pathname should throw");
console.log(C.location.pathname); //permission denied to unwrap object
} catch(err) {
console.log(err.message);
}*/
console.log(C.location.pathname);
assert_throws("SecurityError", function() { C.location.pathname; }, "location.pathname throws cross-origin");
/*try {
console.log(err); //ok it's getting that it's a security error, but not reading it right for the asssert
}
//console.log(C.location.pathname);
//assert_throws("SecurityError", function() { C.location.pathname; }, "location.pathname throws cross-origin");
try {
console.log("B.frames: override");
console.log(B.frames);
} catch(err) {
console.log(err.message);
console.log(err);
}
//assert_equals(B.frames, 'override', "Overrides visible in the same-origin case");
assert_equals(B.frames, 'override', "Overrides visible in the same-origin case");
try {
console.log("C.frames should throw");
console.log(C.frames);
} catch(err) {
console.log(err.message);
}*/
console.log(err);
}
//assert_equals(C.frames, C, "Overrides invisible in the cross-origin case");
}, "Basic sanity-checking");

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.