Skip to content

Commit 329c888

Browse files
committed
Convert weblg.js to use HandleAllocator.
1 parent 5763b39 commit 329c888

File tree

2 files changed

+150
-161
lines changed

2 files changed

+150
-161
lines changed

src/library.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3719,7 +3719,8 @@ mergeInto(LibraryManager.library, {
37193719

37203720
$HandleAllocator__docs: '/** @constructor */',
37213721
$HandleAllocator: function() {
3722-
this.allocated = [];
3722+
// Reserve handle 0, so it can be used as the NULL handle.
3723+
this.allocated = [undefined];
37233724
this.freelist = [];
37243725
this.get = function(id) {
37253726
#if ASSERTIONS

0 commit comments

Comments
 (0)