File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint func-names: 0 */
2
2
/* eslint no-param-reassign: 0 */
3
+ /* eslint getter-return: 0 */
3
4
4
5
const X = 'x' ;
5
6
const Y = 'y' ;
@@ -97,8 +98,19 @@ export function cachedValueOf(Vector) {
97
98
export function cachedMethod ( Vector , name ) {
98
99
const org = Vector . prototype [ name ] ;
99
100
Vector . prototype [ name ] = function ( ...args ) {
100
- return v3resultCache [ inProgress ] . call ( this , org , args , name ) ;
101
+ return v3resultCache [ inProgress ] . call ( this , org , args ) ;
101
102
} ;
102
103
}
103
104
104
- export function cachedGetter ( /* Vector, name */ ) { }
105
+ export function cachedGetter ( Vector , name ) {
106
+ const desc = Object . getOwnPropertyDescriptor ( Vector . prototype , name ) ;
107
+ const org = function ( ) {
108
+ return desc . get . call ( this ) ;
109
+ } ;
110
+
111
+ Object . defineProperty ( Vector . prototype , name , {
112
+ get ( ) {
113
+ return v3resultCache [ inProgress ] . call ( this , org ) ;
114
+ }
115
+ } ) ;
116
+ }
You can’t perform that action at this time.
0 commit comments