Comparing version 1.0.0 to 1.0.2
@@ -0,1 +1,3 @@ | ||
/*eslint no-console: 0*/ | ||
'use strict'; | ||
@@ -53,3 +55,3 @@ | ||
value: undefined | ||
};; | ||
}; | ||
}); | ||
@@ -134,5 +136,5 @@ | ||
// cannot redefine property | ||
catch (d_err) { | ||
catch (d_redef_err) { | ||
// try again, this time only set the value | ||
// try again, this time only set the value and enumerability | ||
try { | ||
@@ -144,3 +146,3 @@ Object.defineProperty(w_copy, s_property, { | ||
// | ||
// mask w undef | ||
value: undefined | ||
@@ -155,4 +157,21 @@ }); | ||
// cannot even do that?! | ||
catch (e) { | ||
throw 'cannot override property "' + s_property + '" on ' + (0, _arginfo2['default'])(w_copy); | ||
catch (d_enum_err) { | ||
// last try, this time only set the value | ||
try { | ||
Object.defineProperty(w_copy, s_property, { | ||
// mask w undef | ||
value: undefined | ||
}); | ||
// was not exepecting this property to give us trouble | ||
if (!A_TROUBLE_PROPERTIES.includes(s_property)) { | ||
console.warn('was not expecting "' + s_property + '" to prohibit redefinition on ' + (0, _arginfo2['default'])(w_copy)); | ||
} | ||
} | ||
// fail | ||
catch (d_value_err) { | ||
throw 'cannot override property "' + s_property + '" on ' + (0, _arginfo2['default'])(w_copy); | ||
} | ||
} | ||
@@ -178,3 +197,3 @@ } | ||
return; | ||
}; | ||
} | ||
@@ -181,0 +200,0 @@ // create transparent property |
{ | ||
"name": "rmprop", | ||
"version": "1.0.0", | ||
"version": "1.0.2", | ||
"description": "Override all properties inhereted by an object's prototype chain", | ||
@@ -5,0 +5,0 @@ "author": { |
13750
211