This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.0 KiB
29 lines
1.0 KiB
6 years ago
|
// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
|
||
|
var $ = require('./$')
|
||
|
, has = require('./$.has')
|
||
|
, $export = require('./$.export')
|
||
|
, createDesc = require('./$.property-desc')
|
||
|
, anObject = require('./$.an-object')
|
||
|
, isObject = require('./$.is-object');
|
||
|
|
||
|
function set(target, propertyKey, V/*, receiver*/){
|
||
|
var receiver = arguments.length < 4 ? target : arguments[3]
|
||
|
, ownDesc = $.getDesc(anObject(target), propertyKey)
|
||
|
, existingDescriptor, proto;
|
||
|
if(!ownDesc){
|
||
|
if(isObject(proto = $.getProto(target))){
|
||
|
return set(proto, propertyKey, V, receiver);
|
||
|
}
|
||
|
ownDesc = createDesc(0);
|
||
|
}
|
||
|
if(has(ownDesc, 'value')){
|
||
|
if(ownDesc.writable === false || !isObject(receiver))return false;
|
||
|
existingDescriptor = $.getDesc(receiver, propertyKey) || createDesc(0);
|
||
|
existingDescriptor.value = V;
|
||
|
$.setDesc(receiver, propertyKey, existingDescriptor);
|
||
|
return true;
|
||
|
}
|
||
|
return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
|
||
|
}
|
||
|
|
||
|
$export($export.S, 'Reflect', {set: set});
|