Guest User

Untitled

a guest
Jul 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. package {
  2. import flash.errors.IllegalOperationError;
  3. import flash.utils.Dictionary;
  4. import flash.utils.Proxy;
  5. import flash.utils.flash_proxy;
  6.  
  7. use namespace flash_proxy;
  8. public dynamic class ImmutableProxy extends Proxy {
  9. private const propertyMap:Dictionary = new Dictionary();
  10.  
  11. override flash_proxy function getProperty(name:*):* {
  12. return propertyMap[name];
  13. }
  14.  
  15. override flash_proxy function setProperty(name:*, value:*):void {
  16. if (name in propertyMap) {
  17. throw new IllegalOperationError("Multiple mutation not supported.")
  18. }
  19. propertyMap[name] = value;
  20. }
  21.  
  22. }
  23. }
Add Comment
Please, Sign In to add comment