[AS3] Unsingleton

trace(new Unsingleton is Singleton) // true

:cyclops:

package {
	public class Unsingleton extends Singleton {
		public function Unsingleton(){
			try {
				Error.throwError(Error, 0)
				super(null)
			} catch(v:*){}
		}
	}
}

Assuming that you’re using one [URL=“http://archive.darronschall.com/weblog/2007/11/actionscript-3-singleton-redux.html”]of the [URL=“http://blog.pixelbreaker.com/actionscript-3-0/as30-better-singletons”]typical singleton patterns. The use case would be that some annoying person makes a class a singleton, but overlooked some reason why that would be a bad idea and you’re stuck with that code.

Clearly this could be broken by making Singleton final, but people never seem to do that.