-
Notifications
You must be signed in to change notification settings - Fork 26
/
proxy-api.js
45 lines (41 loc) · 1.15 KB
/
proxy-api.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
return new Proxy(obj, {
get(target, property) {
return Reflect.get(target, property);
},
set(target, property, value) {
return Reflect.set(target, property, value);
},
has(target, property) {
return Reflect.has(target, property);
},
deleteProperty(target, property) {
return Reflect.deleteProperty(target, property);
},
defineProperty(target, property, attrs) {
return Reflect.defineProperty(target, property, attrs);
},
ownKeys(target) {
return Reflect.ownKeys(target);
},
apply(target, thisArg, argumentsList) {
return Reflect.apply(target, thisArg, argumentsList);
},
construct(target, argumentsList, newTarget) {
return Reflect.construct(target, argumentsList, newTarget);
},
getPrototypeOf(target) {
return Reflect.getPrototypeOf(target);
},
setPrototypeOf(target, prototype) {
return Reflect.getPrototypeOf(target, prototype);
},
isExtensible(target) {
return Reflect.isExtensible(target);
},
preventExtensions(target) {
return Reflect.preventExtensions(target);
},
getOwnPropertyDescriptor(target, prop) {
return Reflect.getOwnPropertyDescriptor(target, prop);
}
});