File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -393,25 +393,25 @@ Proxies enable creation of objects with the full range of behaviors available to
393
393
394
394
``` JavaScript
395
395
// Proxying a normal object
396
- var target = {};
397
- var handler = {
398
- get : function (receiver , name ) {
396
+ var target = {};
397
+ var handler = {
398
+ get : function (receiver , name ) {
399
399
return ` Hello, ${ name} !` ;
400
- }
401
- };
400
+ }
401
+ };
402
402
403
- var p = new Proxy (target, handler);
403
+ var p = new Proxy (target, handler);
404
404
p .world === ' Hello, world!' ;
405
405
```
406
406
407
407
``` JavaScript
408
408
// Proxying a function object
409
- var target = function () { return ' I am the target' ; };
409
+ var target = function () { return ' I am the target' ; };
410
410
var handler = {
411
411
apply : function (receiver , ... args ) {
412
412
return ' I am the proxy' ;
413
- }
414
- };
413
+ }
414
+ };
415
415
416
416
var p = new Proxy (target, handler);
417
417
p () === ' I am the proxy' ;
You can’t perform that action at this time.
0 commit comments