10 lines
371 B
JavaScript
10 lines
371 B
JavaScript
|
// most Object methods by ES6 should accept primitives
|
||
|
var $export = require('./$.export')
|
||
|
, core = require('./$.core')
|
||
|
, fails = require('./$.fails');
|
||
|
module.exports = function(KEY, exec){
|
||
|
var fn = (core.Object || {})[KEY] || Object[KEY]
|
||
|
, exp = {};
|
||
|
exp[KEY] = exec(fn);
|
||
|
$export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
|
||
|
};
|