Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Unified Diff: test/cctest/test-api.cc

Issue 6534019: Add access checks to Object.preventExtensions + add regression test for 1027.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/runtime.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
===================================================================
--- test/cctest/test-api.cc (revision 6829)
+++ test/cctest/test-api.cc (working copy)
@@ -5652,8 +5652,7 @@
}
-// This is a regression test for issue 1154.
-TEST(AccessControlObjectKeys) {
+TEST(AccessControlES5) {
v8::HandleScope handle_scope;
v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
@@ -5677,7 +5676,33 @@
v8::Handle<v8::Object> global1 = context1->Global();
global1->Set(v8_str("other"), global0);
+ // Regression test for issue 1154.
ExpectTrue("Object.keys(other).indexOf('blocked_prop') == -1");
+
+ ExpectUndefined("other.blocked_prop");
+
+ // Regression test for issue 1027.
+ ExpectUndefined(
+ "Object.defineProperty("
antonm 2011/02/17 15:44:12 feel free to ignore: I would group lines into some
Rico 2011/02/18 07:49:09 Done.
+ "other,"
+ "'blocked_prop',"
+ "{configurable: false}"
+ ").blocked_prop");
antonm 2011/02/17 15:44:12 might be slightly easier for people not that exper
Rico 2011/02/18 07:49:09 Done.
+ ExpectUndefined(
+ "Object.getOwnPropertyDescriptor(other, 'blocked_prop')");
+
+ // Regression test for issue 1171.
+ ExpectTrue("Object.isExtensible(other)");
+ CompileRun("Object.preventExtensions(other)");
+ ExpectTrue("Object.isExtensible(other)");
+
+ // Seal and freeze uses other functions which already includes access
antonm 2011/02/17 15:44:12 function[s] hence include with not s, correct?
Rico 2011/02/18 07:49:09 Changed comment
+ // checks, but we check these anyway.
antonm 2011/02/17 15:44:12 and maybe you can just drop this comment
Rico 2011/02/18 07:49:09 Done.
+ CompileRun("Object.freeze(other)");
+ ExpectTrue("Object.isExtensible(other)");
+
+ CompileRun("Object.seal(other)");
+ ExpectTrue("Object.isExtensible(other)");
}
« src/runtime.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698