Closed pixelzoom closed 5 months ago
The current implementation already prevents, right?
Thanks for the issue so that I could double check. We are correctly disabling the ability to call Emitter.emit() and PhetioAction.execute with invocableForReadOnlyElements:false
.
https://github.com/phetsims/axon/blob/af83520d5345b81f3affeddd8de70d2412583c34/js/Emitter.ts#L180
Closing
Slack#phet-io:
@pixelzoom What does
phetioReadOnly: true
do for an Emitter? Does it prevent calls to EmitterIO’semit
method? (edited)@samreid I don’t see a mention of
phetioReadOnly
in Emitter.ts, so perhaps it has no bearing one way or the other?@samreid Oh wait, it has
invocableForReadOnlyElements: false
so it would prevent.@zepumph Look at
PhetioDataHandler
@zepumph Maybe not though. It seems like we shouldn't be able to emit or execute on readonly elements.