Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
SeleniumHQ
GitHub Repository: SeleniumHQ/Selenium
Path: blob/trunk/third_party/closure/goog/disposable/dispose.js
4116 views
1
/**
2
* @license
3
* Copyright The Closure Library Authors.
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
/**
8
* @fileoverview The dispose method is used to clean up references and
9
* resources.
10
*/
11
12
goog.module('goog.dispose');
13
goog.module.declareLegacyNamespace();
14
15
/**
16
* Calls `dispose` on the argument if it supports it. If obj is not an
17
* object with a dispose() method, this is a no-op.
18
* @param {*} obj The object to dispose of.
19
*/
20
function dispose(obj) {
21
if (obj && typeof obj.dispose == 'function') {
22
obj.dispose();
23
}
24
}
25
exports = dispose;
26
27