From 2b4757367470d8e36bc00901dac567e375796ed4 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Tue, 13 Nov 2018 00:24:09 -0500 Subject: update viz 2 to use the newest version, which has some performance improvements and is easier to read the code for. also update the description --- assets/viz/2/goog/disposable/disposable.js | 19 ++++++++----------- assets/viz/2/goog/disposable/idisposable.js | 4 ++-- 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'assets/viz/2/goog/disposable') diff --git a/assets/viz/2/goog/disposable/disposable.js b/assets/viz/2/goog/disposable/disposable.js index ca8d088..a86f549 100644 --- a/assets/viz/2/goog/disposable/disposable.js +++ b/assets/viz/2/goog/disposable/disposable.js @@ -20,9 +20,7 @@ goog.provide('goog.Disposable'); -/** @suppress {extraProvide} */ goog.provide('goog.dispose'); -/** @suppress {extraProvide} */ goog.provide('goog.disposeAll'); goog.require('goog.disposable.IDisposable'); @@ -38,6 +36,13 @@ goog.require('goog.disposable.IDisposable'); * @implements {goog.disposable.IDisposable} */ goog.Disposable = function() { + /** + * If monitoring the goog.Disposable instances is enabled, stores the creation + * stack trace of the Disposable instance. + * @type {string|undefined} + */ + this.creationStack; + if (goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF) { if (goog.Disposable.INCLUDE_STACK_ON_CREATION) { this.creationStack = new Error().stack; @@ -139,14 +144,6 @@ goog.Disposable.prototype.disposed_ = false; goog.Disposable.prototype.onDisposeCallbacks_; -/** - * If monitoring the goog.Disposable instances is enabled, stores the creation - * stack trace of the Disposable instance. - * @const {string} - */ -goog.Disposable.prototype.creationStack; - - /** * @return {boolean} Whether the object has been disposed of. * @override @@ -215,7 +212,7 @@ goog.Disposable.prototype.registerDisposable = function(disposable) { */ goog.Disposable.prototype.addOnDisposeCallback = function(callback, opt_scope) { if (this.disposed_) { - callback.call(opt_scope); + goog.isDef(opt_scope) ? callback.call(opt_scope) : callback(); return; } if (!this.onDisposeCallbacks_) { diff --git a/assets/viz/2/goog/disposable/idisposable.js b/assets/viz/2/goog/disposable/idisposable.js index 917d17e..b539eb6 100644 --- a/assets/viz/2/goog/disposable/idisposable.js +++ b/assets/viz/2/goog/disposable/idisposable.js @@ -25,9 +25,9 @@ goog.provide('goog.disposable.IDisposable'); /** * Interface for a disposable object. If a instance requires cleanup - * (references COM objects, DOM notes, or other disposable objects), it should + * (references COM objects, DOM nodes, or other disposable objects), it should * implement this interface (it may subclass goog.Disposable). - * @interface + * @record */ goog.disposable.IDisposable = function() {}; -- cgit v1.2.3