| 722 | !function(){ |
| 723 | // Object static methods accept primitives |
| 724 | function wrapObjectMethod(key, MODE){ |
| 725 | var fn = Object[key] |
| 726 | , exp = core[OBJECT][key] |
| 727 | , f = 0 |
| 728 | , o = {}; |
| 729 | if(!exp || isNative(exp)){ |
| 730 | o[key] = MODE == 1 ? function(it){ |
| 731 | return isObject(it) ? fn(it) : it; |
| 732 | } : MODE == 2 ? function(it){ |
| 733 | return isObject(it) ? fn(it) : true; |
| 734 | } : MODE == 3 ? function(it){ |
| 735 | return isObject(it) ? fn(it) : false; |
| 736 | } : MODE == 4 ? function(it, key){ |
| 737 | return fn(toObject(it), key); |
| 738 | } : function(it){ |
| 739 | return fn(toObject(it)); |
| 740 | }; |
| 741 | try { fn(DOT) } |
| 742 | catch(e){ f = 1 } |
| 743 | $define(STATIC + FORCED * f, OBJECT, o); |
| 744 | } |
| 745 | } |
| 746 | wrapObjectMethod('freeze', 1); |
| 747 | wrapObjectMethod('seal', 1); |
| 748 | wrapObjectMethod('preventExtensions', 1); |