* (c) 2013 Rod Vagg <rod@vagg.org>
* https://github.com/rvagg/prr
(function (name, context, definition) {
if (typeof module != 'undefined' && module.exports)
module.exports = definition()
context[name] = definition()
})('prr', this, function() {
var setProperty = typeof Object.defineProperty == 'function'
? function (obj, key, options) {
Object.defineProperty(obj, key, options)
: function (obj, key, options) { // < es5
, makeOptions = function (value, options) {
var oo = typeof options == 'object'
, os = !oo && typeof options == 'string'
? options.indexOf(p[0]) > -1
enumerable : op('enumerable')
, configurable : op('configurable')
, writable : op('writable')
, prr = function (obj, key, value, options) {
options = makeOptions(value, options)
if (typeof key == 'object') {
if (Object.hasOwnProperty.call(key, k)) {
setProperty(obj, k, options)
return setProperty(obj, key, options)