/*----------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is Fever Framework code. The Initial Developer of the Original Code is Romain Ecarnot. Portions created by Initial Developer are Copyright (C) 2006 the Initial Developer. All Rights Reserved. Contributor(s): OpenSource Flash Community Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -----------------------------------------------------------------------------*/ import com.bourre.core.HashCodeFactory; import com.bourre.utils.ClassUtils; import fever.log.FeverDebug; /** * Provides methods to deal with object. * * @author Romain Ecarnot */ class fever.utils.ObjectUtils { //------------------------------------------------------------------------- // Public API //------------------------------------------------------------------------- /** * Protect object for undefined access. * *
Retreives from Pixlib framework
* Implemented here to keep current version.
*/
public static function protectObject( o ) : Void
{
o.__resolve = function( s : String ) : String
{
FeverDebug.ERROR( "'" + s + "' property is undefined in " +
ClassUtils.getFullyQualifiedClassName( o ) + HashCodeFactory.getKey( o )
);
return "";
};
_global.ASSetPropFlags( o, "__resolve", 7, 1 );
}
/**
* Unprotect an object
*
*
Retreives from Pixlib framework
* Implemented here to keep current version.
*/
public static function unprotectObject( o ) : Void
{
_global.ASSetPropFlags(o, "__resolve", 0, 7);
delete o.__resolve;
}
/**
* Hides passed-in {@code propertyName} from {@code container} object.
*/
public static function hideProperty( container : Object, propertyName : String ) : Void
{
_global.ASSetPropFlags( container, propertyName, 7, true );
}
//-------------------------------------------------------------------------
// Private implementation
//-------------------------------------------------------------------------
private function ObjectUtils() {}
}