Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package {
- import flash.errors.IllegalOperationError;
- import flash.utils.Dictionary;
- import flash.utils.Proxy;
- import flash.utils.flash_proxy;
- use namespace flash_proxy;
- public dynamic class ImmutableProxy extends Proxy {
- private const propertyMap:Dictionary = new Dictionary();
- override flash_proxy function getProperty(name:*):* {
- return propertyMap[name];
- }
- override flash_proxy function setProperty(name:*, value:*):void {
- if (name in propertyMap) {
- throw new IllegalOperationError("Multiple mutation not supported.")
- }
- propertyMap[name] = value;
- }
- }
- }
Add Comment
Please, Sign In to add comment