Removed fallback check on each defineSecureProp call
This check was originally added because IE8's implementation is broken. However, we already perform a test in the `can_define_prop` configuration, so this is not necessary (it seems to be a relic).newmaster
parent
85cc251adf
commit
a52fcfa1d9
16
lib/util.js
16
lib/util.js
|
@ -562,8 +562,8 @@ exports.defineSecureProp( exports.getPropertyDescriptor, 'canTraverse',
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appropriately returns defineSecureProp implementation to avoid check on each
|
* Appropriately returns defineSecureProp implementation to avoid check on
|
||||||
* invocation
|
* each invocation
|
||||||
*
|
*
|
||||||
* @return {function( Object, string, * )}
|
* @return {function( Object, string, * )}
|
||||||
*/
|
*/
|
||||||
|
@ -583,8 +583,6 @@ function getDefineSecureProp()
|
||||||
{
|
{
|
||||||
// uses ECMAScript 5's Object.defineProperty() method
|
// uses ECMAScript 5's Object.defineProperty() method
|
||||||
return function( obj, prop, value )
|
return function( obj, prop, value )
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Object.defineProperty( obj, prop,
|
Object.defineProperty( obj, prop,
|
||||||
{
|
{
|
||||||
|
@ -594,16 +592,6 @@ function getDefineSecureProp()
|
||||||
writable: false,
|
writable: false,
|
||||||
configurable: false,
|
configurable: false,
|
||||||
} );
|
} );
|
||||||
}
|
|
||||||
catch ( e )
|
|
||||||
{
|
|
||||||
// let's not have this happen again, as repeatedly throwing
|
|
||||||
// exceptions will do nothing but slow down the system
|
|
||||||
exports.definePropertyFallback( true );
|
|
||||||
|
|
||||||
// there's an error (ehem, IE8); fall back
|
|
||||||
fallback( obj, prop, value );
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue