MCPcopy Create free account
hub / github.com/mozilla/rhino / clear

Method clear

rhino/src/main/java/org/mozilla/javascript/Hashtable.java:266–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

264 }
265
266 public void clear() {
267 // Zero out all the entries so that existing iterators will skip them all
268 Iterator<Entry> it = iterator();
269 it.forEachRemaining(Entry::clear);
270
271 // Replace the existing list with a dummy, and make it the last node
272 // of the current list. If new nodes are added now, existing iterators
273 // will drive forward right into the new list. If they are not, then
274 // nothing is referencing the old list and it'll get GCed.
275 if (first != null) {
276 Entry dummy = makeDummy();
277 last.next = dummy;
278 first = last = dummy;
279 }
280
281 // Now we can clear the actual hashtable!
282 map.clear();
283 }
284
285 @Override
286 public Iterator<Entry> iterator() {

Callers 13

setLengthMethod · 0.45
sealObjectMethod · 0.45
js_clearMethod · 0.45
js_clearMethod · 0.45
collections.jsFile · 0.45
addTestFilesMethod · 0.45
emptyMethod · 0.45
crudMethod · 0.45
testTwoListMethod · 0.45
enterInterruptImplMethod · 0.45
MoreWindowsMethod · 0.45

Calls 2

iteratorMethod · 0.95
makeDummyMethod · 0.95

Tested by 5

addTestFilesMethod · 0.36
emptyMethod · 0.36
crudMethod · 0.36
testTwoListMethod · 0.36