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

Unified Diff: test/mjsunit/harmony/private.js

Issue 355123006: Make freeze & friends ignore private properties (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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
« no previous file with comments | « test/cctest/test-types.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/private.js
diff --git a/test/mjsunit/harmony/private.js b/test/mjsunit/harmony/private.js
index 225799831cf696f3e5586485d6b642bc95c22d01..c4b0ed2b2bccc31737bc4f499955d9fd60434a8c 100644
--- a/test/mjsunit/harmony/private.js
+++ b/test/mjsunit/harmony/private.js
@@ -342,3 +342,18 @@ function TestGetOwnPropertySymbols() {
assertEquals(syms, [publicSymbol, publicSymbol2])
}
TestGetOwnPropertySymbols()
+
+
+function TestSealAndFreeze(freeze) {
+ var sym = %CreatePrivateSymbol("private")
+ var obj = {}
+ obj[sym] = 1
+ freeze(obj)
+ obj[sym] = 2
+ assertEquals(2, obj[sym])
+ assertTrue(delete obj[sym])
+ assertEquals(undefined, obj[sym])
+}
+TestSealAndFreeze(Object.seal)
+TestSealAndFreeze(Object.freeze)
+TestSealAndFreeze(Object.preventExtensions)
« no previous file with comments | « test/cctest/test-types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698