File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3- const util = require ( 'util' ) ;
4-
5- function Functor ( ) {
6- }
3+ function Functor ( ) { }
74
85Functor . prototype . method = function ( ) {
96 console . log ( 'Functor.prototype.method' ) ;
107 console . dir ( {
118 property : this . property ,
12- exec : this . method
9+ method : this . method
1310 } ) ;
1411 this ( ) ; // you can call this as a function
1512} ;
1613
17- util . inherits ( Functor , Function ) ;
18-
1914const factory = ( ) => {
2015
2116 const functor = function ( ) {
@@ -29,6 +24,7 @@ const factory = () => {
2924
3025 Object . setPrototypeOf ( functor , Functor . prototype ) ;
3126 return functor ;
27+
3228} ;
3329
3430// Usage
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const factory = () => {
2424
2525 Object . setPrototypeOf ( functor , Functor . prototype ) ;
2626 return functor ;
27+
2728} ;
2829
2930// Usage
You can’t perform that action at this time.
0 commit comments