OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 assertTrue(s.has(p1)); | 63 assertTrue(s.has(p1)); |
64 assertTrue(s.has(p2)); | 64 assertTrue(s.has(p2)); |
65 assertFalse(s.has(p3)); | 65 assertFalse(s.has(p3)); |
66 | 66 |
67 s.delete(p2); | 67 s.delete(p2); |
68 assertTrue(s.has(p1)); | 68 assertTrue(s.has(p1)); |
69 assertFalse(s.has(p2)); | 69 assertFalse(s.has(p2)); |
70 assertFalse(s.has(p3)); | 70 assertFalse(s.has(p3)); |
71 } | 71 } |
72 | 72 |
73 TestSet(Set, Object.seal) | 73 // TODO(neis): Reenable once proxies properly support these operations. |
74 TestSet(Set, Object.freeze) | 74 // TestSet(Set, Object.seal) |
75 TestSet(Set, Object.preventExtensions) | 75 // TestSet(Set, Object.freeze) |
| 76 // TestSet(Set, Object.preventExtensions) |
76 | 77 |
77 | 78 |
78 // Maps and weak maps. | 79 // Maps and weak maps. |
79 | 80 |
80 function TestMap(construct, fix) { | 81 function TestMap(construct, fix) { |
81 TestWithProxies(TestMap2, construct, fix) | 82 TestWithProxies(TestMap2, construct, fix) |
82 } | 83 } |
83 | 84 |
84 function TestMap2(construct, fix, create) { | 85 function TestMap2(construct, fix, create) { |
85 var handler = {fix: function() { return {} }} | 86 var handler = {fix: function() { return {} }} |
(...skipping 20 matching lines...) Expand all Loading... |
106 assertSame(321, m.get(p2)); | 107 assertSame(321, m.get(p2)); |
107 | 108 |
108 m.delete(p2); | 109 m.delete(p2); |
109 assertTrue(m.has(p1)); | 110 assertTrue(m.has(p1)); |
110 assertFalse(m.has(p2)); | 111 assertFalse(m.has(p2)); |
111 assertFalse(m.has(p3)); | 112 assertFalse(m.has(p3)); |
112 assertSame(123, m.get(p1)); | 113 assertSame(123, m.get(p1)); |
113 assertSame(undefined, m.get(p2)); | 114 assertSame(undefined, m.get(p2)); |
114 } | 115 } |
115 | 116 |
116 TestMap(Map, Object.seal) | 117 // TODO(neis): Reenable once proxies properly support these operations. |
117 TestMap(Map, Object.freeze) | 118 // TestMap(Map, Object.seal) |
118 TestMap(Map, Object.preventExtensions) | 119 // TestMap(Map, Object.freeze) |
| 120 // TestMap(Map, Object.preventExtensions) |
119 | 121 |
120 TestMap(WeakMap, Object.seal) | 122 // TODO(neis): Reenable once proxies properly support these operations. |
121 TestMap(WeakMap, Object.freeze) | 123 // TestMap(WeakMap, Object.seal) |
122 TestMap(WeakMap, Object.preventExtensions) | 124 // TestMap(WeakMap, Object.freeze) |
| 125 // TestMap(WeakMap, Object.preventExtensions) |
OLD | NEW |