Browse Source

Watch inspected objects for changes only where there is a DOM.

HLInspector class starts refreshing its inspectors every half second
as its package loads. Outside the browser there is nothing to refresh,
and the interval kept Node alive after the test runner had reported,
so grunt test never finished.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Herby Vojčík 1 day ago
parent
commit
280d433092
2 changed files with 7 additions and 4 deletions
  1. 5 3
      src/Helios-Inspector.js
  2. 2 1
      src/Helios-Inspector.st

+ 5 - 3
src/Helios-Inspector.js

@@ -1781,11 +1781,11 @@ selector: "initialize",
 protocol: "initialization",
 protocol: "initialization",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
 args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09self watchChanges",
-referencedClasses: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09PlatformDom isFeasible ifTrue: [\x0a\x09\x09self watchChanges ]",
+referencedClasses: ["PlatformDom"],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 pragmas: [],
 pragmas: [],
-messageSends: ["initialize", "watchChanges"]
+messageSends: ["initialize", "ifTrue:", "isFeasible", "watchChanges"]
 }, function ($methodClass){ return function (){
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -1800,7 +1800,9 @@ $ctx1.supercall = true,
 ,$ctx1.supercall = false
 ,$ctx1.supercall = false
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 ][0];
 ][0];
+if($core.assert($recv($globals.PlatformDom)._isFeasible())){
 $self._watchChanges();
 $self._watchChanges();
+}
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"initialize",{})});
 }, function($ctx1) {$ctx1.fill(self,"initialize",{})});

+ 2 - 1
src/Helios-Inspector.st

@@ -428,7 +428,8 @@ inspect: anObject
 
 
 initialize
 initialize
 	super initialize.
 	super initialize.
-	self watchChanges
+	PlatformDom isFeasible ifTrue: [
+		self watchChanges ]
 !
 !
 
 
 watchChanges
 watchChanges