added a tool to track stray globals...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-05-24 01:54:55 +03:00
parent 14a0d3c3ba
commit 141e2e8295

View File

@ -44,6 +44,16 @@ function scopeDiff(cur=window, base=__window){
<!-- DevTools fail-safe for electron/nw... -->
<script>
// used to track stray globals...
var trackGlobal = function(name){
Object.defineProperty(window, name, {
get: function(){
return this['__tracked_'+name] },
set: function(value){
this['__tracked_'+name] = value
debugger },
}) }
if(window.require){
Object.defineProperty(window, 'STARTUP_DEVTOOLS_TIMEOUT', {
get: function(){