Index: test/mjsunit/harmony/symbols.js |
diff --git a/test/mjsunit/harmony/symbols.js b/test/mjsunit/harmony/symbols.js |
index 3fcd06dfdca985fcd81abd8630cb8ededa8fe0d7..812ed196a1a06ff7caef04874de0227146a4a271 100644 |
--- a/test/mjsunit/harmony/symbols.js |
+++ b/test/mjsunit/harmony/symbols.js |
@@ -298,6 +298,15 @@ function TestKeyNames(obj) { |
} |
+function TestKeySymbols(obj) { |
rossberg
2013/12/10 10:39:53
Let's call this TestGetOwnPropertySymbols
arv (Not doing code reviews)
2013/12/11 00:16:26
Done.
|
+ var syms = Object.getOwnPropertySymbols(obj) |
+ assertEquals(syms.length, symbols.length) |
+ for (var i in syms) { |
+ assertEquals("symbol", typeof syms[i]) |
rossberg
2013/12/10 10:39:53
Also assert that insertion order is maintained (wh
arv (Not doing code reviews)
2013/12/11 00:16:26
You sent me off on goose chase there. I finally fi
rossberg
2013/12/12 15:37:59
Ah, sorry about that. I should have known.
|
+ } |
+} |
+ |
+ |
function TestKeyDescriptor(obj) { |
for (var i in symbols) { |
var desc = Object.getOwnPropertyDescriptor(obj, symbols[i]); |
@@ -331,6 +340,7 @@ for (var i in objs) { |
TestKeyHas(obj) |
TestKeyEnum(obj) |
TestKeyNames(obj) |
+ TestKeySymbols(obj) |
TestKeyDescriptor(obj) |
TestKeyDelete(obj) |
} |
@@ -350,3 +360,12 @@ function TestCachedKeyAfterScavenge() { |
} |
} |
TestCachedKeyAfterScavenge(); |
+ |
+ |
+function TestGetOwnPropertySymbolsWithPrivateSymbols() { |
rossberg
2013/12/10 10:39:53
Nit: Move this next to the other test.
arv (Not doing code reviews)
2013/12/11 00:16:26
I kept it here because this test does not take an
|
+ var privateSymbol = %CreatePrivateSymbol("private") |
+ var obj = {} |
rossberg
2013/12/10 10:39:53
Hm, the private symbol is never added to obj. ;)
arv (Not doing code reviews)
2013/12/11 00:16:26
Doh!
|
+ var syms = Object.getOwnPropertySymbols(obj) |
+ assertEquals(syms.length, 0) |
+} |
+TestGetOwnPropertySymbolsWithPrivateSymbols() |