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

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

Issue 2915863004: [runtime] PreventExtensionsWithTransition: before adding the new (Closed)
Patch Set: [runtime] fix memory leak in PreventExtensionsWithTransition Created 3 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 | « src/objects.cc ('k') | test/mjsunit/regress/regress-refreeze-same-map.js » ('j') | 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 cd65af1c70572323fa2336966a55440d80614d7d..39376f3ea99dc46f36069c92c0fa7a945c5ece80 100644
--- a/test/mjsunit/harmony/private.js
+++ b/test/mjsunit/harmony/private.js
@@ -340,19 +340,37 @@ function TestGetOwnPropertySymbols() {
TestGetOwnPropertySymbols()
-function TestSealAndFreeze(freeze) {
+function TestSealAndFreeze(factory, freeze, isFrozen) {
var sym = %CreatePrivateSymbol("private")
- var obj = {}
+ var obj = factory();
obj[sym] = 1
freeze(obj)
+ assertTrue(isFrozen(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)
+
+var fastObj = () => {
+ var obj = {}
+ assertTrue(%HasFastProperties(obj))
+ return obj
+}
+var dictObj = () => {
+ var obj = Object.create(null)
+ obj.a = 1
+ delete obj.a
+ assertFalse(%HasFastProperties(obj))
+ return obj
+}
+
+TestSealAndFreeze(fastObj, Object.seal, Object.isSealed)
+TestSealAndFreeze(fastObj, Object.freeze, Object.isFrozen)
+TestSealAndFreeze(fastObj, Object.preventExtensions, obj => !Object.isExtensible(obj))
+TestSealAndFreeze(dictObj, Object.seal, Object.isSealed)
+TestSealAndFreeze(dictObj, Object.freeze, Object.isFrozen)
+TestSealAndFreeze(dictObj, Object.preventExtensions, obj => !Object.isExtensible(obj))
var s = %CreatePrivateSymbol("s");
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/regress/regress-refreeze-same-map.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698