Some checks failed
Build and Deploy / build-macos (push) Failing after 4s
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
Build and Deploy / package-dist (push) Has been cancelled
Build and Deploy / deploy-itch (push) Has been cancelled
Build and Deploy / deploy-gitea (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled
18 lines
594 B
JavaScript
18 lines
594 B
JavaScript
// Test that actors have access to $_
|
|
console.log("Testing actor access to $_:");
|
|
|
|
// In an actor script, $_ should be available
|
|
if (typeof $_ !== 'undefined') {
|
|
console.log("✓ Actor has access to $_");
|
|
console.log(" $_.random is a", typeof $_.random);
|
|
console.log(" $_.clock is a", typeof $_.clock);
|
|
|
|
// Test spawning another actor
|
|
var child = this.spawn('test_child_actor.js');
|
|
|
|
// Test using a module
|
|
var testModule = use('test_module');
|
|
console.log("✓ Module loaded, result:", testModule.test());
|
|
} else {
|
|
console.error("✗ Actor does NOT have access to $_");
|
|
} |